diff --git a/app/soapbox/actions/streaming.js b/app/soapbox/actions/streaming.js index 1dddf60b2..a581ae0fe 100644 --- a/app/soapbox/actions/streaming.js +++ b/app/soapbox/actions/streaming.js @@ -55,7 +55,7 @@ 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) }); + dispatch({ type: STREAMING_CHAT_UPDATE, chat: JSON.parse(data.payload), me: getState().get('me') }); break; } }, diff --git a/app/soapbox/reducers/chat_message_lists.js b/app/soapbox/reducers/chat_message_lists.js index e03c57fb8..0d635070f 100644 --- a/app/soapbox/reducers/chat_message_lists.js +++ b/app/soapbox/reducers/chat_message_lists.js @@ -38,15 +38,16 @@ export default function chatMessageLists(state = initialState, action) { case CHATS_FETCH_SUCCESS: return importLastMessages(state, action.chats).sort(); case STREAMING_CHAT_UPDATE: - if (action.chat.last_message) + if (action.chat.last_message && + action.chat.last_message.account_id !== action.me) return importMessages(state, [action.chat.last_message]).sort(); else - return state.sort(); + return state; case CHAT_MESSAGES_FETCH_SUCCESS: return updateList(state, action.chatId, action.chatMessages.map(chat => chat.id).reverse()).sort(); case CHAT_MESSAGE_SEND_SUCCESS: return updateList(state, action.chatId, [action.chatMessage.id]).sort(); default: - return state.sort(); + return state; } };