function api_search($type)
{
$data = [];
+ $sql_extra = '';
if (!x($_REQUEST, 'q')) {
throw new BadRequestException("q parameter is required.");
$conversation_id = (x($_REQUEST, 'conversation_id') ? $_REQUEST['conversation_id'] : 0);
$start = $page * $count;
+ $sql_extra = '';
if ($exclude_replies && !$conversation_id) {
if ($max_id > 0) {
WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND NOT `item`.`private` AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
- $sql_extra
AND `item`.`id`=%d",
intval($id)
);
$myurl = substr($myurl, strpos($myurl, '://') + 3);
$myurl = str_replace('www.', '', $myurl);
+ $sql_extra = '';
+
if ($max_id > 0) {
- $sql_extra = ' AND `item`.`id` <= ' . intval($max_id);
+ $sql_extra .= ' AND `item`.`id` <= ' . intval($max_id);
}
$r = q(
throw new BadRequestException("Invalid action ".$action);
}
- Item::update(['starred' => $item[0]['starred']], ['id' => $itemid]);
+ $r = Item::update(['starred' => $item[0]['starred']], ['id' => $itemid]);
if ($r === false) {
throw new InternalServerErrorException("DB error");
];
} else {
$res = [
- 'name' => $text,
+ 'name' => $txt,
'url' => ""
];
}
throw new ForbiddenException();
}
+ $a = get_app();
+
api_get_user($a);
$stringify_ids = defaults($_REQUEST, 'stringify_ids', false);
switch ($type) {
case "atom":
case "rss":
- $data = api_rss_extra($a, $data, $user_info);
+ $data = api_rss_extra($a, $data, $sender);
}
return api_format_data("direct-messages", $type, $data);
// pagination
$start = $page * $count;
+ $sql_extra = "";
+
// filters
if ($box=="sentbox") {
$sql_extra = "`mail`.`from-url`='" . dbesc($profile_url) . "'";
goaway(
$contact['poll'] . '?dfrn_id=' . $dfrn_id
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
- . '&type=profile&sec=' . $sec . $dest . $quiet
+ . '&type=profile&sec=' . $sec . $dest
);
}
api_register_func('api/friendica/remoteauth', 'api_friendica_remoteauth', true);
{
$best_contact = [];
- if (count($contact) == 0) {
+ if (count($contacts) == 0) {
return;
}
* @brief search for direct_messages containing a searchstring through api
*
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
+ * @param string $box
* @return string (success: success=true if found and search_result contains found messages,
* success=false if nothing was found, search_result='nothing found',
* error: result=error with error message)
*/
-function api_friendica_direct_messages_search($type)
+function api_friendica_direct_messages_search($type, $box = "")
{
$a = get_app();