From 2ef4972782d755afb2122f8f84b036b6f786d040 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 22 Dec 2020 01:01:43 -0500 Subject: [PATCH 1/3] Fix capitalization of Contact::magicLinkById calls --- include/conversation.php | 2 +- mod/photos.php | 2 +- src/Model/Contact.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index f0d121a3c..c87c8cb58 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -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.', '' . htmlentities($name) . ''); + $row['reshared'] = DI::l10n()->t('%s reshared this.', '' . htmlentities($name) . ''); } $row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Reshared') : DI::l10n()->t('Reshared by %s', $name))]; break; diff --git a/mod/photos.php b/mod/photos.php index 6e9a96ab2..ac51d5273 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1455,7 +1455,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 { diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 2908385f5..b922265e2 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -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]); From 043e2224b00adbbe62e2bfae7e926cfdb0b2bdfc Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 22 Dec 2020 01:02:06 -0500 Subject: [PATCH 2/3] Add mentions to poke posts --- src/Module/Contact/Poke.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module/Contact/Poke.php b/src/Module/Contact/Poke.php index d9fab36c0..73131daa4 100644 --- a/src/Module/Contact/Poke.php +++ b/src/Module/Contact/Poke.php @@ -44,7 +44,7 @@ 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); } @@ -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'] = '' . Activity\ObjectType::PERSON . '' . XML::escape($contact['name']) . '' . XML::escape($contact['url']) . ''; $arr['object'] .= '' . XML::escape('') . "\n"; From 2ef5bf1e21eaceee5d26b59c1ef5454719301b97 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 22 Dec 2020 01:02:42 -0500 Subject: [PATCH 3/3] Use correct request parameter type for poke privacy --- src/Module/Contact/Poke.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Contact/Poke.php b/src/Module/Contact/Poke.php index 73131daa4..5ecec4bae 100644 --- a/src/Module/Contact/Poke.php +++ b/src/Module/Contact/Poke.php @@ -51,7 +51,7 @@ class Poke extends BaseModule $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']);