mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-16 19:43:50 +01:00
Comment
This commit is contained in:
parent
a297155a97
commit
e892457a03
2 changed files with 6 additions and 0 deletions
|
@ -254,6 +254,9 @@ class Filter(object):
|
||||||
Returns:
|
Returns:
|
||||||
bool: True if the event matches
|
bool: True if the event matches
|
||||||
"""
|
"""
|
||||||
|
# We usually get the full "events" as dictionaries coming through,
|
||||||
|
# except for presence which actually gets passed around as its own
|
||||||
|
# namedtuple type.
|
||||||
if isinstance(event, UserPresenceState):
|
if isinstance(event, UserPresenceState):
|
||||||
sender = event.user_id
|
sender = event.user_id
|
||||||
room_id = None
|
room_id = None
|
||||||
|
|
|
@ -984,6 +984,9 @@ def should_notify(old_state, new_state):
|
||||||
def format_user_presence_state(state, now, include_user_id=True):
|
def format_user_presence_state(state, now, include_user_id=True):
|
||||||
"""Convert UserPresenceState to a format that can be sent down to clients
|
"""Convert UserPresenceState to a format that can be sent down to clients
|
||||||
and to other servers.
|
and to other servers.
|
||||||
|
|
||||||
|
The "user_id" is optional so that this function can be used to format presence
|
||||||
|
updates for client /sync responses and for federation /send requests.
|
||||||
"""
|
"""
|
||||||
content = {
|
content = {
|
||||||
"presence": state.state,
|
"presence": state.state,
|
||||||
|
|
Loading…
Reference in a new issue