Mercurial > libervia-backend
comparison src/plugins/plugin_exp_parrot.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 | aa94f33fd2ad |
comparison
equal
deleted
inserted
replaced
1969:5fbe09b9b568 | 1970:200cd707a46d |
---|---|
91 entity_type = self.host.memory.getEntityData(from_jid, ['type'], profile)["type"] | 91 entity_type = self.host.memory.getEntityData(from_jid, ['type'], profile)["type"] |
92 except (UnknownEntityError, KeyError): | 92 except (UnknownEntityError, KeyError): |
93 entity_type = "contact" | 93 entity_type = "contact" |
94 if entity_type == 'chatroom': | 94 if entity_type == 'chatroom': |
95 src_txt = from_jid.resource | 95 src_txt = from_jid.resource |
96 if src_txt == self.host.plugins["XEP-0045"].getRoomNick(from_jid.userhostJID(), profile): | 96 if src_txt == self.host.plugins["XEP-0045"].getRoomNick(client, from_jid.userhostJID()): |
97 #we won't repeat our own messages | 97 #we won't repeat our own messages |
98 return True | 98 return True |
99 else: | 99 else: |
100 src_txt = from_jid.user | 100 src_txt = from_jid.user |
101 message[lang] = u"[{}] {}".format(src_txt, body) | 101 message[lang] = u"[{}] {}".format(src_txt, body) |