Chat notifs: only play sound for recipient message
This commit is contained in:
parent
b49c3ad13e
commit
f643863ecc
1 changed files with 10 additions and 5 deletions
|
@ -55,11 +55,16 @@ export function connectTimelineStream(timelineId, path, pollingRefresh = null, a
|
|||
dispatch(fetchFilters());
|
||||
break;
|
||||
case 'pleroma:chat_update':
|
||||
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: JSON.parse(data.payload),
|
||||
me: getState().get('me'),
|
||||
meta: getSettings(getState()).getIn(['chats', 'sound']) && { sound: 'chat' },
|
||||
chat,
|
||||
// Only play sounds for recipient messages
|
||||
meta: !messageOwned && getSettings(getState()).getIn(['chats', 'sound']) && { sound: 'chat' },
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue