X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Commands%2FSMS.pm;h=eba2d650b72d79919f99a67cd83b1830a2d30e5d;hb=82565659237ad7e2d279a19bac94d5d6a9335478;hp=265384ddd9dae941b2e6c1f5d266d028fb3a5838;hpb=0d4a78b3ab6832ec8c551a08aa7bcf668f645b03;p=NDIRC.git diff --git a/Commands/SMS.pm b/Commands/SMS.pm index 265384d..eba2d65 100644 --- a/Commands/SMS.pm +++ b/Commands/SMS.pm @@ -45,7 +45,7 @@ sub sendsms }else{ my ($sms) = $dbh->selectrow_array(q{ SELECT sms FROM users WHERE username ilike $1 - AND uid IN (SELECT uid FROM groupmembers WHERE gid = 2) + AND uid IN (SELECT uid FROM groupmembers WHERE gid = 'M') },undef,$number); $sms //= 'No number, or invalid user'; if ($sms =~ /^\+([1-9]\d+)$/){ @@ -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"); }