X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;ds=inline;f=Context.pm;h=124da62e5ca301a33da1a18534b24ac6737c51c6;hb=5f3e2c69d303e9196a76dd10607b595cac6658a8;hp=9d37655729453ed454caeede43a69fff538621ce;hpb=bbda5c4f4358094b8599e814484d837dc3ee7d86;p=NDIRC.git diff --git a/Context.pm b/Context.pm index 9d37655..124da62 100644 --- a/Context.pm +++ b/Context.pm @@ -109,6 +109,27 @@ sub message { $self->server->command("$command $msg"); } +sub intel_log { + my ($c,$planet, $message) = @_; + my $log = $c->model->prepare_cached(q{ +INSERT INTO forum_posts (ftid,uid,message) VALUES( + (SELECT ftid FROM planets WHERE id = $3) + ,(SELECT uid FROM users WHERE hostmask ILIKE $1) + ,$2) + }); + $log->execute($c->host,$message,$planet); +} + +sub def_log { + my ($c,$call, $message) = @_; + my $log = $c->model->prepare(q{ +INSERT INTO forum_posts (ftid,uid,message) VALUES( + (SELECT ftid FROM calls WHERE id = $3) + ,(SELECT uid FROM users WHERE hostmask ILIKE $1),$2) + }); + $log->execute($c->host,$message,$call); +} + sub _build_roles { my ($self) = @_;