Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
757e2c79
Commit
757e2c79
authored
8 years ago
by
David Baker
Browse files
Options
Downloads
Patches
Plain Diff
Don't push for everyone who ever sent an RR to the room
parent
43a89cca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/push/bulk_push_rule_evaluator.py
+13
-1
13 additions, 1 deletion
synapse/push/bulk_push_rule_evaluator.py
with
13 additions
and
1 deletion
synapse/push/bulk_push_rule_evaluator.py
+
13
−
1
View file @
757e2c79
...
...
@@ -71,13 +71,25 @@ def _get_rules(room_id, user_ids, store):
@defer.inlineCallbacks
def
evaluator_for_event
(
event
,
hs
,
store
):
room_id
=
event
.
room_id
# users in the room who have pushers need to get push rules run because
# that's how their pushers work
users_with_pushers
=
yield
store
.
get_users_with_pushers_in_room
(
room_id
)
# We also will want to generate notifs for other people in the room so
# their unread countss are correct in the event stream, but to avoid
# generating them for bot / AS users etc, we only do so for people who've
# sent a read receipt into the room.
all_in_room
=
yield
store
.
get_users_in_room
(
room_id
)
all_in_room
=
set
(
all_in_room
)
receipts
=
yield
store
.
get_receipts_for_room
(
room_id
,
"
m.read
"
)
# any users with pushers must be ours: they have pushers
user_ids
=
set
(
users_with_pushers
)
for
r
in
receipts
:
if
hs
.
is_mine_id
(
r
[
'
user_id
'
]):
if
hs
.
is_mine_id
(
r
[
'
user_id
'
])
and
r
[
'
user_id
'
]
in
all_in_room
:
user_ids
.
add
(
r
[
'
user_id
'
])
# if this event is an invite event, we may need to run rules for the user
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment