diff --git a/app/soapbox/actions/streaming.js b/app/soapbox/actions/streaming.js index 5fe687878..b3ca60fb3 100644 --- a/app/soapbox/actions/streaming.js +++ b/app/soapbox/actions/streaming.js @@ -55,11 +55,16 @@ export function connectTimelineStream(timelineId, path, pollingRefresh = null, a dispatch(fetchFilters()); break; case 'pleroma:chat_update': - dispatch({ - type: STREAMING_CHAT_UPDATE, - chat: JSON.parse(data.payload), - me: getState().get('me'), - meta: getSettings(getState()).getIn(['chats', 'sound']) && { sound: 'chat' }, + dispatch((dispatch, getState) => { + const chat = JSON.parse(data.payload); + const messageOwned = !(chat.last_message && chat.last_message.account_id !== getState().get('me')); + + dispatch({ + type: STREAMING_CHAT_UPDATE, + chat, + // Only play sounds for recipient messages + meta: !messageOwned && getSettings(getState()).getIn(['chats', 'sound']) && { sound: 'chat' }, + }); }); break; }