Chats: don't update own messages from streaming (for now)
This commit is contained in:
parent
de78926142
commit
7722ce5e68
|
@ -109,8 +109,17 @@ const connectTimelineStream = (
|
||||||
break;
|
break;
|
||||||
case 'pleroma:chat_update':
|
case 'pleroma:chat_update':
|
||||||
case 'chat_message': // TruthSocial
|
case 'chat_message': // TruthSocial
|
||||||
updateChat(JSON.parse(data.payload));
|
dispatch((dispatch: AppDispatch, getState: () => RootState) => {
|
||||||
play(soundCache.chat);
|
const chat = JSON.parse(data.payload);
|
||||||
|
const me = getState().me;
|
||||||
|
const messageOwned = chat.last_message?.account_id === me;
|
||||||
|
|
||||||
|
// Don't update own messages from streaming
|
||||||
|
if (!messageOwned) {
|
||||||
|
updateChat(chat);
|
||||||
|
play(soundCache.chat);
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case 'pleroma:follow_relationships_update':
|
case 'pleroma:follow_relationships_update':
|
||||||
dispatch(updateFollowRelationships(JSON.parse(data.payload)));
|
dispatch(updateFollowRelationships(JSON.parse(data.payload)));
|
||||||
|
|
Loading…
Reference in New Issue