From f6d219bac42ebcd3a941bc421a131388ea4519ad Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 22 Jun 2008 22:38:59 -0400 Subject: add flags to db for jabber and sms notification darcs-hash:20080623023859-84dde-1c72985ee0a840e59d1fac88f27f929f3c637b65.gz --- xmppdaemon.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'xmppdaemon.php') diff --git a/xmppdaemon.php b/xmppdaemon.php index 43c49e604..71f1d853b 100644 --- a/xmppdaemon.php +++ b/xmppdaemon.php @@ -88,6 +88,22 @@ class XMPPDaemon { return false; } } + + function set_notify(&$user, $notify) { + $orig = clone($user); + $user->jabbernotify = $notify; + $result = $user->update($orig); + if (!$id) { + $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); + $this->log(LOG_ERROR, + 'Could not set notify flag to ' . $notify . + ' for user ' . common_log_objstring($user) . + ': ' . $last_error->message); + } else { + $this->log(LOG_INFO, + 'User ' . $user->nickname . ' set notify flag to ' . $notify); + } + } function add_notice(&$user, &$pl) { $notice = new Notice(); @@ -116,6 +132,8 @@ class XMPPDaemon { return; } common_broadcast_notice($notice); + $this->log(LOG_INFO, + 'Added notice ' . $notice->id . ' from user ' . $user->nickname); } function handle_presence(&$pl) { -- cgit v1.2.3-54-g00ecf