X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Context.pm;h=abe59b24cf538b477f794153241a11649a1865b7;hb=ae37bc6b64270f8c65298a36fce1f4bad761231f;hp=9d37655729453ed454caeede43a69fff538621ce;hpb=bbda5c4f4358094b8599e814484d837dc3ee7d86;p=NDIRC.git diff --git a/Context.pm b/Context.pm index 9d37655..abe59b2 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 pid = $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 call = $3) + ,(SELECT uid FROM users WHERE hostmask ILIKE $1),$2) + }); + $log->execute($c->host,$message,$call); +} + sub _build_roles { my ($self) = @_;