mirror of
https://github.com/friendica/friendica
synced 2024-11-10 11:02:53 +00:00
Fixed inReplyTo in conversations
This commit is contained in:
parent
c66d095389
commit
5bf7a3b7a5
1 changed files with 15 additions and 9 deletions
|
@ -656,17 +656,23 @@ function ostatus_completion($conversation_url, $uid, $item = array()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($single_conv->context->inReplyTo->id)) {
|
$parent_uri = $parent["uri"];
|
||||||
$parent_uri = $single_conv->context->inReplyTo->id;
|
|
||||||
|
|
||||||
|
// "context" only seems to exist on older servers
|
||||||
|
if (isset($single_conv->context->inReplyTo->id)) {
|
||||||
$parent_exists = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s','%s') LIMIT 1",
|
$parent_exists = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s','%s') LIMIT 1",
|
||||||
intval($uid), dbesc($parent_uri), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DFRN));
|
intval($uid), dbesc($single_conv->context->inReplyTo->id), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DFRN));
|
||||||
if (!$parent_exists) {
|
if ($parent_exists)
|
||||||
logger("Parent ".$parent_uri." wasn't found here", LOGGER_DEBUG);
|
$parent_uri = $single_conv->context->inReplyTo->id;
|
||||||
$parent_uri = $parent["uri"];
|
}
|
||||||
|
|
||||||
|
// This is the current way
|
||||||
|
if (isset($single_conv->object->inReplyTo->id)) {
|
||||||
|
$parent_exists = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s','%s') LIMIT 1",
|
||||||
|
intval($uid), dbesc($single_conv->object->inReplyTo->id), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DFRN));
|
||||||
|
if ($parent_exists)
|
||||||
|
$parent_uri = $single_conv->object->inReplyTo->id;
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
$parent_uri = $parent["uri"];
|
|
||||||
|
|
||||||
$message_exists = q("SELECT `id`, `parent`, `uri` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s','%s') LIMIT 1",
|
$message_exists = q("SELECT `id`, `parent`, `uri` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s','%s') LIMIT 1",
|
||||||
intval($uid), dbesc($single_conv->id),
|
intval($uid), dbesc($single_conv->id),
|
||||||
|
|
Loading…
Reference in a new issue