core, plugin XEP-0045: fixed message type autodetection + ENTITY_TYPE_MUC constant:

an old hardcoded value was used in several places to detect if an entity is a MUC, but this
value was not valid anymore. This has been fixed, and ENTITY_TYPE_MUC constant is now used
instead. This fixes message type autodetection for "groupchat" messages.

fixes 300
This commit is contained in:
Goffi 2019-07-09 09:06:45 +02:00
commit 5e43c6c98c

View file

@ -849,11 +849,12 @@ class Memory(object):
"""Set a misc data for an entity
If key was registered with setSignalOnUpdate, a signal will be sent to frontends
@param entity_jid: JID of the entity, C.ENTITY_ALL_RESOURCES for all resources of all entities,
C.ENTITY_ALL for all entities (all resources + bare jids)
@param key: key to set (eg: "type")
@param value: value for this key (eg: "chatroom")
@param silent(bool): if True, doesn't send signal to frontend, even if there is a signal flag (see setSignalOnUpdate)
@param entity_jid: JID of the entity, C.ENTITY_ALL_RESOURCES for all resources of
all entities, C.ENTITY_ALL for all entities (all resources + bare jids)
@param key: key to set (eg: C.ENTITY_TYPE)
@param value: value for this key (eg: C.ENTITY_TYPE_MUC)
@param silent(bool): if True, doesn't send signal to frontend, even if there is a
signal flag (see setSignalOnUpdate)
@param profile_key: %(doc_profile_key)s
"""
client = self.host.getClient(profile_key)
@ -886,7 +887,7 @@ class Memory(object):
@param entity_jid: JID of the entity, C.ENTITY_ALL_RESOURCES for all resources of all entities,
C.ENTITY_ALL for all entities (all resources + bare jids)
@param key: key to delete (eg: "type")
@param key: key to delete (eg: C.ENTITY_TYPE)
@param profile_key: %(doc_profile_key)s
@raise exceptions.UnknownEntityError: if entity is not in cache