diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2016-12-08 12:34:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-08 12:34:57 +0000 |
commit | da13b4aa861ab1596c7a08be8fecaf15f4f9db7a (patch) | |
tree | 252fbf11b25a154cbb5e7cf5e544746b03986dc6 | |
parent | Merge pull request #1672 from williamleuschner/develop (diff) | |
parent | Fix ignored read-receipts (diff) | |
download | synapse-da13b4aa861ab1596c7a08be8fecaf15f4f9db7a.tar.xz |
Merge pull request #1678 from matrix-org/rav/fix_receipt_notifications
Read-receipt fixes
-rw-r--r-- | synapse/handlers/receipts.py | 6 | ||||
-rw-r--r-- | synapse/storage/receipts.py | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/receipts.py b/synapse/handlers/receipts.py index 916e80a48e..50aa513935 100644 --- a/synapse/handlers/receipts.py +++ b/synapse/handlers/receipts.py @@ -100,7 +100,7 @@ class ReceiptsHandler(BaseHandler): if not res: # res will be None if this read receipt is 'old' - defer.returnValue(False) + continue stream_id, max_persisted_id = res @@ -109,6 +109,10 @@ class ReceiptsHandler(BaseHandler): if max_batch_id is None or max_persisted_id > max_batch_id: max_batch_id = max_persisted_id + if min_batch_id is None: + # no new receipts + defer.returnValue(False) + affected_room_ids = list(set([r["room_id"] for r in receipts])) with PreserveLoggingContext(): diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py index 9747a04a9a..f72d15f5ed 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py @@ -405,7 +405,7 @@ class ReceiptsStore(SQLBaseStore): room_id, receipt_type, user_id, event_ids, data ) - max_persisted_id = self._stream_id_gen.get_current_token() + max_persisted_id = self._receipts_id_gen.get_current_token() defer.returnValue((stream_id, max_persisted_id)) |