]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Merge pull request #8530 from MrPetovan/task/8498-move-poke-to-src
[friendica.git] / include / conversation.php
index 5dd7e147e680e1db369a443d726e3569e4f6a83d..43eeb9e41ce1cced73d39bdb72e3ee27e7945303 100644 (file)
@@ -148,21 +148,21 @@ 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));
+                       $verb = urldecode(substr($item['verb'], strpos($item['verb'],'#') + 1));
                        if (!$verb) {
                                return;
                        }
-                       if ($item['object-type']=="" || $item['object-type']!== Activity\ObjectType::PERSON) {
+                       if ($item['object-type'] == "" || $item['object-type'] !== Activity\ObjectType::PERSON) {
                                return;
                        }
 
                        $Aname = $item['author-name'];
                        $Alink = $item['author-link'];
 
-                       $xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">";
-
-                       $obj = XML::parseString($xmlhead.$item['object']);
+                       $obj = XML::parseString($xmlhead . $item['object']);
 
                        $Bname = $obj->title;
                        $Blink = $obj->id;
@@ -189,16 +189,16 @@ 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;
 
                }
 
-               if ($activity->match($item['verb'],  Activity::TAG)) {
+               if ($activity->match($item['verb'], Activity::TAG)) {
                        $fields = ['author-id', 'author-link', 'author-name', 'author-network',
                                'verb', 'object-type', 'resource-id', 'body', 'plink'];
                        $obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
@@ -237,7 +237,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);
@@ -837,15 +837,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;