From 5ed160cdbad767a58d1194ebcac0520c42ae1f4a Mon Sep 17 00:00:00 2001 From: Jacob Peddicord Date: Sun, 25 Mar 2012 11:05:27 -0400 Subject: [PATCH] Actually fix XML appearing in message. This would happen on first send and after reconnecing. I was re-using msg accidentally, and the XML was being re-packed. --- README | 3 +++ highlightxmpp.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README b/README index 2a0d303..0f9986c 100644 --- a/README +++ b/README @@ -3,6 +3,9 @@ highlighted message or a private message is received. Great for running under a detatched terminal where you're not always looking at your IRC window. Changelog: + * 0.4: + - Actually fixed random XML appearing in messages. + * 0.3: - Fixed message type to 'chat'; should fix problems with offline send and XML embedded in the message on some receivers diff --git a/highlightxmpp.py b/highlightxmpp.py index 4eb7715..aaacf8e 100644 --- a/highlightxmpp.py +++ b/highlightxmpp.py @@ -78,7 +78,7 @@ def connect_xmpp(): return False return True -def send_xmpp(data, signal, msg, trial=1): +def send_xmpp(data, signal, msgtxt, trial=1): global client # ignore XMPP's deprecation warnings @@ -95,7 +95,7 @@ def send_xmpp(data, signal, msg, trial=1): jid_to = w.config_get_plugin('jid') # send the message - msg = xmpp.protocol.Message(jid_to, msg, typ='chat') + msg = xmpp.protocol.Message(jid_to, msgtxt, typ='chat') try: client.send(msg) except IOError: @@ -106,7 +106,7 @@ def send_xmpp(data, signal, msg, trial=1): w.prnt('', "XMPP: Could not send to server.") else: sleep(0.5) - send_xmpp(data, signal, msg, trial + 1) + send_xmpp(data, signal, msgtxt, trial + 1) return w.WEECHAT_RC_OK # register with weechat