comparison src/plugins/plugin_xep_0085.py @ 1264:60dfa2f5d61f frontends_multi_profiles

plugin XEP-0085: disabled a problematic assert (see FIXME)
author Goffi <goffi@goffi.org>
date Wed, 10 Dec 2014 18:37:14 +0100
parents c13a46207410
children faa1129559b8
comparison
equal deleted inserted replaced
1263:cfd636203e8f 1264:60dfa2f5d61f
161 161
162 from_jid = JID(message.getAttribute("from")) 162 from_jid = JID(message.getAttribute("from"))
163 if self.__isMUC(from_jid, profile): 163 if self.__isMUC(from_jid, profile):
164 from_jid = from_jid.userhostJID() 164 from_jid = from_jid.userhostJID()
165 else: # update entity data for one2one chat 165 else: # update entity data for one2one chat
166 assert(from_jid.resource) 166 # assert from_jid.resource # FIXME: assert doesn't work on normal message from server (e.g. server announce), because there is no resource
167 try: 167 try:
168 domish.generateElementsNamed(message.elements(), name="body").next() 168 domish.generateElementsNamed(message.elements(), name="body").next()
169 try: 169 try:
170 domish.generateElementsNamed(message.elements(), name="active").next() 170 domish.generateElementsNamed(message.elements(), name="active").next()
171 # contact enabled Chat State Notifications 171 # contact enabled Chat State Notifications
247 if not self.host.memory.getParamA(PARAM_NAME, PARAM_KEY, profile_key=profile): 247 if not self.host.memory.getParamA(PARAM_NAME, PARAM_KEY, profile_key=profile):
248 return False 248 return False
249 # check if notifications should be sent to this contact 249 # check if notifications should be sent to this contact
250 if self.__isMUC(to_jid, profile): 250 if self.__isMUC(to_jid, profile):
251 return True 251 return True
252 assert(to_jid.resource or not self.host.memory.isContactConnected(to_jid, profile)) 252 assert to_jid.resource or not self.host.memory.isContactConnected(to_jid, profile)
253 try: 253 try:
254 return self.host.memory.getEntityDatum(to_jid, ENTITY_KEY, profile) 254 return self.host.memory.getEntityDatum(to_jid, ENTITY_KEY, profile)
255 except (exceptions.UnknownEntityError, KeyError): 255 except (exceptions.UnknownEntityError, KeyError):
256 if forceEntityData: 256 if forceEntityData:
257 # enable it for the first time 257 # enable it for the first time