Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0060.py @ 3737:783d6dc87b80
plugin XEP-0060: specify sender using `client.jid` in `subscribe`:
this is necessary to do a subscription with a component managing a virtual JID (i.e. not
the JID of the component itself, but the one linked to a account, see
`SatXMPPComponent.getVirtualClient`).
rel 364
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 22 Mar 2022 17:00:42 +0100 |
parents | 33d75cd3c371 |
children | aa923e6b369f |
comparison
equal
deleted
inserted
replaced
3736:e52de21873d3 | 3737:783d6dc87b80 |
---|---|
1128 sub_jid: Optional[jid.JID] = None, | 1128 sub_jid: Optional[jid.JID] = None, |
1129 options: Optional[dict] = None | 1129 options: Optional[dict] = None |
1130 ) -> pubsub.Subscription: | 1130 ) -> pubsub.Subscription: |
1131 # TODO: reimplement a subscribtion cache, checking that we have not subscription before trying to subscribe | 1131 # TODO: reimplement a subscribtion cache, checking that we have not subscription before trying to subscribe |
1132 subscription = await client.pubsub_client.subscribe( | 1132 subscription = await client.pubsub_client.subscribe( |
1133 service, nodeIdentifier, sub_jid or client.jid.userhostJID(), options=options | 1133 service, nodeIdentifier, sub_jid or client.jid.userhostJID(), options=options, |
1134 sender=client.jid.userhostJID() | |
1134 ) | 1135 ) |
1135 await self.host.trigger.asyncPoint( | 1136 await self.host.trigger.asyncPoint( |
1136 "XEP-0060_subscribe", client, service, nodeIdentifier, sub_jid, options, | 1137 "XEP-0060_subscribe", client, service, nodeIdentifier, sub_jid, options, |
1137 subscription | 1138 subscription |
1138 ) | 1139 ) |