]> git.mxchange.org Git - friendica.git/commitdiff
pass community page permissions through notification feeds
authorMike Macgirvin <mike@macgirvin.com>
Mon, 18 Oct 2010 10:02:51 +0000 (03:02 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Mon, 18 Oct 2010 10:02:51 +0000 (03:02 -0700)
include/items.php
include/notifier.php

index 7647eed5cb122852e108c52cfcd1c373dc339090..e9277f114e014476387965fba4d22ce4530ebb34 100644 (file)
@@ -515,10 +515,10 @@ function get_item_contact($item,$contacts) {
 }
 
 
-function dfrn_deliver($contact,$atom,$debugging = false) {
+function dfrn_deliver($owner,$contact,$atom,$debugging = false) {
 
 
-       if((! strlen($contact['dfrn-id'])) && (! $contact['duplex']))
+       if((! strlen($contact['dfrn-id'])) && (! $contact['duplex']) && (! ($owner['page-flags'] == PAGE_COMMUNITY)))
                return 3;
 
        $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']);
@@ -577,6 +577,9 @@ function dfrn_deliver($contact,$atom,$debugging = false) {
        if(($contact['rel']) && ($contact['rel'] != REL_FAN) && (! $contact['blocked']) && (! $contact['readonly'])) {
                $postvars['data'] = $atom;
        }
+       elseif($owner['page-flags'] == PAGE_COMMUNITY) {
+               $postvars['data'] = $atom;
+       }
        else {
                $postvars['data'] = str_replace('<dfrn:comment-allow>1','<dfrn:comment-allow>0',$atom);
        }
index bef46677c44a6566130147075123e6b30671670a..db95c3aae49a8c30f224dc656d0fdec38b8cac48 100644 (file)
@@ -72,7 +72,7 @@
                        killme();
        }
 
-       $r = q("SELECT `contact`.*, `user`.`nickname` 
+       $r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`page-flags` 
                FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` 
                WHERE `contact`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
                intval($uid)
                        $recipients = array_diff($recipients,$deny);
 
                        $conversant_str = dbesc(implode(', ',$conversants));
-
-
                }
 
                $r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0");
 
                switch($contact['network']) {
                        case 'dfrn':
-                               $deliver_status = dfrn_deliver($contact,$atom,$debugging);
+                               $deliver_status = dfrn_deliver($owner,$contact,$atom,$debugging);
                                break;
                        default:
                                break;