This commit is contained in:
Philipp Holzer 2019-10-25 00:10:20 +02:00
parent a83dfc11a0
commit 3897c74deb
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
21 changed files with 439 additions and 122 deletions

View file

@ -828,7 +828,7 @@ class Contact extends BaseObject
} elseif (in_array($protocol, [Protocol::OSTATUS, Protocol::DFRN])) {
// create an unfollow slap
$item = [];
$item['verb'] = Activity\ANamespace::OSTATUS . "/unfollow";
$item['verb'] = Activity::O_UNFOLLOW;
$item['follow'] = $contact["url"];
$item['body'] = '';
$item['title'] = '';

View file

@ -304,7 +304,7 @@ class Event extends BaseObject
$item = Item::selectFirst(['id'], ['event-id' => $event['id'], 'uid' => $event['uid']]);
if (DBA::isResult($item)) {
$object = '<object><type>' . XML::escape(Activity::OBJ_EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
$object = '<object><type>' . XML::escape(Activity\ObjectType::EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
$object .= '<content>' . XML::escape(self::getBBCode($event)) . '</content>';
$object .= '</object>' . "\n";
@ -352,12 +352,12 @@ class Event extends BaseObject
$item_arr['private'] = $private;
$item_arr['visible'] = 1;
$item_arr['verb'] = Activity::POST;
$item_arr['object-type'] = Activity::OBJ_EVENT;
$item_arr['object-type'] = Activity\ObjectType::EVENT;
$item_arr['origin'] = $event['cid'] === 0 ? 1 : 0;
$item_arr['body'] = self::getBBCode($event);
$item_arr['event-id'] = $event['id'];
$item_arr['object'] = '<object><type>' . XML::escape(Activity::OBJ_EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
$item_arr['object'] = '<object><type>' . XML::escape(Activity\ObjectType::EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
$item_arr['object'] .= '<content>' . XML::escape(self::getBBCode($event)) . '</content>';
$item_arr['object'] .= '</object>' . "\n";

View file

@ -214,7 +214,7 @@ class Item extends BaseObject
$row['object'] = '';
}
if (array_key_exists('object-type', $row)) {
$row['object-type'] = Activity::OBJ_NOTE;
$row['object-type'] = Activity\ObjectType::NOTE;
}
} elseif (array_key_exists('verb', $row) && in_array($row['verb'], ['', Activity::POST, Activity::SHARE])) {
// Posts don't have an object or target - but having tags or files.
@ -1157,14 +1157,14 @@ class Item extends BaseObject
private static function deleteTagsFromItem($item)
{
if (($item["verb"] != Activity::TAG) || ($item["object-type"] != Activity::OBJ_TAGTERM)) {
if (($item["verb"] != Activity::TAG) || ($item["object-type"] != Activity\ObjectType::TAGTERM)) {
return;
}
$xo = XML::parseString($item["object"], false);
$xt = XML::parseString($item["target"], false);
if ($xt->type != Activity::OBJ_NOTE) {
if ($xt->type != Activity\ObjectType::NOTE) {
return;
}
@ -3156,7 +3156,7 @@ class Item extends BaseObject
return true;
}
$objtype = $item['resource-id'] ? Activity::OBJ_IMAGE : Activity::OBJ_NOTE;
$objtype = $item['resource-id'] ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE;
$new_item = [
'guid' => System::createUUID(),
@ -3436,7 +3436,7 @@ class Item extends BaseObject
// In order to provide theme developers more possibilities, event items
// are treated differently.
if ($item['object-type'] === Activity::OBJ_EVENT && isset($item['event-id'])) {
if ($item['object-type'] === Activity\ObjectType::EVENT && isset($item['event-id'])) {
$ev = Event::getItemHTML($item);
return $ev;
}