Mercurial > libervia-backend
comparison sat/memory/memory.py @ 2994:94708a7d3ecf
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
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 09 Jul 2019 09:06:45 +0200 |
parents | c0f6fd75af5f |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
2993:d58dccd9e4b4 | 2994:94708a7d3ecf |
---|---|
847 self, entity_jid, key, value, silent=False, profile_key=C.PROF_KEY_NONE | 847 self, entity_jid, key, value, silent=False, profile_key=C.PROF_KEY_NONE |
848 ): | 848 ): |
849 """Set a misc data for an entity | 849 """Set a misc data for an entity |
850 | 850 |
851 If key was registered with setSignalOnUpdate, a signal will be sent to frontends | 851 If key was registered with setSignalOnUpdate, a signal will be sent to frontends |
852 @param entity_jid: JID of the entity, C.ENTITY_ALL_RESOURCES for all resources of all entities, | 852 @param entity_jid: JID of the entity, C.ENTITY_ALL_RESOURCES for all resources of |
853 C.ENTITY_ALL for all entities (all resources + bare jids) | 853 all entities, C.ENTITY_ALL for all entities (all resources + bare jids) |
854 @param key: key to set (eg: "type") | 854 @param key: key to set (eg: C.ENTITY_TYPE) |
855 @param value: value for this key (eg: "chatroom") | 855 @param value: value for this key (eg: C.ENTITY_TYPE_MUC) |
856 @param silent(bool): if True, doesn't send signal to frontend, even if there is a signal flag (see setSignalOnUpdate) | 856 @param silent(bool): if True, doesn't send signal to frontend, even if there is a |
857 signal flag (see setSignalOnUpdate) | |
857 @param profile_key: %(doc_profile_key)s | 858 @param profile_key: %(doc_profile_key)s |
858 """ | 859 """ |
859 client = self.host.getClient(profile_key) | 860 client = self.host.getClient(profile_key) |
860 profile_cache = self._getProfileCache(client) | 861 profile_cache = self._getProfileCache(client) |
861 if entity_jid in (C.ENTITY_ALL_RESOURCES, C.ENTITY_ALL): | 862 if entity_jid in (C.ENTITY_ALL_RESOURCES, C.ENTITY_ALL): |
884 def delEntityDatum(self, entity_jid, key, profile_key): | 885 def delEntityDatum(self, entity_jid, key, profile_key): |
885 """Delete a data for an entity | 886 """Delete a data for an entity |
886 | 887 |
887 @param entity_jid: JID of the entity, C.ENTITY_ALL_RESOURCES for all resources of all entities, | 888 @param entity_jid: JID of the entity, C.ENTITY_ALL_RESOURCES for all resources of all entities, |
888 C.ENTITY_ALL for all entities (all resources + bare jids) | 889 C.ENTITY_ALL for all entities (all resources + bare jids) |
889 @param key: key to delete (eg: "type") | 890 @param key: key to delete (eg: C.ENTITY_TYPE) |
890 @param profile_key: %(doc_profile_key)s | 891 @param profile_key: %(doc_profile_key)s |
891 | 892 |
892 @raise exceptions.UnknownEntityError: if entity is not in cache | 893 @raise exceptions.UnknownEntityError: if entity is not in cache |
893 @raise KeyError: key is not in cache | 894 @raise KeyError: key is not in cache |
894 """ | 895 """ |