direct messages in api have some issues, not properly ported from friendica originally. Here's a start.
I think at best they may return encrypted gibberish currently, but let's work through them one at a time.
This commit is contained in:
parent
63ae4b5150
commit
f66df5e137
@ -594,7 +594,8 @@ function random_profile() {
|
|||||||
if(!$r) return ''; // Couldn't get a random channel
|
if(!$r) return ''; // Couldn't get a random channel
|
||||||
|
|
||||||
if($checkrandom) {
|
if($checkrandom) {
|
||||||
if(z_fetch_url($r[0]['xchan_url'])['success'])
|
$x = z_fetch_url($r[0]['xchan_url']);
|
||||||
|
if($x['success'])
|
||||||
return $r[0]['xchan_url'];
|
return $r[0]['xchan_url'];
|
||||||
else
|
else
|
||||||
logger('Random channel turned out to be bad.');
|
logger('Random channel turned out to be bad.');
|
||||||
|
@ -1868,11 +1868,11 @@ require_once('include/items.php');
|
|||||||
|
|
||||||
require_once("include/message.php");
|
require_once("include/message.php");
|
||||||
|
|
||||||
$r = q("SELECT `id` FROM `contact` WHERE `uid`=%d AND `nick`='%s'",
|
$r = q("SELECT `abook_id` FROM `abook` WHERE `abook_channel`=%d ",
|
||||||
intval(api_user()),
|
intval(api_user())
|
||||||
dbesc($_POST['screen_name']));
|
);
|
||||||
|
|
||||||
$recipient = api_get_user($a, $r[0]['id']);
|
$recipient = api_get_user($a, $r[0]['abook_id']);
|
||||||
$replyto = '';
|
$replyto = '';
|
||||||
$sub = '';
|
$sub = '';
|
||||||
if (x($_REQUEST,'replyto')) {
|
if (x($_REQUEST,'replyto')) {
|
||||||
@ -1925,10 +1925,11 @@ require_once('include/items.php');
|
|||||||
if ($page<0) $page=0;
|
if ($page<0) $page=0;
|
||||||
|
|
||||||
$start = $page*$count;
|
$start = $page*$count;
|
||||||
|
$channel = $a->get_channel();
|
||||||
|
|
||||||
$profile_url = $a->get_baseurl() . '/channel/' . $a->user['nickname'];
|
$profile_url = $a->get_baseurl() . '/channel/' . $channel['channel_address'];
|
||||||
if ($box=="sentbox") {
|
if ($box=="sentbox") {
|
||||||
$sql_extra = "`from-url`='".dbesc( $profile_url )."'";
|
$sql_extra = "`from_xchan`='".dbesc( $channel['channel_hash'] )."'";
|
||||||
}
|
}
|
||||||
elseif ($box=="conversation") {
|
elseif ($box=="conversation") {
|
||||||
$sql_extra = "`parent_mid`='".dbesc( $_GET["uri"] ) ."'";
|
$sql_extra = "`parent_mid`='".dbesc( $_GET["uri"] ) ."'";
|
||||||
@ -1937,10 +1938,10 @@ require_once('include/items.php');
|
|||||||
$sql_extra = "true";
|
$sql_extra = "true";
|
||||||
}
|
}
|
||||||
elseif ($box=="inbox") {
|
elseif ($box=="inbox") {
|
||||||
$sql_extra = "`from-url`!='".dbesc( $profile_url )."'";
|
$sql_extra = "`from_xchan`!='".dbesc( $channel['channel_hash'] )."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT * FROM `mail` WHERE uid=%d AND $sql_extra ORDER BY created DESC LIMIT %d OFFSET %d",
|
$r = q("SELECT * FROM `mail` WHERE channel_id = %d AND $sql_extra ORDER BY created DESC LIMIT %d OFFSET %d",
|
||||||
intval(api_user()),
|
intval(api_user()),
|
||||||
intval($count), intval($start)
|
intval($count), intval($start)
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user