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.
This commit is contained in:
Jacob Peddicord
2012-03-25 11:05:27 -04:00
parent 8fd37e7ee7
commit 5ed160cdba
2 changed files with 6 additions and 3 deletions

3
README
View File

@@ -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

View File

@@ -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