From 3ebb4a3dc7a369e7a716ab93d02b44b20522080f Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 9 Sep 2012 21:17:06 -0700 Subject: updates --- mod/item.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'mod/item.php') diff --git a/mod/item.php b/mod/item.php index c7de5f304..12765cba3 100644 --- a/mod/item.php +++ b/mod/item.php @@ -280,6 +280,7 @@ function item_post(&$a) { $author = null; $self = false; + $contact_id = 0; if((local_user()) && (local_user() == $profile_uid)) { $self = true; @@ -288,9 +289,19 @@ function item_post(&$a) { ); } elseif(remote_user()) { - $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", - intval(remote_user()) - ); + if(is_array($_SESSION['remote'])) { + foreach($_SESSION['remote'] as $v) { + if($v['uid'] == $profile_uid) { + $contact_id = $v['cid']; + break; + } + } + } + if($contact_id) { + $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", + intval($contact_id) + ); + } } if(count($r)) { -- cgit v1.2.3