diff options
author | Will Hunt <will@half-shot.uk> | 2020-10-08 15:05:09 +0100 |
---|---|---|
committer | Will Hunt <will@half-shot.uk> | 2020-10-08 15:05:09 +0100 |
commit | d0dd953c272510e7487bc020177817b7f1f7c691 (patch) | |
tree | 302a2eca49699249a2f00d31e272be99a0957c05 /synapse/handlers/receipts.py | |
parent | Linkify MSC (diff) | |
download | synapse-d0dd953c272510e7487bc020177817b7f1f7c691.tar.xz |
Fix types / add docstrings
Diffstat (limited to 'synapse/handlers/receipts.py')
-rw-r--r-- | synapse/handlers/receipts.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/synapse/handlers/receipts.py b/synapse/handlers/receipts.py index a6db85c888..c242c409cf 100644 --- a/synapse/handlers/receipts.py +++ b/synapse/handlers/receipts.py @@ -13,10 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging +from typing import List, Tuple from synapse.appservice import ApplicationService from synapse.handlers._base import BaseHandler -from synapse.types import ReadReceipt, get_domain_from_id +from synapse.types import JsonDict, ReadReceipt, get_domain_from_id from synapse.util.async_helpers import maybe_awaitable logger = logging.getLogger(__name__) @@ -142,8 +143,15 @@ class ReceiptEventSource: return (events, to_key) async def get_new_events_as( - self, from_key: int, service: ApplicationService, **kwargs - ): + self, from_key: int, service: ApplicationService + ) -> Tuple[List[JsonDict], int]: + """Returns a set of new receipt events that an appservice + may be interested in. + + Args: + from_key: the stream position at which events should be fetched from + service: The appservice which may be interested + """ from_key = int(from_key) to_key = self.get_current_key() |