# HG changeset patch # User souliane # Date 1378576212 -7200 # Node ID 262d9d9ad27a7db42faacc09f069bb117ac1092f # Parent e07a03d52321b1b1d34020490e873a11e504e599 plugin XEP-0085: renamed category and parameter diff -r e07a03d52321 -r 262d9d9ad27a frontends/src/quick_frontend/quick_app.py --- a/frontends/src/quick_frontend/quick_app.py Sun Sep 08 15:00:15 2013 +0200 +++ b/frontends/src/quick_frontend/quick_app.py Sat Sep 07 19:50:12 2013 +0200 @@ -229,7 +229,7 @@ self.setStatusOnline(False) def connectionError(self, error_type, profile): - """called when something goest wrong with the connection""" + """called when something goes wrong with the connection""" if not self.check_profile(profile): return debug(_("Connection Error")) diff -r e07a03d52321 -r 262d9d9ad27a src/memory/memory.py --- a/src/memory/memory.py Sun Sep 08 15:00:15 2013 +0200 +++ b/src/memory/memory.py Sat Sep 07 19:50:12 2013 +0200 @@ -490,7 +490,7 @@ def returnXML(prof_xml): return_xml = prof_xml.toxml() prof_xml.unlink() - return '\n'.join([line for line in return_xml.split('\n')]) + return '\n'.join((line for line in return_xml.split('\n') if line)) return self.__constructProfileXml(security_limit, profile).addCallback(returnXML) diff -r e07a03d52321 -r 262d9d9ad27a src/plugins/plugin_xep_0085.py --- a/src/plugins/plugin_xep_0085.py Sun Sep 08 15:00:15 2013 +0200 +++ b/src/plugins/plugin_xep_0085.py Sat Sep 07 19:50:12 2013 +0200 @@ -33,8 +33,9 @@ NS_CHAT_STATES = "http://jabber.org/protocol/chatstates" CHAT_STATES = ["active", "inactive", "gone", "composing", "paused"] MESSAGE_TYPES = ["chat", "groupchat"] -PARAM_KEY = "Chat State Notifications" -PARAM_NAME = "Enabled" +PARAM_KEY = "Notifications" +PARAM_NAME = "Enable chat state notifications" +ENTITY_KEY = PARAM_KEY + "_" + PARAM_NAME PLUGIN_INFO = { "name": "Chat State Notifications Protocol Plugin", @@ -116,7 +117,7 @@ if the notification has been disabled. Parameter "entity_jid" could be @ALL@ to update all entities. """ - self.host.memory.updateEntityData(entity_jid, PARAM_KEY, value, profile) + self.host.memory.updateEntityData(entity_jid, ENTITY_KEY, value, profile) if not value or value == "@NONE@": # disable chat state for this or these contact(s) self.host.bridge.chatStateReceived(unicode(entity_jid), "", profile) @@ -177,7 +178,7 @@ to_jid = JID(message.getAttribute("to")) try: contact_enabled = self.host.memory.getEntityData( - to_jid, [PARAM_KEY], profile)[PARAM_KEY] + to_jid, [ENTITY_KEY], profile)[ENTITY_KEY] except (exceptions.UnknownEntityError, KeyError): # enable it for the first time self.updateEntityData(to_jid, True, profile) @@ -236,6 +237,7 @@ try: self.map[profile][to_jid]._onEvent("composing") except: + # it just means that no first message has been sent already return