summaryrefslogtreecommitdiff
path: root/doc/it/weechat_scripting.it.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/it/weechat_scripting.it.adoc')
-rw-r--r--doc/it/weechat_scripting.it.adoc7
1 files changed, 3 insertions, 4 deletions
diff --git a/doc/it/weechat_scripting.it.adoc b/doc/it/weechat_scripting.it.adoc
index f6e5cbe21..46f357d13 100644
--- a/doc/it/weechat_scripting.it.adoc
+++ b/doc/it/weechat_scripting.it.adoc
@@ -1066,12 +1066,11 @@ xxx,irc_in2_yyy::
def join_cb(data, signal, signal_data):
# signal è per esempio: "freenode,irc_in2_join"
# signal_data è il messaggio IRC message, ad esempio: ":nick!user@host JOIN :#channel"
- nick = weechat.info_get("irc_nick_from_host", signal_data)
server = signal.split(",")[0]
- channel = signal_data.split(":")[-1]
- buffer = weechat.info_get("irc_buffer", "%s,%s" % (server, channel))
+ msg = weechat.info_get_hashtable("irc_message_parse", {"message": signal_data})
+ buffer = weechat.info_get("irc_buffer", "%s,%s" % (server, msg["channel"]))
if buffer:
- weechat.prnt(buffer, "Eheh, %s has joined this channel!" % nick)
+ weechat.prnt(buffer, "%s (%s) has joined this channel!" % (msg["nick"], msg["host"]))
return weechat.WEECHAT_RC_OK
# può essere utile qui utilizzare "*" come server, per catturare