declare a ReadReceipt class

I'm going to use this in queues and things, so it'll be useful to give it more
of a structure.
This commit is contained in:
Richard van der Hoff 2019-03-12 16:50:58 +00:00
parent d42c81d724
commit eed7271b3b
2 changed files with 34 additions and 24 deletions

View file

@ -16,6 +16,8 @@ import re
import string
from collections import namedtuple
import attr
from synapse.api.errors import SynapseError
@ -455,3 +457,13 @@ class ThirdPartyInstanceID(
@classmethod
def create(cls, appservice_id, network_id,):
return cls(appservice_id=appservice_id, network_id=network_id)
@attr.s(slots=True)
class ReadReceipt(object):
"""Information about a read-receipt"""
room_id = attr.ib()
receipt_type = attr.ib()
user_id = attr.ib()
event_ids = attr.ib()
data = attr.ib()