Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0249.py @ 3172:dcebc585c29f
core: renamed "MessageReceived" trigger to "messageReceived" for consistency.
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 18 Feb 2020 18:13:19 +0100 |
parents | 559a625a236b |
children | be6d91572633 |
comparison
equal
deleted
inserted
replaced
3171:d073d82d9044 | 3172:dcebc585c29f |
---|---|
92 try: | 92 try: |
93 self.host.plugins[C.TEXT_CMDS].registerTextCommands(self) | 93 self.host.plugins[C.TEXT_CMDS].registerTextCommands(self) |
94 except KeyError: | 94 except KeyError: |
95 log.info(_("Text commands not available")) | 95 log.info(_("Text commands not available")) |
96 host.registerNamespace('x-conference', NS_X_CONFERENCE) | 96 host.registerNamespace('x-conference', NS_X_CONFERENCE) |
97 host.trigger.add("MessageReceived", self._MessageReceivedTrigger) | 97 host.trigger.add("messageReceived", self._messageReceivedTrigger) |
98 | 98 |
99 def getHandler(self, client): | 99 def getHandler(self, client): |
100 return XEP_0249_handler() | 100 return XEP_0249_handler() |
101 | 101 |
102 def _invite(self, guest_jid_s, room_jid_s, options, profile_key): | 102 def _invite(self, guest_jid_s, room_jid_s, options, profile_key): |
141 % {"room": room_jid.userhost(), "profile": client.profile} | 141 % {"room": room_jid.userhost(), "profile": client.profile} |
142 ) | 142 ) |
143 d = self.host.plugins["XEP-0045"].join(client, room_jid, client.jid.user, {}) | 143 d = self.host.plugins["XEP-0045"].join(client, room_jid, client.jid.user, {}) |
144 return d | 144 return d |
145 | 145 |
146 def _MessageReceivedTrigger(self, client, message_elt, post_treat): | 146 def _messageReceivedTrigger(self, client, message_elt, post_treat): |
147 """Check if a direct invitation is in the message, and handle it""" | 147 """Check if a direct invitation is in the message, and handle it""" |
148 x_elt = next(message_elt.elements(NS_X_CONFERENCE, 'x'), None) | 148 x_elt = next(message_elt.elements(NS_X_CONFERENCE, 'x'), None) |
149 if x_elt is None: | 149 if x_elt is None: |
150 return True | 150 return True |
151 | 151 |