summaryrefslogtreecommitdiffstats
path: root/modules/actions.pl
blob: 7d6717d617f53548bbe1e716e01bdff35f310baf (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
use strict;
use warnings;

#package Actions;

sub Actions::ban {
  our ($conn, $event, $unmode, $chan, %dct, $id);
  o_send( $conn, "mode $chan +b *!*\@$event->{host}" );
  $unmode="mode $chan -b *!*\@$event->{host}";
}

sub Actions::kban {
  our ($conn, $event, $unmode, $chan, %dct, $id);
  o_send($conn, "mode $chan +b *!*\@$event->{host}");
  o_send($conn, "kick $chan $event->{nick} :$dct{$id}{reason}");
  $unmode = "mode $chan -b *!*\@$event->{host}";
}

sub Actions::kick {
  our ($conn, $event, $unmode, $chan, %dct, $id);
  o_send($conn, "kick $chan $event->{nick} :$dct{$id}{reason}");
}

sub Actions::none {
  return;
}

sub Actions::quiet {
  our ($conn, $event, $unmode, $chan, %dct, $id);
  o_send( $conn, "mode $chan +b %*!*\@$event->{host}" );
  $unmode = "mode $chan -b %*!*\@$event->{host}";
}

sub Actions::fmod_wiki {
  our ($conn, $event, $unmode, $chan, %dct, $id);
  o_send( $conn, "mode $chan -b *!*\@$event->{host}" );
  o_send( $conn, "mode $chan +b *!*\@$event->{host}!#wikimedia-ops" );
}

sub Actions::killsub {
  undef &Actions::ban;
  undef &Actions::kban;
  undef &Actions::kick;
  undef &Actions::none;
  undef &Actions::quiet;
}

return 1;