From 20a7ff992d81bd67b5030e70a929679c8c26b07f Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 23 Jul 2019 12:19:34 -0700 Subject: [PATCH] MessageHistory: now tracks channel mode changes on users --- PBot/IRCHandlers.pm | 3 +++ PBot/MessageHistory.pm | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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";