use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
-use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Model\Item;
use Friendica\Model\Notify\Type;
use Friendica\Model\Photo;
+use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Network\HTTPException;
use Friendica\Object\EMail\ItemCCEMail;
use Friendica\Protocol\Activity;
use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Security;
-use Friendica\Util\Strings;
+use Friendica\Security\Security;
use Friendica\Worker\Delivery;
function item_post(App $a) {
if (strlen($attachments)) {
$attachments .= ',';
}
- $attachments .= '[attach]href="' . DI::baseUrl() . '/attach/' . $attachment['id'] .
- '" length="' . $attachment['filesize'] . '" type="' . $attachment['filetype'] .
- '" title="' . ($attachment['filename'] ? $attachment['filename'] : '') . '"[/attach]';
+ $attachments .= Post\Media::getAttachElement(DI::baseUrl() . '/attach/' . $attachment['id'],
+ $attachment['filesize'], $attachment['filetype'], $attachment['filename'] ?? '');
}
$body = str_replace($match[1],'',$body);
}
}
}
- // Insert an item entry for UID=0 for global entries.
- // We now do it in the background to save some time.
- // This is important in interactive environments like the frontend or the API.
- // We don't fork a new process since this is done anyway with the following command
- Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "CreateShadowEntry", $post_id);
-
// When we are doing some forum posting via ! we have to start the notifier manually.
// These kind of posts don't initiate the notifier call in the item class.
if ($only_to_forum) {