]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/channel.php
Misses this file to merge. I like the comments.
[quix0rs-gnu-social.git] / lib / channel.php
index fbc2e8697c803e7c9aa6ebd373560c869436893d..e5e8eaa0f5a2da9e9dc675dd386ac2eed010472a 100644 (file)
@@ -69,62 +69,6 @@ class CLIChannel extends Channel
     }
 }
 
-class XMPPChannel extends Channel
-{
-    var $conn = null;
-
-    function source()
-    {
-        return 'xmpp';
-    }
-
-    function __construct($conn)
-    {
-        $this->conn = $conn;
-    }
-
-    function on($user)
-    {
-        return $this->set_notify($user, 1);
-    }
-
-    function off($user)
-    {
-        return $this->set_notify($user, 0);
-    }
-
-    function output($user, $text)
-    {
-        $text = '['.common_config('site', 'name') . '] ' . $text;
-        jabber_send_message($user->jabber, $text);
-    }
-
-    function error($user, $text)
-    {
-        $text = '['.common_config('site', 'name') . '] ' . $text;
-        jabber_send_message($user->jabber, $text);
-    }
-
-    function set_notify(&$user, $notify)
-    {
-        $orig = clone($user);
-        $user->jabbernotify = $notify;
-        $result = $user->update($orig);
-        if (!$result) {
-            $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError');
-            common_log(LOG_ERR,
-                       'Could not set notify flag to ' . $notify .
-                       ' for user ' . common_log_objstring($user) .
-                       ': ' . $last_error->message);
-            return false;
-        } else {
-            common_log(LOG_INFO,
-                       'User ' . $user->nickname . ' set notify flag to ' . $notify);
-            return true;
-        }
-    }
-}
-
 class WebChannel extends Channel
 {
     var $out = null;
@@ -151,9 +95,9 @@ class WebChannel extends Channel
 
     function output($user, $text)
     {
-        # XXX: buffer all output and send it at the end
-        # XXX: even better, redirect to appropriate page
-        #      depending on what command was run
+        // XXX: buffer all output and send it at the end
+        // XXX: even better, redirect to appropriate page
+        //      depending on what command was run
         $this->out->startHTML();
         $this->out->elementStart('head');
         // TRANS: Title for command results.
@@ -216,12 +160,12 @@ class MailChannel extends Channel
 
     function on($user)
     {
-        return $this->set_notify($user, 1);
+        return $this->setNotify($user, 1);
     }
 
     function off($user)
     {
-        return $this->set_notify($user, 0);
+        return $this->setNotify($user, 0);
     }
 
     function output($user, $text)
@@ -246,7 +190,7 @@ class MailChannel extends Channel
         return mail_send(array($this->addr), $headers, $text);
     }
 
-    function set_notify($user, $value)
+    function setNotify($user, $value)
     {
         $orig = clone($user);
         $user->smsnotify = $value;