Chats: don't update own messages from streaming (for now)

This commit is contained in:
Alex Gleason 2022-09-29 10:58:58 -05:00
parent de78926142
commit 7722ce5e68
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -109,8 +109,17 @@ const connectTimelineStream = (
break;
case 'pleroma:chat_update':
case 'chat_message': // TruthSocial
updateChat(JSON.parse(data.payload));
dispatch((dispatch: AppDispatch, getState: () => RootState) => {
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;
case 'pleroma:follow_relationships_update':
dispatch(updateFollowRelationships(JSON.parse(data.payload)));