-sub takeCall {
- my ($msg,$command) = @_;
- my ($id);
- if (defined $msg && $msg =~ /^(\d+)$/){
- $id = $1;
- }else{
- $ND::server->command("notice $ND::nick Usage: $command callid");
- return;
- }
- if (my $user = dc()){
- if ($ND::DBH->do(q{UPDATE calls SET dc = (SELECT uid FROM users WHERE hostmask ILIKE ?) WHERE id = ?}
- ,undef,$ND::address,$id) == 1){
- $ND::server->command("msg $ND::target Updated the DC for call $id");
- def_log $user->{uid}, $id , "Used: [B] $command [/B]";
- }
- }
-}
-
-sub covCall {
- my ($msg,$command) = @_;
- my ($id);
- if (defined $msg && $msg =~ /^(\d+)$/){
- $id = $1;
- }else{
- $ND::server->command("notice $ND::nick Usage: $command callid");
- return;
- }
- if (my $user = dc()){
- if($ND::DBH->do(q{UPDATE calls SET dc = (SELECT uid FROM users WHERE hostmask ILIKE ?), covered = TRUE, open = FALSE WHERE id = ?}
- ,undef,$ND::address,$id) == 1){
- $ND::server->command("msg $ND::target Marked call $id as covered");
- def_log $user->{uid}, $id , "Used: [B] $command [/B]";
- }
- }
-}
-
-sub ignoreCall {
- my ($msg,$command) = @_;
- my ($id);
- if (defined $msg && $msg =~ /^(\d+)$/){
- $id = $1;
- }else{
- $ND::server->command("notice $ND::nick Usage: $command callid");
- return;
- }
- if (my $user = dc()){
- if($ND::DBH->do(q{UPDATE calls SET dc = (SELECT uid FROM users WHERE hostmask ILIKE ?), covered = FALSE, open = FALSE WHERE id = ?}
- ,undef,$ND::address,$id) == 1){
- $ND::server->command("msg $ND::target Marked call $id as ignored");
- def_log $user->{uid}, $id , "Used: [B] $command [/B]";
- }
- }
-}
-