diff options
| author | ailin-nemui | 2016-03-17 16:13:42 +0100 |
|---|---|---|
| committer | ailin-nemui | 2016-03-17 16:13:42 +0100 |
| commit | 66589eccc360b8a5306aeb4d5f56d428855e38ac (patch) | |
| tree | a2451960d6f65c31d0364b10ff3fd1b18c21769c /scripts | |
| parent | a9ad45f95b468e2c4c811c4a86e6490d86eb32f0 (diff) | |
| parent | 54050415bd94b52c402fc6110a865e2ce3b1cf1f (diff) | |
| download | scripts.irssi.org-66589eccc360b8a5306aeb4d5f56d428855e38ac.tar.bz2 | |
Merge pull request #246 from avar/avar-minor-patches
munge_own_nickname_to_username.pl: Also handle the /me form
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/munge_own_nickname_to_username.pl | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/munge_own_nickname_to_username.pl b/scripts/munge_own_nickname_to_username.pl index 85e9328..69c5985 100644 --- a/scripts/munge_own_nickname_to_username.pl +++ b/scripts/munge_own_nickname_to_username.pl @@ -2,7 +2,7 @@ use strict; use warnings; use Irssi; -our $VERSION = '1.0'; +our $VERSION = '1.1'; our %IRSSI = ( authors => 'Ævar Arnfjörð Bjarmason', contact => 'avarab@gmail.com', @@ -35,10 +35,10 @@ our %IRSSI = ( # what you're username is, and automatically substitute # s/nick/username/ if applicable. # -# Note that if your theme adjusts the msgnick rendering this may not -# work, because we try to match "< yournick>" in the line. We could -# potentially do better, please contact the author if you run into -# issues with this. +# Note that if your theme adjusts the msgnick or action_core rendering +# this may not work, because we try to match "< yournick> " or " * +# yournick " in the line, respectively. We could potentially do +# better, please contact the author if you run into issues with this. sub msg_rename_myself_in_printed_text { my ($tdest, $data, $stripped) = @_; @@ -69,7 +69,13 @@ sub msg_rename_myself_in_printed_text { # The illusion here isn't complete, e.g. if you do /NAMES your # nick will show up and not your username, but I consider that a # feature. - if ($stripped =~ /^<.?\Q$server_nick\E> /s) { + if ( + # Normal PRIVMSG + $stripped =~ /^<.?\Q$server_nick\E> /s + or + # /me PRIVMSG + $stripped =~ /^ \* \Q$server_nick\E /s + ) { s/\Q$server_nick\E/$server_username/ for $data, $stripped; Irssi::signal_continue($tdest, $data, $stripped); |
