# HG changeset patch # User Goffi # Date 1446542588 -3600 # Node ID 075a63180eabdb3621d4033efed5e6979175f88c # Parent 7d91dff7106775a567e5b66998ecc17030740897 plugin XEP-0085: fixed chatstate blinking following 0632d96f08ad change diff -r 7d91dff71067 -r 075a63180eab src/plugins/plugin_xep_0085.py --- a/src/plugins/plugin_xep_0085.py Mon Nov 02 22:09:13 2015 +0100 +++ b/src/plugins/plugin_xep_0085.py Tue Nov 03 10:23:08 2015 +0100 @@ -31,6 +31,7 @@ from wokkel.subprotocols import XMPPHandler from twisted.words.xish import domish from twisted.internet import reactor +from twisted.internet import error as internet_error NS_XMPP_CLIENT = "jabber:client" NS_CHAT_STATES = "http://jabber.org/protocol/chatstates" @@ -372,6 +373,10 @@ client.xmlstream.send(mess_data['xml']) self.state = state + try: + self.timer.cancel() + except (internet_error.AlreadyCalled, AttributeError): + pass if transition["next_state"] and transition["delay"] > 0: self.timer = reactor.callLater(transition["delay"], self._onEvent, transition["next_state"])