]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
allow contact if in allowed group, even if not in non-empty allowed contacts
[friendica.git] / mod / display.php
index 65e1781ee1acf8359c246f5e5ae334491db2663a..64df4cc6a9d7fc36a952a107f2845ccfaa21bf7c 100644 (file)
@@ -35,8 +35,18 @@ function display_content(&$a) {
        $contact = null;
        $remote_contact = false;
 
-       if(remote_user()) {
-               $contact_id = $_SESSION['visitor_id'];
+       $contact_id = 0;
+
+       if(is_array($_SESSION['remote'])) {
+               foreach($_SESSION['remote'] as $v) {
+                       if($v['uid'] == $a->profile['uid']) {
+                               $contact_id = $v['cid'];
+                               break;
+                       }
+               }
+       }
+
+       if($contact_id) {
                $groups = init_groups_visitor($contact_id);
                $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($contact_id),
@@ -115,7 +125,7 @@ function display_content(&$a) {
 
                $items = conv_sort($r,"`commented`");
                
-               $o .= conversation($a,$items,'display', false, false, true);
+               $o .= conversation($a,$items,'display', false);
 
        }
        else {