Handle private messages properly
This commit is contained in:
parent
588f9083b3
commit
a5de75167b
|
@ -5,11 +5,15 @@ weechat.register("weechat-notify", "Yash Karandikar", "22.05.11", "Unlicense", "
|
|||
|
||||
def notify(data, signal, signal_data):
|
||||
arr = signal_data.split("\t")
|
||||
if len(arr) == 1:
|
||||
a = arr[0].split("PRIVMSG")
|
||||
b = a[0].split("!")[0].removeprefix(":")
|
||||
c = a[1].split(":")[1]
|
||||
arr = [b, c]
|
||||
|
||||
|
||||
nick = arr[0]
|
||||
try:
|
||||
text = arr[1]
|
||||
except IndexError:
|
||||
text = "new private message"
|
||||
text = arr[1]
|
||||
wn_backend.send_notification("/usr/share/icons/Papirus-Dark/128x128/apps/weechat.svg", nick, text)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
|
|
Loading…
Reference in a new issue