mirror of
https://github.com/gryf/weechat-highlightxmpp.git
synced 2025-12-18 03:50:22 +01:00
add XMPP to the beginning of log messages
This commit is contained in:
@@ -62,7 +62,7 @@ def connect_xmpp():
|
|||||||
client.connect()
|
client.connect()
|
||||||
client.auth(jid.getNode(), password)
|
client.auth(jid.getNode(), password)
|
||||||
except:
|
except:
|
||||||
w.prnt('', "Could not connect or authenticate to XMPP server.")
|
w.prnt('', "XMPP: Could not connect or authenticate to server.")
|
||||||
client = None
|
client = None
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@@ -85,9 +85,9 @@ def send_xmpp(data, signal, msg, trial=1):
|
|||||||
# fail. catch that here and try to reconnect. isConnected() should
|
# fail. catch that here and try to reconnect. isConnected() should
|
||||||
# start to realize that once this exception is triggered.
|
# start to realize that once this exception is triggered.
|
||||||
if trial > 3:
|
if trial > 3:
|
||||||
w.prnt('', "Could not send to XMPP server.")
|
w.prnt('', "XMPP: Could not send to server.")
|
||||||
else:
|
else:
|
||||||
w.prnt('', "Sending failed. Trying again...")
|
w.prnt('', "XMPP: Sending failed. Trying again...")
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
send_xmpp(data, signal, msg, trial + 1)
|
send_xmpp(data, signal, msg, trial + 1)
|
||||||
return w.WEECHAT_RC_OK
|
return w.WEECHAT_RC_OK
|
||||||
|
|||||||
Reference in New Issue
Block a user