summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason2016-03-17 15:07:15 +0000
committerÆvar Arnfjörð Bjarmason2016-03-17 15:07:15 +0000
commit54050415bd94b52c402fc6110a865e2ce3b1cf1f (patch)
treea2451960d6f65c31d0364b10ff3fd1b18c21769c /scripts
parenta9ad45f95b468e2c4c811c4a86e6490d86eb32f0 (diff)
downloadscripts.irssi.org-54050415bd94b52c402fc6110a865e2ce3b1cf1f.tar.bz2
munge_own_nickname_to_username.pl: Also handle the /me form
I didn't think of the nick munger also needing to handle the /me format when I first wrote this, it's a trivial fix so fix that.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/munge_own_nickname_to_username.pl18
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);