mirror of
https://github.com/gryf/weechat-highlightxmpp.git
synced 2025-12-18 03:50:22 +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.
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user