comparison src/plugins/plugin_xep_0085.py @ 1380:8aa32bcc3a9c

plugin XEP-0085, quick_frontend: fixes chat states
author souliane <souliane@mailoo.org>
date Fri, 20 Mar 2015 17:47:48 +0100
parents f29beedb33b0
children 069ad98b360d
comparison
equal deleted inserted replaced
1379:da2ea16fabc6 1380:8aa32bcc3a9c
138 self.host.memory.delEntityDatum(entity_jid, ENTITY_KEY, profile) 138 self.host.memory.delEntityDatum(entity_jid, ENTITY_KEY, profile)
139 else: 139 else:
140 self.host.memory.updateEntityData(entity_jid, ENTITY_KEY, value, profile_key=profile) 140 self.host.memory.updateEntityData(entity_jid, ENTITY_KEY, value, profile_key=profile)
141 if not value or value == DELETE_VALUE: 141 if not value or value == DELETE_VALUE:
142 # reinit chat state UI for this or these contact(s) 142 # reinit chat state UI for this or these contact(s)
143 self.host.bridge.chatStateReceived(entity_jid.full(), "", profile) 143 self.host.bridge.chatStateReceived(unicode(entity_jid), "", profile)
144 144
145 def paramUpdateTrigger(self, name, value, category, type_, profile): 145 def paramUpdateTrigger(self, name, value, category, type_, profile):
146 """Reset all the existing chat state entity data associated with this profile after a parameter modification. 146 """Reset all the existing chat state entity data associated with this profile after a parameter modification.
147 147
148 @param name: parameter name 148 @param name: parameter name
149 @param value: "true" to activate the notifications, or any other value to delete it 149 @param value: "true" to activate the notifications, or any other value to delete it
150 @param category: parameter category 150 @param category: parameter category
151 @param type_: parameter type 151 @param type_: parameter type
152 """ 152 """
153 if (category, name) == (PARAM_KEY, PARAM_NAME): 153 if (category, name) == (PARAM_KEY, PARAM_NAME):
154 self.updateCache(C.ENTITY_ALL, True if bool("true") else DELETE_VALUE, profile=profile) 154 self.updateCache(C.ENTITY_ALL, True if C.bool(value) else DELETE_VALUE, profile=profile)
155 return False 155 return False
156 return True 156 return True
157 157
158 def messageReceivedTrigger(self, message, post_treat, profile): 158 def messageReceivedTrigger(self, message, post_treat, profile):
159 """ 159 """