]> ruin.nu Git - NDIRC.git/blobdiff - Commands/Quotes.pm
Introduce a uid member for the context and use it intead of the host in commands
[NDIRC.git] / Commands / Quotes.pm
index 3353eb6a112df54326dd6690d6aae155823d1fa6..608832f9d38094c40173c8d92c0800105acf7d10 100644 (file)
@@ -68,6 +68,7 @@ sub findquote
 {
        my ($self,$c,$pattern) = @_;
        die 'ARGS' unless $pattern;
+
        my $matcher;
        if ($self->name eq 'findqre'){
                if (defined (eval 'm/$pattern/ix')){
@@ -91,7 +92,7 @@ sub findquote
                $n++;
        }
        if ($match){
-               close $file;
+               $file->flush;
                $c->command(dcc => $c->nick => SEND => $file);
        }else{
                $c->reply("No quotes matching <b>$pattern.</b>");
@@ -107,8 +108,8 @@ sub delquote
        $n = $n-1;
        if (exists $FILE[$n]){
                my ($uid,$username) = $c->model->selectrow_array(q{
-SELECT uid,username FROM users where hostmask ILIKE ?
-                       },undef,$c->host);
+SELECT uid,username FROM users where uid = ?
+                       },undef,$c->uid);
 
                my $text = $FILE[$n];
                push @OLDFILE,"Removed by $username ($uid): $text";