Presence Manager

In order to manage the presences of buddies, I found in the source code

    # jchdel: add presence signals handlers
    # from https://github.com/savoirfairelinux/jami-daemon/blob/master/bin/dbus/cx.ring.Ring.PresenceManager.xml
    def onNewBuddyNotification(self, accountId, buddyUri, status, lineStatus):
    def onNearbyPeerNotification(self, accountId, buddyUri, status, displayname):
    def onSubscriptionStateChanged(self, accountId, buddyUri, state):
    def onNewServerSubscriptionRequest(self, buddyUri):
    def onServerError(self, accountId, error, msg):

    #
    # Presence management
    # added by jchdel
    #

    def publish(self, accountId=None, status=True, note=""):
    def answerServerRequest(self, buddyUri="", flag=False):
    def subscribeBuddy(self, account=None, buddyUri="", flag=True):
    def getSubscriptions(self, accountId=None, credentialInformation=None):
    def setSubscriptions(self, accountId=None, uriList=[], invalidUris=[]):

but I do not find in the documentation the expected behavior!

I think how to subscribe is obvious. But when and what to publish is a kind of mystery…

and why does onNewServerSubscriptionRequest not refer the accountId?

1 Like

This is a question. I expect friends with a code foundation to answer it

I did this a long time ago to send the status (lineStatus was never implemented): https://review.jami.net/c/jami-daemon/+/27572

But in Jami, you don’t send the presence as it’s linked to the presence of the device itself on the network. Running the DHT node and publishing the certificate on it will serve as the presence.

So you cannot really be online but mark your status as offline, cause offline means there is no key on the DHT and you cannot receive message.

1 Like