Mercurial > libervia-pubsub
changeset 462:a017af61a32b
privilege: add server JID to `publisher` so `+notify` works with it:
the server's PEP itself is now working as other PEP accounts, i.e. notification of last
published message are sent on presence received when `+notify` is used.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 15 Oct 2021 09:32:07 +0200 |
parents | c9238fca1fb3 |
children | f520ac3164b0 |
files | CHANGELOG sat_pubsub/privilege.py |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGELOG Fri Oct 15 09:32:07 2021 +0200 +++ b/CHANGELOG Fri Oct 15 09:32:07 2021 +0200 @@ -4,10 +4,11 @@ - publish-options implementation - max_items configuration option - Full-Text Search, with node setting to specify language - - XEP-0346 (Form Discovery and Publishing) implementation (replacing the non standard node schema) + - Form Discovery and Publishing (XEP-0346) implementation (replacing the non standard node schema) - environment variables can now be used to set options - server jid can now be specified with "server_jid" parameter, otherwise it's determined automatically - service name can now be specified with "service_name" parameter + - PEP is now working for server itself, making it usable for Service Outage Status (XEP-0455) - namespace delegation update to v0.5 ("urn:xmpp:delegation:2" is now used) - bug fixes
--- a/sat_pubsub/privilege.py Fri Oct 15 09:32:07 2021 +0200 +++ b/sat_pubsub/privilege.py Fri Oct 15 09:32:07 2021 +0200 @@ -292,8 +292,12 @@ nodes = tuple(self.hash_map[disco_tuple]['notify']) if not nodes: return - # publishers are entities which have granted presence access to our user + user itself - publishers = tuple(self.presence_map.get(from_jid_bare, ())) + (from_jid_bare,) + # publishers are entities which have granted presence access to our user + # + user itself + server + publishers = ( + tuple(self.presence_map.get(from_jid_bare, ())) + + (from_jid_bare, self.backend.server_jid) + ) #Â FIXME: add "presence" access_model (for node) for getLastItems last_items = yield self._backend.storage.getLastItems(publishers, nodes, ('open',), ('open',), True)