]> git.mxchange.org Git - friendica.git/blobdiff - include/contact_widgets.php
Merge pull request #456 from pixelroot/master
[friendica.git] / include / contact_widgets.php
index ce1cdbad55e003b647a0ca75c83e2b8e11a337ef..ea71b3b707b35b5a2fe3c3d5c976eb6be15ace63 100644 (file)
@@ -142,9 +142,16 @@ function common_friends_visitor_widget($profile_uid) {
 
        $cid = $zcid = 0;
 
-       if(can_write_wall($a,$profile_uid))
-               $cid = remote_user();
-       else {
+       if(is_array($_SESSION['remote'])) {
+               foreach($_SESSION['remote'] as $visitor) {
+                       if($visitor['uid'] == $profile_uid) {
+                               $cid = $visitor['cid'];
+                               break;
+                       }
+               }
+       }
+
+       if(! $cid) {
                if(get_my_url()) {
                        $r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
                                dbesc(normalise_link(get_my_url())),