mirror of
https://github.com/gryf/weechat-highlightxmpp.git
synced 2025-12-18 20:10:23 +01:00
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:
3
README
3
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.
|
a detatched terminal where you're not always looking at your IRC window.
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
* 0.4:
|
||||||
|
- Actually fixed random XML appearing in messages.
|
||||||
|
|
||||||
* 0.3:
|
* 0.3:
|
||||||
- Fixed message type to 'chat'; should fix problems with offline send
|
- Fixed message type to 'chat'; should fix problems with offline send
|
||||||
and XML embedded in the message on some receivers
|
and XML embedded in the message on some receivers
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ def connect_xmpp():
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def send_xmpp(data, signal, msg, trial=1):
|
def send_xmpp(data, signal, msgtxt, trial=1):
|
||||||
global client
|
global client
|
||||||
|
|
||||||
# ignore XMPP's deprecation warnings
|
# ignore XMPP's deprecation warnings
|
||||||
@@ -95,7 +95,7 @@ def send_xmpp(data, signal, msg, trial=1):
|
|||||||
jid_to = w.config_get_plugin('jid')
|
jid_to = w.config_get_plugin('jid')
|
||||||
|
|
||||||
# send the message
|
# send the message
|
||||||
msg = xmpp.protocol.Message(jid_to, msg, typ='chat')
|
msg = xmpp.protocol.Message(jid_to, msgtxt, typ='chat')
|
||||||
try:
|
try:
|
||||||
client.send(msg)
|
client.send(msg)
|
||||||
except IOError:
|
except IOError:
|
||||||
@@ -106,7 +106,7 @@ def send_xmpp(data, signal, msg, trial=1):
|
|||||||
w.prnt('', "XMPP: Could not send to server.")
|
w.prnt('', "XMPP: Could not send to server.")
|
||||||
else:
|
else:
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
send_xmpp(data, signal, msg, trial + 1)
|
send_xmpp(data, signal, msgtxt, trial + 1)
|
||||||
return w.WEECHAT_RC_OK
|
return w.WEECHAT_RC_OK
|
||||||
|
|
||||||
# register with weechat
|
# register with weechat
|
||||||
|
|||||||
Reference in New Issue
Block a user