Improved similarity to ostatus group feeds

This commit is contained in:
Michael 2018-03-18 11:18:25 +00:00
parent 3ff6520ed5
commit d8824cc3bc

View file

@ -2023,12 +2023,10 @@ class OStatus
$mentioned = $newmentions;
foreach ($mentioned as $mention) {
$r = q(
"SELECT `forum`, `prv` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s'",
intval($owner["uid"]),
dbesc(normalise_link($mention))
);
if ($r[0]["forum"] || $r[0]["prv"]) {
$condition = ['uid' => $owner['uid'], 'nurl' => normalise_link($mention)];
$contact = dba::selectFirst('contact', ['forum', 'prv', 'self', 'contact-type'], $condition);
if ($contact["forum"] || $contact["prv"] || ($owner['contact-type'] == ACCOUNT_TYPE_COMMUNITY) ||
($contact['self'] && ($owner['account-type'] == ACCOUNT_TYPE_COMMUNITY))) {
XML::addElement($doc, $entry, "link", "",
[
"rel" => "mentioned",
@ -2045,6 +2043,12 @@ class OStatus
}
}
if ($owner['account-type'] == ACCOUNT_TYPE_COMMUNITY) {
XML::addElement($doc, $entry, "link", "", ["rel" => "mentioned",
"ostatus:object-type" => "http://activitystrea.ms/schema/1.0/group",
"href" => $owner['url']]);
}
if (!$item["private"]) {
XML::addElement($doc, $entry, "link", "", ["rel" => "ostatus:attention",
"href" => "http://activityschema.org/collection/public"]);