X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=a4fe9c00e397a7f6053990ed2997a589b5248330;hb=64069f8bd6308f6a7e4f35de0046f30735ae9718;hp=1a93d119f4ed464e37ab129a7e7acb7b75bbf486;hpb=afc87838628994edd839cc5f3b8b9236adb129d3;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index 1a93d119f4..a4fe9c00e3 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -22,7 +22,6 @@ use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Feature; -use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; @@ -34,7 +33,7 @@ use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Model\Profile; -use Friendica\Model\Term; +use Friendica\Model\Tag; use Friendica\Object\Post; use Friendica\Object\Thread; use Friendica\Protocol\Activity; @@ -148,6 +147,8 @@ function localize_item(&$item) if (!empty($item['verb'])) { $activity = DI::activity(); + $xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">"; + if (stristr($item['verb'], Activity::POKE)) { $verb = urldecode(substr($item['verb'], strpos($item['verb'],'#') + 1)); if (!$verb) { @@ -160,8 +161,6 @@ function localize_item(&$item) $Aname = $item['author-name']; $Alink = $item['author-link']; - $xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">"; - $obj = XML::parseString($xmlhead . $item['object']); $Bname = $obj->title; @@ -189,12 +188,12 @@ function localize_item(&$item) $txt = DI::l10n()->t('%1$s poked %2$s'); // now translate the verb - $poked_t = trim(sprintf($txt, "", "")); + $poked_t = trim(sprintf($txt, '', '')); $txt = str_replace($poked_t, DI::l10n()->t($verb), $txt); // then do the sprintf on the translation string - $item['body'] = sprintf($txt, $A, $B). "\n\n\n" . $Bphoto; + $item['body'] = sprintf($txt, $A, $B) . "\n\n\n" . $Bphoto; } @@ -237,7 +236,7 @@ function localize_item(&$item) } $plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]'; - $parsedobj = XML::parseString($xmlhead.$item['object']); + $parsedobj = XML::parseString($xmlhead . $item['object']); $tag = sprintf('#[url=%s]%s[/url]', $parsedobj->id, $parsedobj->content); $item['body'] = DI::l10n()->t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag); @@ -527,7 +526,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o $profile_name = $item['author-link']; } - $tags = Term::populateTagsFromItem($item); + $tags = Tag::populateFromItem($item); $author = ['uid' => 0, 'id' => $item['author-id'], 'network' => $item['author-network'], 'url' => $item['author-link']]; @@ -837,15 +836,15 @@ function item_photo_menu($item) { if (!empty($pcid)) { $contact_url = 'contact/' . $pcid; - $posts_link = 'contact/' . $pcid . '/posts'; - $block_link = 'contact/' . $pcid . '/block'; - $ignore_link = 'contact/' . $pcid . '/ignore'; + $posts_link = $contact_url . '/posts'; + $block_link = $contact_url . '/block'; + $ignore_link = $contact_url . '/ignore'; } if ($cid && !$item['self']) { - $poke_link = 'poke?c=' . $cid; $contact_url = 'contact/' . $cid; - $posts_link = 'contact/' . $cid . '/posts'; + $poke_link = $contact_url . '/poke'; + $posts_link = $contact_url . '/posts'; if (in_array($network, [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA])) { $pm_url = 'message/new/' . $cid;