1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Merge pull request #891 from matrix-org/travis/fix-notifs

Fix highlight notifications for unencrypted rooms
This commit is contained in:
Travis Ralston
2019-04-09 09:19:58 -06:00
committed by GitHub

View File

@@ -1105,8 +1105,9 @@ SyncApi.prototype._processSyncResponse = async function(
// bother setting it here. We trust our calculations better than the // bother setting it here. We trust our calculations better than the
// server's for this case, and therefore will assume that our non-zero // server's for this case, and therefore will assume that our non-zero
// count is accurate. // count is accurate.
if (client.isRoomEncrypted(room.roomId) const encrypted = client.isRoomEncrypted(room.roomId);
&& room.getUnreadNotificationCount('highlight') <= 0) { if (!encrypted
|| (encrypted && room.getUnreadNotificationCount('highlight') <= 0)) {
room.setUnreadNotificationCount( room.setUnreadNotificationCount(
'highlight', joinObj.unread_notifications.highlight_count, 'highlight', joinObj.unread_notifications.highlight_count,
); );