Mercurial > libervia-backend
comparison src/plugins/plugin_misc_text_commands.py @ 1970:200cd707a46d
plugin XEP-0045, quick_frontend + primitivus (chat): cleaning of XEP-0045 (first pass):
- bridge methods/signals now all start with "muc" to follow new convention
- internal method use client instead of profile to follow new convention
- removed excetpions from plugin XEP-0045 in favor of core.exceptions, NotReady added
- cleaned/simplified several part of the code. checkClient removed as it is not needed anymore
- self.clients map removed, muc data are now stored directly in client
- getRoomEntityNick and getRoomNicksOfUsers are removed as they don't look sane.
/!\ This break all room game plugins for the moment
- use of uuid4 instead of uuid1 for getUniqueName, as host ID and current time are used for uuid1
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 27 Jun 2016 21:45:11 +0200 |
parents | a2bc5089c2eb |
children | ed33cd382bf9 |
comparison
equal
deleted
inserted
replaced
1969:5fbe09b9b568 | 1970:200cd707a46d |
---|---|
303 entity = mess_data["unparsed"].strip() | 303 entity = mess_data["unparsed"].strip() |
304 | 304 |
305 if mess_data['type'] == "groupchat": | 305 if mess_data['type'] == "groupchat": |
306 room = mess_data["to"].userhostJID() | 306 room = mess_data["to"].userhostJID() |
307 try: | 307 try: |
308 if self.host.plugins["XEP-0045"].isNickInRoom(room, entity, client.profile): | 308 if self.host.plugins["XEP-0045"].isNickInRoom(client, room, entity): |
309 entity = u"%s/%s" % (room, entity) | 309 entity = u"%s/%s" % (room, entity) |
310 except KeyError: | 310 except KeyError: |
311 log.warning("plugin XEP-0045 is not present") | 311 log.warning("plugin XEP-0045 is not present") |
312 | 312 |
313 if not entity: | 313 if not entity: |
320 except (RuntimeError, jid.InvalidFormat, AttributeError): | 320 except (RuntimeError, jid.InvalidFormat, AttributeError): |
321 self.feedBack(client, _("Invalid jid, can't whois"), mess_data) | 321 self.feedBack(client, _("Invalid jid, can't whois"), mess_data) |
322 return False | 322 return False |
323 | 323 |
324 if not target_jid.resource: | 324 if not target_jid.resource: |
325 target_jid.resource = self.host.memory.getMainResource(target_jid, client.profile) | 325 target_jid.resource = self.host.memory.getMainResource(client, target_jid) |
326 | 326 |
327 whois_msg = [_(u"whois for %(jid)s") % {'jid': target_jid}] | 327 whois_msg = [_(u"whois for %(jid)s") % {'jid': target_jid}] |
328 | 328 |
329 d = defer.succeed(None) | 329 d = defer.succeed(None) |
330 for ignore, callback in self._whois: | 330 for ignore, callback in self._whois: |