Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Presence (Messenger -> Matrix) #189

Merged
merged 7 commits into from
Jan 29, 2022
Merged

Conversation

JakuJ
Copy link
Contributor

@JakuJ JakuJ commented Nov 1, 2021

What?

Presence bridging from Messenger to Matrix.

This PR is WIP until I figure out how to properly make use of last_seen timestamps.
Update: there is no way to utilise the timestamps. Synapse will respond with an error if the payload of the PUT request contains any key other than "presence". This shouldn't be an issue though, Synapse keeps track of the "last seen ago" times on its own.

How?

The logic is based on how fbchat handles presence events.

Changes introduced in this PR:

  • Presence event data structures were added to maufbapi/types/mqtt/message.py.
  • The /orca_presence topic is now being subscribed to.
  • Since Synapse has a sync timeout of 30 seconds, a way of refreshing presence every 25 seconds was implemented. This is how mx-puppet-bridge handles timeout. This class was placed in a new module mautrix_facebook/presence.py.

@JakuJ JakuJ changed the title [WIP] Presence (Messenger -> Matrix) Presence (Messenger -> Matrix) Nov 2, 2021
@tulir tulir self-requested a review November 11, 2021 22:28
maufbapi/mqtt/conn.py Outdated Show resolved Hide resolved
@JuniorJPDJ
Copy link

@JakuJ bump

@JakuJ
Copy link
Contributor Author

JakuJ commented Jan 4, 2022

@JuniorJPDJ Yeah, I didn't have much time to work on open source lately, but I'll try to finish this by the end of the week 👍

JakuJ added 2 commits January 9, 2022 15:00
# Conflicts:
#	maufbapi/mqtt/conn.py
#	mautrix_facebook/__main__.py
#	mautrix_facebook/user.py
@JakuJ JakuJ requested a review from tulir January 9, 2022 16:01
@tulir tulir merged commit a8e6f57 into mautrix:master Jan 29, 2022
@JakuJ JakuJ deleted the presence branch January 29, 2022 19:06
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants