]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Don't optimize the tables when the maximum size is lower than zero
[friendica.git] / include / api.php
index 55e39e3583e3db9d2e005126046603f74bdda16c..a494e3cdd9ea23f704f91d7ae8a457e36371cbdf 100644 (file)
                return api_apply_template("timeline", $type, $data);
        }
        api_register_func('api/conversation/show','api_conversation_show', true);
+       api_register_func('api/statusnet/conversation','api_conversation_show', true);
 
 
        /**
                        `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`
-                       FROM `item`, `contact`
+                       FROM `item`  FORCE INDEX (`uid_id`), `contact`
                        WHERE `item`.`uid` = %d AND `verb` = '%s'
                        AND NOT (`item`.`author-link` IN ('https://%s', 'http://%s'))
-                       AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
+                       AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
                        AND `contact`.`id` = `item`.`contact-id`
-                       AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
-                       AND `item`.`parent` IN (SELECT `iid` from thread where uid = %d AND `mention` AND !`ignored`)
+                       AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
+                       AND `item`.`parent` IN (SELECT `iid` FROM `thread` WHERE `uid` = %d AND `mention` AND !`ignored`)
                        $sql_extra
                        AND `item`.`id`>%d
                        ORDER BY `item`.`id` DESC LIMIT %d ,%d ",