You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Fix sender_notification_permission cond
Don't assume all events have a sender, because they don't.
This commit is contained in:
@@ -158,6 +158,14 @@ function PushProcessor(client) {
|
|||||||
notifLevel = powerLevels.getContent().notifications[notifLevelKey];
|
notifLevel = powerLevels.getContent().notifications[notifLevelKey];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This cannot be assumed to always be set for state events
|
||||||
|
// (in particular it is never set for the room creation event
|
||||||
|
// because it preceeds the join event of the sender).
|
||||||
|
// In these cases, this condition cannot match.
|
||||||
|
if (ev.sender === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return ev.sender.powerLevel >= notifLevel;
|
return ev.sender.powerLevel >= notifLevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user