]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #9696 from MrPetovan/bug/9306-poke-privacy
authorMichael Vogel <icarus@dabo.de>
Tue, 22 Dec 2020 16:11:37 +0000 (17:11 +0100)
committerGitHub <noreply@github.com>
Tue, 22 Dec 2020 16:11:37 +0000 (17:11 +0100)
Use correct request parameter type for poke privacy

include/conversation.php
mod/photos.php
src/Model/Contact.php
src/Module/Contact/Poke.php

index f0d121a3cae4952f9d20e96dcbfc6f0b4470c931..c87c8cb5881d5358d5dea777d48252c043b14641 100644 (file)
@@ -762,7 +762,7 @@ function conversation_fetch_comments($thread_items, bool $pinned, array $activit
                                }
 
                                if (($row['gravity'] == GRAVITY_PARENT) && !empty($row['causer-id'])) {
-                                       $row['reshared'] = DI::l10n()->t('%s reshared this.', '<a href="'. htmlentities(Contact::magicLinkbyId($row['causer-id'])) .'">' . htmlentities($name) . '</a>');
+                                       $row['reshared'] = DI::l10n()->t('%s reshared this.', '<a href="'. htmlentities(Contact::magicLinkById($row['causer-id'])) .'">' . htmlentities($name) . '</a>');
                                }
                                $row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Reshared') : DI::l10n()->t('Reshared by %s', $name))];
                                break;
index 94c348cc9f99ad09b9f5b31ba2e1d3988193bf33..ca5b66abe4a8cfd7d7950b1ff38ea59817633879 100644 (file)
@@ -1454,7 +1454,7 @@ function photos_content(App $a)
                                                continue;
                                        }
 
-                                       $profile_url = Contact::magicLinkbyId($item['author-id']);
+                                       $profile_url = Contact::magicLinkById($item['author-id']);
                                        if (strpos($profile_url, 'redir/') === 0) {
                                                $sparkle = ' sparkle';
                                        } else {
index 2908385f583e06430ebe775a754740c652bf9db6..b922265e24d7490fec71f6b0667316dd68943ba0 100644 (file)
@@ -2658,7 +2658,7 @@ class Contact
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function magicLinkbyId($cid, $url = '')
+       public static function magicLinkById($cid, $url = '')
        {
                $contact = DBA::selectFirst('contact', ['id', 'network', 'url', 'uid'], ['id' => $cid]);
 
index d9fab36c02e87a79be771242e72be4554fe0ed66..5ecec4bae09be114344795bce35ddce4f2883226 100644 (file)
@@ -44,14 +44,14 @@ class Poke extends BaseModule
 
                Logger::info('verb ' . $verb . ' contact ' . $contact_id);
 
-               $contact = DBA::selectFirst('contact', ['id', 'name'], ['id' => $parameters['id'], 'uid' => local_user()]);
+               $contact = DBA::selectFirst('contact', ['id', 'name', 'url'], ['id' => $parameters['id'], 'uid' => local_user()]);
                if (!DBA::isResult($contact)) {
                        return self::postReturn(false);
                }
 
                $a = DI::app();
 
-               $private = (!empty($_GET['private']) ? intval($_GET['private']) : Model\Item::PUBLIC);
+               $private = !empty($_POST['private']) ? Model\Item::PRIVATE : Model\Item::PUBLIC;
 
                $allow_cid     = ($private ? '<' . $contact['id']. '>' : $a->user['allow_cid']);
                $allow_gid     = ($private ? '' : $a->user['allow_gid']);
@@ -86,7 +86,7 @@ class Poke extends BaseModule
                $arr['object-type']   = Activity\ObjectType::PERSON;
 
                $arr['origin']        = 1;
-               $arr['body']          = '[url=' . $actor['url'] . ']' . $actor['name'] . '[/url]' . ' ' . $verbs[$verb][2] . ' ' . '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
+               $arr['body']          = '@[url=' . $actor['url'] . ']' . $actor['name'] . '[/url]' . ' ' . $verbs[$verb][2] . ' ' . '@[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
 
                $arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . XML::escape($contact['name']) . '</title><id>' . XML::escape($contact['url']) . '</id>';
                $arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />') . "\n";