1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Fix highlight notifications for unencrypted rooms

A logic error introduced by https://github.com/matrix-org/matrix-js-sdk/pull/886 meant that all unencrypted rooms were not getting highlight notifications.
This commit is contained in:
Travis Ralston
2019-04-08 15:57:44 -06:00
parent 420b4d119d
commit 9dc344999e

View File

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