]> ruin.nu Git - NDIRC.git/blobdiff - Context.pm
Update to new database structure
[NDIRC.git] / Context.pm
index 9d37655729453ed454caeede43a69fff538621ce..abe59b24cf538b477f794153241a11649a1865b7 100644 (file)
@@ -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) = @_;