]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
remote_user can now support multiple contacts being logged in at once
[friendica.git] / include / items.php
index 8de6f7cc8eb2b4faa465e3a0715512f9aaee2f11..8039066af40002d525949f355106339476965d66 100755 (executable)
@@ -3702,9 +3702,21 @@ function drop_item($id,$interactive = true) {
 
        $owner = $item['uid'];
 
+       $cid = 0;
+
        // check if logged in user is either the author or owner of this item
 
-       if((local_user() == $item['uid']) || (remote_user() == $item['contact-id']) || (! $interactive)) {
+       if(is_array($_SESSION['remote'])) {
+               foreach($_SESSION['remote'] as $visitor) {
+                       if($visitor['uid'] == $item['uid'] && $visitor['cid'] == $item['contact-id']) {
+                               $cid = $visitor['cid'];
+                               break;
+                       }
+               }
+       }
+
+
+       if((local_user() == $item['uid']) || ($cid) || (! $interactive)) {
 
                logger('delete item: ' . $item['id'], LOGGER_DEBUG);
                // delete the item