use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Model\Post;
+use Friendica\Moderation\Entity\Report;
use Friendica\Protocol\Activity;
use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Delivery;
$tags = Receiver::processTags(JsonLD::fetchElementArray($activity['as:object'], 'as:tag') ?? []);
if (!empty($tags)) {
foreach ($tags as $tag) {
- if ($tag['type'] != 'Hashtag') {
+ if (($tag['type'] != 'Hashtag') && !strpos($tag['type'], ':Hashtag')) {
continue;
}
$messageTags[] = ltrim(mb_strtolower($tag['name']), '#');
*/
public static function ReportAccount(array $activity)
{
- $account_id = Contact::getIdForURL($activity['object_id']);
- if (empty($account_id)) {
+ $account = Contact::getByURL($activity['object_id'], null, ['id', 'gsid']);
+ if (empty($account)) {
Logger::info('Unknown account', ['activity' => $activity]);
Queue::remove($activity);
return;
}
}
- $report = DI::reportFactory()->createFromReportsRequest($reporter_id, $account_id, $activity['content'], null, '', false, $uri_ids);
+ $report = DI::reportFactory()->createFromReportsRequest(System::getRules(true), $reporter_id, $account['id'], $account['gsid'], $activity['content'], 'other', false, $uri_ids);
DI::report()->save($report);
- Logger::info('Stored report', ['reporter' => $reporter_id, 'account_id' => $account_id, 'comment' => $activity['content'], 'object_ids' => $activity['object_ids']]);
+ Logger::info('Stored report', ['reporter' => $reporter_id, 'account' => $account, 'comment' => $activity['content'], 'object_ids' => $activity['object_ids']]);
}
/**