]> git.mxchange.org Git - friendica.git/blobdiff - mod/pubsubhubbub.php
new api for notifications
[friendica.git] / mod / pubsubhubbub.php
index ad75268a9422f674c1d0d64b93e1f80474d2a60a..b0e3ef30998ec3b891291d7b5392bba1df1aac20 100644 (file)
@@ -1,9 +1,12 @@
 <?php
 
+if(! function_exists('post_var')) {
 function post_var($name) {
        return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
 }
+}
 
+if(! function_exists('pubsubhubbub_init')) {
 function pubsubhubbub_init(&$a) {
        // PuSH subscription must be considered "public" so just block it
        // if public access isn't enabled.
@@ -70,8 +73,8 @@ function pubsubhubbub_init(&$a) {
                }
 
                // get corresponding row from contact table
-               $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0" .
-                          " AND `pending` = 0 LIMIT 1",
+               $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `blocked`".
+                          " AND NOT `pending` AND `self` LIMIT 1",
                           intval($owner['uid']));
                if(!count($r)) {
                        logger('pubsubhubbub: contact not found.');
@@ -158,5 +161,5 @@ function pubsubhubbub_init(&$a) {
 
        killme();
 }
-
+}
 ?>