Created
January 29, 2015 15:51
-
-
Save LambdaSix/88ff22431bdafa285c3e to your computer and use it in GitHub Desktop.
Or something
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my %saved_pronouns; | |
sub save_pronouns { | |
open PRONOUNS, ">$ENV{HOME}/.irssi/saved_pronouns"; | |
foreach my $nick (keys %saved_pronouns) { | |
print COLORS "$nick:$saved_pronouns[$nick]\n"; | |
} | |
} | |
sub load_pronouns { | |
open PRONOUNS, "$ENV{HOME}/.irssi/saved_pronouns"; | |
while <PRONOUNS> { | |
my @lines = split '\n'; | |
foreach my $line (@lines) { | |
my($nick,$pronoun) = split ":", $line; | |
$saved_pronoun[$nick] = $pronoun; | |
} | |
} | |
} | |
sub sig_public { | |
my ($server,$msg,$nick,$address,$target) = @_; | |
my $pronoun = $pronouns[$nick]; | |
if (!$pronoun) { | |
$pronoun = $session_pronouns{$nick}; | |
} | |
$server->command('/^format pubmsg [$pronoun] /* whatever format strings are, cant remember */ | |
} | |
} | |
sub cmd_pronoun { | |
/* Add commands for adding & removing */ | |
} | |
Irssi::command_bind('pronoun', 'cmd_pronoun'); | |
Irssi::signal_add('message public', 'sig_public'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment