diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-12-08 12:26:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 12:26:29 -0500 |
commit | d93362d87fbbf4941da06ade65eaf5df1672bccb (patch) | |
tree | c357e1655faa4e6c286b0ed3493ffc69ae9a529c /synapse/push/push_tools.py | |
parent | Clean up `synapse.rest.admin` (#11535) (diff) | |
download | synapse-d93362d87fbbf4941da06ade65eaf5df1672bccb.tar.xz |
Add a constant for receipt types (m.read). (#11531)
And expand some type hints in the receipts storage module.
Diffstat (limited to 'synapse/push/push_tools.py')
-rw-r--r-- | synapse/push/push_tools.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/push/push_tools.py b/synapse/push/push_tools.py index 9c85200c0f..da641aca47 100644 --- a/synapse/push/push_tools.py +++ b/synapse/push/push_tools.py @@ -13,6 +13,7 @@ # limitations under the License. from typing import Dict +from synapse.api.constants import ReceiptTypes from synapse.events import EventBase from synapse.push.presentable_names import calculate_room_name, name_from_member_event from synapse.storage import Storage @@ -23,7 +24,7 @@ async def get_badge_count(store: DataStore, user_id: str, group_by_room: bool) - invites = await store.get_invited_rooms_for_local_user(user_id) joins = await store.get_rooms_for_user(user_id) - my_receipts_by_room = await store.get_receipts_for_user(user_id, "m.read") + my_receipts_by_room = await store.get_receipts_for_user(user_id, ReceiptTypes.READ) badge = len(invites) |