use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
-use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Protocol\ActivityPub;
use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Network;
+use Friendica\Util\HTTPSignature;
use Friendica\Util\Strings;
/**
}
if ((substr($url, 0, 7) == 'https//') || (substr($url, 0, 6) == 'http//')) {
- Logger::notice('Wrong scheme in url', ['url' => $url, 'callstack' => System::callstack(20)]);
+ Logger::notice('Wrong scheme in url', ['url' => $url]);
}
$cid = Contact::getIdForURL($url, 0, false);
DBA::insert('post-tag', $fields, Database::INSERT_IGNORE);
- Logger::debug('Stored tag/mention', ['uri-id' => $uriId, 'tag-id' => $tagid, 'contact-id' => $cid, 'name' => $name, 'type' => $type, 'callstack' => System::callstack(8)]);
+ Logger::debug('Stored tag/mention', ['uri-id' => $uriId, 'tag-id' => $tagid, 'contact-id' => $cid, 'name' => $name, 'type' => $type]);
}
/**
$target = self::ACCOUNT;
Logger::debug('URL is an account', ['url' => $url]);
} elseif ($fetch && ($target != self::GENERAL_COLLECTION)) {
- $content = ActivityPub::fetchContent($url);
+ $content = HTTPSignature::fetch($url);
if (!empty($content['type']) && ($content['type'] == 'OrderedCollection')) {
$target = self::GENERAL_COLLECTION;
Logger::debug('URL is an ordered collection', ['url' => $url]);
*/
public static function storeFromArray(array $item, string $tags = null)
{
- Logger::info('Check for tags', ['uri-id' => $item['uri-id'], 'hash' => $tags, 'callstack' => System::callstack()]);
+ Logger::info('Check for tags', ['uri-id' => $item['uri-id'], 'hash' => $tags]);
if (is_null($tags)) {
$tags = self::TAG_CHARACTER[self::HASHTAG] . self::TAG_CHARACTER[self::MENTION] . self::TAG_CHARACTER[self::EXCLUSIVE_MENTION];
*/
public static function storeRawTagsFromBody(int $uriId, string $body)
{
- Logger::info('Check for tags', ['uri-id' => $uriId, 'callstack' => System::callstack()]);
+ Logger::info('Check for tags', ['uri-id' => $uriId]);
$result = BBCode::getTags($body);
if (empty($result)) {
return;
}
- Logger::debug('Removing tag/mention', ['uri-id' => $uriId, 'tid' => $tag['tid'], 'name' => $name, 'url' => $url, 'callstack' => System::callstack(8)]);
+ Logger::debug('Removing tag/mention', ['uri-id' => $uriId, 'tid' => $tag['tid'], 'name' => $name, 'url' => $url]);
DBA::delete('post-tag', ['uri-id' => $uriId, 'type' => $type, 'tid' => $tag['tid'], 'cid' => $tag['cid']]);
}
public static function getUIDListByURIId(int $uriId): array
{
$uids = [];
- $tags = self::getByURIId($uriId, [self::HASHTAG]);
- foreach ($tags as $tag) {
- $uids = array_merge($uids, self::getUIDListByTag(self::TAG_CHARACTER[self::HASHTAG] . $tag['name']));
+ foreach (self::getByURIId($uriId, [self::HASHTAG]) as $tag) {
+ foreach (self::getUIDListByTag(self::TAG_CHARACTER[self::HASHTAG] . $tag['name']) as $uid) {
+ $uids[$uid][] = $tag['name'];
+ }
}
- return array_unique($uids);
+ return $uids;
}
}