]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Event.php
Check and add a server
[friendica.git] / src / Model / Event.php
index b8d578bbad4e353b62cc2ae8d6e8b193c5bacbd2..5139abc43420e7aa0a443f47b5620eeaa75d4bee 100644 (file)
@@ -24,6 +24,7 @@ namespace Friendica\Model;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
+use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
@@ -346,7 +347,6 @@ class Event
                                $item_arr['uid']           = $event['uid'];
                                $item_arr['contact-id']    = $event['cid'];
                                $item_arr['uri']           = $event['uri'];
-                               $item_arr['parent-uri']    = $event['uri'];
                                $item_arr['guid']          = $event['guid'];
                                $item_arr['plink']         = $arr['plink'] ?? '';
                                $item_arr['post-type']     = Item::PT_EVENT;
@@ -370,6 +370,7 @@ class Event
                                $item_arr['origin']        = $event['cid'] === 0 ? 1 : 0;
                                $item_arr['body']          = self::getBBCode($event);
                                $item_arr['event-id']      = $event['id'];
+                               $item_arr['network']       = Protocol::DFRN;
 
                                $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>';
@@ -611,14 +612,12 @@ class Event
 
                        $title = BBCode::convert(Strings::escapeHtml($event['summary']));
                        if (!$title) {
-                               list($title, $_trash) = explode("<br", BBCode::convert(Strings::escapeHtml($event['desc'])), 2);
+                               list($title, $_trash) = explode("<br", BBCode::convert(Strings::escapeHtml($event['desc'])), BBCode::API);
                        }
 
                        $author_link = $event['author-link'];
-                       $plink       = $event['plink'];
 
                        $event['author-link'] = Contact::magicLink($author_link);
-                       $event['plink']       = Contact::magicLink($author_link, $plink);
 
                        $html = self::getHTML($event);
                        $event['summary']  = BBCode::convert(Strings::escapeHtml($event['summary']));
@@ -638,7 +637,7 @@ class Event
                                'is_first' => $is_first,
                                'item'     => $event,
                                'html'     => $html,
-                               'plink'    => [$event['plink'], DI::l10n()->t('link to source'), '', ''],
+                               'plink'    => Item::getPlink($event),
                        ];
                }