]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Merge pull request #1618 from rabuzarus/vcard
[friendica.git] / include / api.php
index dd24a92c9b105bf22e2bbc25532fc7f258e24d78..a9e0edc80836f00d0fcbf4ed762ea6f794996ce2 100644 (file)
                if ($conversation_id > 0)
                        $sql_extra .= ' AND `item`.`parent` = '.intval($conversation_id);
 
-               $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
+               $r = q("SELECT STRAIGHT_JOIN `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
                        `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
                        `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
                        `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
 
                logger('API: api_conversation_show: '.$id);
 
+               $r = q("SELECT `parent` FROM `item` WHERE `id` = %d", intval($id));
+               if ($r)
+                       $id = $r[0]["parent"];
+
                $sql_extra = '';
 
                if ($max_id > 0)