diff --git a/ChangeLog b/ChangeLog index 14d3fd028..45516d871 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] weechat.look.save_{config|layout}_on_exit * api: add integer return code for functions hook_{signal|hsignal}_send * guile: fix module used after unload of a script +* irc: fix parsing of nick in host when '!' is not found (bug #41640) * lua: fix interpreter used after unload of a script * perl: fix context used after unload of a script * python: fix interpreter used after unload of a script diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index 1b0fc76bd..099c52eca 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -101,8 +101,12 @@ irc_message_parse (struct t_irc_server *server, const char *message, if (ptr_message[0] == ':') { /* read host/nick */ + pos3 = strchr (ptr_message, '@'); pos2 = strchr (ptr_message, '!'); pos = strchr (ptr_message, ' '); + /* if the prefix doesn't contain a '!', split the nick at '@' */ + if (!pos2 || (pos && pos2 > pos)) + pos2 = pos3; if (pos2 && (!pos || pos > pos2)) { if (nick)