mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-10 11:59:59 -04:00
Enable presence again. Fix up api to match old api.
This commit is contained in:
parent
c1cf0b334e
commit
67c5f89244
5 changed files with 35 additions and 10 deletions
|
@ -15,6 +15,8 @@
|
|||
|
||||
from twisted.internet import defer
|
||||
|
||||
from synapse.api.events import SynapseEvent
|
||||
|
||||
from ._base import BaseHandler
|
||||
|
||||
import logging
|
||||
|
@ -50,10 +52,15 @@ class EventStreamHandler(BaseHandler):
|
|||
|
||||
events, tokens = yield self.notifier.get_events_for(auth_user, pagin_config, timeout)
|
||||
|
||||
chunks = [
|
||||
e.get_dict() if isinstance(e, SynapseEvent) else e
|
||||
for e in events
|
||||
]
|
||||
|
||||
chunk = {
|
||||
"chunk": [e.get_dict() for e in events],
|
||||
"start_token": tokens[0].to_string(),
|
||||
"end_token": tokens[1].to_string(),
|
||||
"chunk": chunks,
|
||||
"start": tokens[0].to_string(),
|
||||
"end": tokens[1].to_string(),
|
||||
}
|
||||
|
||||
defer.returnValue(chunk)
|
||||
|
|
|
@ -142,7 +142,7 @@ class PresenceHandler(BaseHandler):
|
|||
@defer.inlineCallbacks
|
||||
def is_presence_visible(self, observer_user, observed_user):
|
||||
defer.returnValue(True)
|
||||
return
|
||||
#return
|
||||
# FIXME (erikj): This code path absolutely kills the database.
|
||||
|
||||
assert(observed_user.is_mine)
|
||||
|
@ -189,7 +189,7 @@ class PresenceHandler(BaseHandler):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def set_state(self, target_user, auth_user, state):
|
||||
return
|
||||
# return
|
||||
# TODO (erikj): Turn this back on. Why did we end up sending EDUs
|
||||
# everywhere?
|
||||
|
||||
|
|
|
@ -126,8 +126,8 @@ class MessageHandler(BaseHandler):
|
|||
|
||||
chunk = {
|
||||
"chunk": [e.get_dict() for e in events],
|
||||
"start_token": from_token.to_string(),
|
||||
"end_token": next_token.to_string(),
|
||||
"start": from_token.to_string(),
|
||||
"end": next_token.to_string(),
|
||||
}
|
||||
|
||||
defer.returnValue(chunk)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue