Fix stupid bug
parent
ea3210f8e5
commit
c9564e08ba
|
@ -135,6 +135,7 @@ class BulkPushRuleEvaluator:
|
||||||
# little, we can skip fetching a huge number of push rules in large rooms.
|
# little, we can skip fetching a huge number of push rules in large rooms.
|
||||||
# This helps make joins and leaves faster.
|
# This helps make joins and leaves faster.
|
||||||
if event.type == EventTypes.Member:
|
if event.type == EventTypes.Member:
|
||||||
|
local_users = []
|
||||||
# We never notify a user about their own actions. This is enforced in
|
# We never notify a user about their own actions. This is enforced in
|
||||||
# `_action_for_event_by_user` in the loop over `rules_by_user`, but we
|
# `_action_for_event_by_user` in the loop over `rules_by_user`, but we
|
||||||
# do the same check here to avoid unnecessary DB queries.
|
# do the same check here to avoid unnecessary DB queries.
|
||||||
|
@ -146,8 +147,6 @@ class BulkPushRuleEvaluator:
|
||||||
)
|
)
|
||||||
if target_already_in_room:
|
if target_already_in_room:
|
||||||
local_users = [event.state_key]
|
local_users = [event.state_key]
|
||||||
else:
|
|
||||||
return {}
|
|
||||||
else:
|
else:
|
||||||
# We get the users who may need to be notified by first fetching the
|
# We get the users who may need to be notified by first fetching the
|
||||||
# local users currently in the room, finding those that have push rules,
|
# local users currently in the room, finding those that have push rules,
|
||||||
|
@ -174,6 +173,9 @@ class BulkPushRuleEvaluator:
|
||||||
local_users = list(local_users)
|
local_users = list(local_users)
|
||||||
local_users.append(invited)
|
local_users.append(invited)
|
||||||
|
|
||||||
|
if not local_users:
|
||||||
|
return {}
|
||||||
|
|
||||||
rules_by_user = await self.store.bulk_get_push_rules(local_users)
|
rules_by_user = await self.store.bulk_get_push_rules(local_users)
|
||||||
|
|
||||||
logger.debug("Users in room: %s", local_users)
|
logger.debug("Users in room: %s", local_users)
|
||||||
|
|
Loading…
Reference in New Issue