# HG changeset patch # User Goffi # Date 1625233197 -7200 # Node ID 1a179ad10125a64c177e104075c908f330ebaff5 # Parent 8da3db1e82a9d756fadc07be95daac1ae5ad588b backend: service name can now be specified with `service_name` parameter diff -r 8da3db1e82a9 -r 1a179ad10125 CHANGELOG --- a/CHANGELOG Fri Jul 02 15:18:09 2021 +0200 +++ b/CHANGELOG Fri Jul 02 15:39:57 2021 +0200 @@ -1,11 +1,12 @@ v 0.4.0 (NOT RELEASED YET): - - /!\ renamed to "Libervia Pubsub", application name is now "libervia-pubsub" + - /!\ renamed to "Libervia Pubsub", application name is now "libervia-pubsub" - Python 3 port - 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) - environment variables can now be used to set options + - service name can now be specified with "service_name" parameter - bug fixes v 0.3.0 (16/08/2019) diff -r 8da3db1e82a9 -r 1a179ad10125 sat_pubsub/backend.py --- a/sat_pubsub/backend.py Fri Jul 02 15:18:09 2021 +0200 +++ b/sat_pubsub/backend.py Fri Jul 02 15:39:57 2021 +0200 @@ -1335,7 +1335,7 @@ discoIdentity = disco.DiscoIdentity('pubsub', 'service', - 'Salut à Toi pubsub service') + const.SERVICE_NAME) pubsubService = None @@ -1372,6 +1372,8 @@ self.backend = backend self.hideNodes = False + self.__class__.discoIdentity.name = backend.config["service_name"] + self.backend.registerPublishNotifier(self._notifyPublish) self.backend.registerRetractNotifier(self._notifyRetract) self.backend.registerPreDelete(self._preDelete) diff -r 8da3db1e82a9 -r 1a179ad10125 sat_pubsub/const.py --- a/sat_pubsub/const.py Fri Jul 02 15:18:09 2021 +0200 +++ b/sat_pubsub/const.py Fri Jul 02 15:39:57 2021 +0200 @@ -51,6 +51,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +SERVICE_NAME = 'Libervia Pubsub Service' NS_CLIENT = 'jabber:client' NS_GROUPBLOG_PREFIX = 'urn:xmpp:groupblog:' NS_ITEM_CONFIG = "http://jabber.org/protocol/pubsub#item-config" diff -r 8da3db1e82a9 -r 1a179ad10125 twisted/plugins/pubsub.py --- a/twisted/plugins/pubsub.py Fri Jul 02 15:18:09 2021 +0200 +++ b/twisted/plugins/pubsub.py Fri Jul 02 15:39:57 2021 +0200 @@ -61,6 +61,7 @@ from twisted.plugin import IPlugin from twisted.words.protocols.jabber.jid import JID import sat_pubsub +from sat_pubsub import const @@ -90,6 +91,7 @@ ['db_pass', None, None, 'Database password (pgsql backend)'], ['db_host', None, None, 'Database host (pgsql backend)'], ['db_port', None, None, 'Database port (pgsql backend)'], + ['service_name', None, const.SERVICE_NAME, 'Name of this Pubsub service'], ] OPT_PARAMETERS_CFG = [ @@ -216,7 +218,6 @@ from wokkel import pubsub from wokkel import rsm from wokkel import mam - from sat_pubsub import const from sat_pubsub import mam as pubsub_mam from sat_pubsub import pubsub_admin from sat_pubsub.backend import BackendService, ExtraDiscoHandler