diff --git a/PBot/IRCHandlers.pm b/PBot/IRCHandlers.pm index 4d6185f3..3d108485 100644 --- a/PBot/IRCHandlers.pm +++ b/PBot/IRCHandlers.pm @@ -226,6 +226,9 @@ sub on_mode { } if (defined $target and length $target) { + my $message_account = $self->{pbot}->{messagehistory}->get_message_account($nick, $user, $host); + $self->{pbot}->{messagehistory}->add_message($message_account, "$nick!$user\@$host", $channel, "MODE $mode $target", $self->{pbot}->{messagehistory}->{MSG_CHAT}); + if ($modifier eq '-') { $self->{pbot}->{nicklist}->delete_meta($channel, $target, "+$mode_char"); } else { diff --git a/PBot/MessageHistory.pm b/PBot/MessageHistory.pm index 592f0de4..be6a56a8 100644 --- a/PBot/MessageHistory.pm +++ b/PBot/MessageHistory.pm @@ -408,9 +408,9 @@ sub recall_message { if ($text =~ s/^(NICKCHANGE)\b/changed nick to/ or $text =~ s/^(KICKED|QUIT)\b/lc "$1"/e or + $text =~ s/^MODE ([^ ]+) (.*)/set mode $1 on $2/ or $text =~ s/^(JOIN|PART)\b/lc "$1ed"/e) { - # fix ugly "[nick] quit Quit: Leaving." messages - $text =~ s/^(quit) (.*)/$1 ($2)/; + $text =~ s/^(quit) (.*)/$1 ($2)/; # fix ugly "[nick] quit Quit: Leaving." $recall_text .= "[$ago] $msg->{nick} $text\n"; } elsif ($text =~ s/^\/me\s+//) { $recall_text .= "[$ago] * $msg->{nick} $text\n";