add commands to turn sms notification on and off
darcs-hash:20080804190749-84dde-0b6d007e3da6d468e7dbe1c859f2c5c753726e8a.gz
This commit is contained in:
parent
f0f6d0e603
commit
6d5a61de9f
|
@ -98,8 +98,29 @@ class MailerDaemon {
|
|||
}
|
||||
|
||||
function handle_command($user, $msg) {
|
||||
$cmd = trim(strtolower($msg));
|
||||
switch ($cmd) {
|
||||
case 'off':
|
||||
$this->set_notify($user, false);
|
||||
return true;
|
||||
case 'on':
|
||||
$this->set_notify($user, true);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function set_notify($user, $value) {
|
||||
$orig = clone($user);
|
||||
$user->smsnotify = $value;
|
||||
$result = $user->update($orig);
|
||||
if (!$result) {
|
||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function respond($from, $to, $response) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user