diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2023-10-24 11:51:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 11:51:08 +0200 |
commit | 1b124fe9cba8b4699a1f65382e4ea1a5674d12fa (patch) | |
tree | 3664bfc6b505cc5f8394b760e8d0d06ccfcf0250 /userapi | |
parent | c1d6b9aa8ef29a76b61b1aaf60572d3493adf306 (diff) |
Implement MSC3987, fix setting Element Android notifications (#3242)
Should fix https://github.com/matrix-org/dendrite/issues/3183, since
Element Android already implements
[MSC3987](https://github.com/vector-im/element-android/pull/8530)
This is also part of https://github.com/matrix-org/dendrite/issues/3225
Diffstat (limited to 'userapi')
-rw-r--r-- | userapi/consumers/roomserver.go | 4 | ||||
-rw-r--r-- | userapi/consumers/roomserver_test.go | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/userapi/consumers/roomserver.go b/userapi/consumers/roomserver.go index 6da41f8a..fca74129 100644 --- a/userapi/consumers/roomserver.go +++ b/userapi/consumers/roomserver.go @@ -538,8 +538,8 @@ func (s *OutputRoomEventConsumer) notifyLocal(ctx context.Context, event *rstype if err != nil { return fmt.Errorf("pushrules.ActionsToTweaks: %w", err) } - // TODO: support coalescing. - if a != pushrules.NotifyAction && a != pushrules.CoalesceAction { + + if a != pushrules.NotifyAction { log.WithFields(log.Fields{ "event_id": event.EventID(), "room_id": event.RoomID().String(), diff --git a/userapi/consumers/roomserver_test.go b/userapi/consumers/roomserver_test.go index 49dd5b23..7b7c0861 100644 --- a/userapi/consumers/roomserver_test.go +++ b/userapi/consumers/roomserver_test.go @@ -81,12 +81,8 @@ func Test_evaluatePushRules(t *testing.T) { { name: "m.reaction doesn't notify", eventContent: `{"type":"m.reaction","room_id":"!room:example.com"}`, - wantAction: pushrules.DontNotifyAction, - wantActions: []*pushrules.Action{ - { - Kind: pushrules.DontNotifyAction, - }, - }, + wantAction: pushrules.UnknownAction, + wantActions: []*pushrules.Action{}, }, { name: "m.room.message notifies", @@ -136,7 +132,7 @@ func Test_evaluatePushRules(t *testing.T) { t.Fatalf("expected action to be '%s', got '%s'", tc.wantAction, gotAction) } // this is taken from `notifyLocal` - if tc.wantNotify && gotAction != pushrules.NotifyAction && gotAction != pushrules.CoalesceAction { + if tc.wantNotify && gotAction != pushrules.NotifyAction { t.Fatalf("expected to notify but didn't") } }) |