]> ruin.nu Git - NDIRC.git/blobdiff - Commands/SMS.pm
Introduce a uid member for the context and use it intead of the host in commands
[NDIRC.git] / Commands / SMS.pm
index bc0200c08403007300dfccfcc4adb6cda19a59af..eba2d650b72d79919f99a67cd83b1830a2d30e5d 100644 (file)
@@ -57,10 +57,10 @@ SELECT sms FROM users WHERE username ilike $1
        }
        my $sms = $dbh->prepare(q{
 INSERT INTO sms (uid,number,message)
-VALUES((SELECT uid FROM users WHERE hostmask ilike $1),$2,$3)
+VALUES($1,$2,$3)
 RETURNING id
                });
-       $sms->execute($c->host,$number,$message);
+       $sms->execute($c->uid,$number,$message);
        my ($id) = $sms->fetchrow_array;
        $c->reply("Message added to queue, you can see the status with: .smsstatus $id");
 }