1
0
Fork 0
This commit is contained in:
Philipp Holzer 2019-10-25 00:10:20 +02:00
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

@ -134,7 +134,7 @@ function item_post(App $a) {
$toplevel_item_id = $toplevel_item['id'];
$parent_user = $toplevel_item['uid'];
$objecttype = Activity::OBJ_COMMENT;
$objecttype = Activity\ObjectType::COMMENT;
}
if ($toplevel_item_id) {
@ -467,7 +467,7 @@ function item_post(App $a) {
$match = null;
if (!$preview && Photo::setPermissionFromBody($body, $profile_uid, $original_contact_id, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny)) {
$objecttype = Activity::OBJ_IMAGE;
$objecttype = Activity\ObjectType::IMAGE;
}
/*
@ -503,7 +503,7 @@ function item_post(App $a) {
if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data["type"]))
&& ($posttype != Item::PT_PERSONAL_NOTE)) {
$posttype = Item::PT_PAGE;
$objecttype = Activity::OBJ_BOOKMARK;
$objecttype = Activity\ObjectType::BOOKMARK;
}
/** @var BBCode\Video $bbCodeVideo */
@ -517,15 +517,15 @@ function item_post(App $a) {
// Setting the object type if not defined before
if (!$objecttype) {
$objecttype = Activity::OBJ_NOTE; // Default value
$objecttype = Activity\ObjectType::NOTE; // Default value
$objectdata = BBCode::getAttachedData($body);
if ($objectdata["type"] == "link") {
$objecttype = Activity::OBJ_BOOKMARK;
$objecttype = Activity\ObjectType::BOOKMARK;
} elseif ($objectdata["type"] == "video") {
$objecttype = Activity::OBJ_VIDEO;
$objecttype = Activity\ObjectType::VIDEO;
} elseif ($objectdata["type"] == "photo") {
$objecttype = Activity::OBJ_IMAGE;
$objecttype = Activity\ObjectType::IMAGE;
}
}

View file

@ -569,22 +569,22 @@ function photos_post(App $a)
$arr['visible'] = 1;
$arr['verb'] = Activity::TAG;
$arr['gravity'] = GRAVITY_PARENT;
$arr['object-type'] = Activity::OBJ_PERSON;
$arr['target-type'] = Activity::OBJ_IMAGE;
$arr['object-type'] = Activity\ObjectType::PERSON;
$arr['target-type'] = Activity\ObjectType::IMAGE;
$arr['tag'] = $tagged[4];
$arr['inform'] = $tagged[2];
$arr['origin'] = 1;
$arr['body'] = L10n::t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . L10n::t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
$arr['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . System::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
$arr['object'] = '<object><type>' . Activity::OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
$arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
$arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
if ($tagged[3]) {
$arr['object'] .= XML::escape('<link rel="photo" type="' . $photo['type'] . '" href="' . $tagged[3]['photo'] . '" />' . "\n");
}
$arr['object'] .= '</link></object>' . "\n";
$arr['target'] = '<target><type>' . Activity::OBJ_IMAGE . '</type><title>' . $photo['desc'] . '</title><id>'
$arr['target'] = '<target><type>' . Activity\ObjectType::IMAGE . '</type><title>' . $photo['desc'] . '</title><id>'
. System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '</id>';
$arr['target'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '" />' . "\n" . '<link rel="preview" type="' . $photo['type'] . '" href="' . System::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';

View file

@ -118,12 +118,12 @@ function poke_init(App $a)
$arr['visible'] = 1;
$arr['verb'] = $activity;
$arr['private'] = $private;
$arr['object-type'] = Activity::OBJ_PERSON;
$arr['object-type'] = Activity\ObjectType::PERSON;
$arr['origin'] = 1;
$arr['body'] = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . L10n::t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]';
$arr['object'] = '<object><type>' . Activity::OBJ_PERSON . '</type><title>' . $target['name'] . '</title><id>' . $target['url'] . '</id>';
$arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $target['name'] . '</title><id>' . $target['url'] . '</id>';
$arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
$arr['object'] .= XML::escape('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");

View file

@ -2,6 +2,7 @@
/**
* @file mod/subthread.php
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
@ -88,7 +89,7 @@ function subthread_content(App $a) {
$uri = Item::newURI($owner_uid);
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$objtype = (($item['resource-id']) ? Activity::OBJ_IMAGE : Activity::OBJ_NOTE );
$objtype = (($item['resource-id']) ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE );
$link = XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $item['guid'] . '" />' . "\n");
$body = $item['body'];

View file

@ -2,12 +2,13 @@
/**
* @file mod/tagger.php
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Item;
@ -69,7 +70,7 @@ function tagger_content(App $a) {
$uri = Item::newURI($owner_uid);
$xterm = XML::escape($term);
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$targettype = (($item['resource-id']) ? Activity::OBJ_IMAGE : Activity::OBJ_NOTE );
$targettype = (($item['resource-id']) ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE );
$href = System::baseUrl() . '/display/' . $item['guid'];
$link = XML::escape('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n");
@ -88,7 +89,7 @@ function tagger_content(App $a) {
EOT;
$tagid = System::baseUrl() . '/search?tag=' . $xterm;
$objtype = Activity::OBJ_TAGTERM;
$objtype = Activity\ObjectType::TAGTERM;
$obj = <<< EOT
<object>