]> git.vpit.fr Git - perl/scripts/xchat.git/blobdiff - services.pl
Make sure local_context() runs the code only when the context was found
[perl/scripts/xchat.git] / services.pl
index e9f13d687f3ecf2acfdfb256351b9133c71e070c..e57845cf13c0af877a224357bcee38a4807317f6 100755 (executable)
@@ -36,7 +36,7 @@ hook_command 'AID', sub {
  my @contexts     = get_servers_ctxt;
  my $guard        = save_context;
  for (@contexts) {
-  set_context $_;
+  set_context $_ or next;
   my $passwd = $forcepasswd || get_info 'nickserv';
   next unless $passwd;
   command 'ID ' . $passwd;
@@ -66,7 +66,7 @@ hook_command 'AGHOST', sub {
  my @contexts    = get_servers_ctxt;
  my $guard       = save_context;
  for (@contexts) {
-  set_context $_;
+  set_context $_ or next;
   my $passwd = $forcepasswd || get_info 'nickserv';
   next unless $passwd;
   if (nickcmp(get_info('nick'), $target)) {
@@ -89,7 +89,7 @@ sub csmode {
 
 hook_command "C$_", \&csmode, {
  data => $_,
- help_text => join ' ', $_, '[nicks] ,', (lc $_),
+ help_text => join ' ', $_, '[nicks] ,', lc($_),
     'the specified targets (or you if none) on the current channel via ChanServ'
 } for map { $_, "DE$_" } qw<VOICE HALFOP OP PROTECT>;