File: mode.mpi

package info (click to toggle)
madoka 4.2.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 960 kB
  • ctags: 45
  • sloc: perl: 1,006; makefile: 45; sh: 4
file content (35 lines) | stat: -rw-r--r-- 933 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# madoka 4.2 sv_mode
#
# server/mode.mpi
#    Copyright(c)1998- cookie / The madoka project
#

sub sv_mode {
  my($from, $pr) = @_;
  my($chan, $mode) = split(/ /, $pr, 2);
  my($chanr, $chanv) = &alias_chan($chan);
  if ($chanr eq $us_nick) {
    &mes("Mode by $from: $chanr $mode\n", 'P');
  } else {
    &mes("Mode by $from: $chanv $mode\n", $chanr);
  }
  $cl_chan = $cl_chan{$chanr};
  if ($where) {
    &send('cch', ":$from!$where MODE $chanr $mode\n");
  } else {
    &send('cch', ":$from MODE $chanr $mode\n");
  }
  &plugin('MODE', $chanr, $from, $mode);
  undef($send_mode);
  my($flag, $mode_cmd, @mode);
  ($list, @mode) = split(/ /, $mode);
  foreach $com (split(//, $list)) {
    if ($com eq '+' || $com eq '-') {
      $flag = $com;
    } else {
      $mode_cmd = "mode_$com";
      @mode = &$mode_cmd($chanr, $flag, @mode) if defined(&$mode_cmd);
    }
  }
  &send('sv', "MODE $chanr $send_mode \n") if $send_mode;
}