diff --git a/Irpg/Main.pm b/Irpg/Main.pm index 7992e6f18abe38990b454ec68d5e2dc6df0d0ff8..d9519daf57ca80ca80aa1f3e191eb4914be488d4 100644 --- a/Irpg/Main.pm +++ b/Irpg/Main.pm @@ -537,6 +537,18 @@ sub parse { if ($opts->{voiceonlogin}) { Irpg::Irc::sts("MODE $opts->{botchan} +v :$arg[3]"); } + # We call /USERHOST now to update userhost in rps + # we can do it because we know that the user is registered from this section + Irpg::Irc::sts("USERHOST $arg[3]"); + } + elsif ($arg[1] eq '302') { + # 302 is RPL_USERHOST + # update of userhost because /USERHOST is called only for + # registered users + $arg[3] =~ m/:(\w+)\*?=[+-](.*)/; + foreach (grep { $rps->{$_}{nick} eq $1 } keys %$rps) { + $rps->{$_}{userhost} = "$1!$2"; + } } elsif ($arg[1] eq 'privmsg') { $arg[0] = substr($arg[0],1); # strip leading : from privmsgs