Not all event streams returns SynapseEvents
This commit is contained in:
parent
2f91d16033
commit
291010f100
|
@ -18,6 +18,7 @@
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import EventStreamError
|
from synapse.api.errors import EventStreamError
|
||||||
|
from synapse.api.events import SynapseEvent
|
||||||
from synapse.api.events.room import (
|
from synapse.api.events.room import (
|
||||||
RoomMemberEvent, MessageEvent, FeedbackEvent, RoomTopicEvent
|
RoomMemberEvent, MessageEvent, FeedbackEvent, RoomTopicEvent
|
||||||
)
|
)
|
||||||
|
@ -160,7 +161,10 @@ class EventStream(PaginationStream):
|
||||||
self.user_id, from_pkey, to_pkey, limit
|
self.user_id, from_pkey, to_pkey, limit
|
||||||
)
|
)
|
||||||
|
|
||||||
chunk += [e.get_dict() for e in event_chunk]
|
chunk.extend([
|
||||||
|
e.get_dict() if isinstance(e, SynapseEvent) else e
|
||||||
|
for e in event_chunk
|
||||||
|
])
|
||||||
next_ver.append(str(max_pkey))
|
next_ver.append(str(max_pkey))
|
||||||
|
|
||||||
defer.returnValue((chunk, EventStream.SEPARATOR.join(next_ver)))
|
defer.returnValue((chunk, EventStream.SEPARATOR.join(next_ver)))
|
||||||
|
|
Loading…
Reference in New Issue