diff options
| author | 2015-03-01 05:16:22 +0400 | |
|---|---|---|
| committer | 2015-03-01 05:16:22 +0400 | |
| commit | 13b54f4446754a248efdbe4905efda7e582c644b (patch) | |
| tree | c3760c5f127b60e8ed452b0d40609a329679be6d | |
| parent | e3dea4bdbcd3526e1cc084f102e663252daf6807 (diff) | |
Hide +s channels from public ;mship queries
| -rw-r--r-- | config-default/commands.xml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/config-default/commands.xml b/config-default/commands.xml index 2551867..848d48b 100644 --- a/config-default/commands.xml +++ b/config-default/commands.xml @@ -102,12 +102,17 @@ ", has sent $tx of data, and received $rx of data."); ]]> </command> - <command cmd="^;mship (\S+)$" flag="s"> - <![CDATA[ - if (defined($::sn{lc $1}->{mship})) { - $conn->privmsg($event->replyto, $1 . " is on: " . ASM::Util->commaAndify(sort @{$::sn{lc $1}->{mship}})); + <command cmd="^;mship (\S+)" flag="s"> + <![CDATA[ + my $nick = $1; + if (defined($::sn{lc $nick}->{mship})) { + if ($event->{to}->[0] =~ /^#/) { + $conn->privmsg($event->replyto, $nick . " is on: " . ASM::Util->commaAndify(sort(grep { not grep { /^s$/ } @{$::sc{$_}{modes}} } @{$::sn{lc $nick}->{mship}}))); + } else { + $conn->privmsg($event->replyto, $nick . " is on: " . ASM::Util->commaAndify(sort @{$::sn{lc $nick}->{mship}})); + } } else { - $conn->privmsg($event->replyto, "I don't see $1."); + $conn->privmsg($event->replyto, "I don't see $nick."); } ]]> </command> |
