diff --git a/doc/API-Entities.md b/doc/API-Entities.md index 6a851014e..bd84cb707 100644 --- a/doc/API-Entities.md +++ b/doc/API-Entities.md @@ -765,7 +765,7 @@ Identical to [the Twitter Media Object](https://developer.twitter.com/en/docs/tw
  • 64: Unused
  • 128: Mention
  • 256: Tag added to a post
  • -
  • 512: Poke
  • +
  • 512: Poke (Obsolete)
  • 1024: New post
  • 16384: System email
  • 32768: System event
  • diff --git a/doc/Addons.md b/doc/Addons.md index 3dca70313..bbc0ed61c 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -766,10 +766,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- Hook::callAll('home_init', $ret); Hook::callAll("home_content", $content); -### mod/poke.php - - Hook::callAll('post_local_end', $arr); - ### mod/contacts.php Hook::callAll('contact_edit_post', $_POST); @@ -967,10 +963,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata); -### src/Core/L10n/L10n.php - - Hook::callAll('poke_verbs', $arr); - ### src/Core/Worker.php Hook::callAll("proc_run", $arr); diff --git a/doc/de/Addons.md b/doc/de/Addons.md index 163426604..5a4ca98a0 100644 --- a/doc/de/Addons.md +++ b/doc/de/Addons.md @@ -285,10 +285,6 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap Hook::callAll('home_init', $ret); Hook::callAll("home_content", $content); -### mod/poke.php - - Hook::callAll('post_local_end', $arr); - ### mod/contacts.php Hook::callAll('contact_edit_post', $_POST); @@ -461,10 +457,6 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata); -### src/Core/L10n/L10n.php - - Hook::callAll('poke_verbs', $arr); - ### src/Core/Worker.php Hook::callAll("proc_run", $arr); diff --git a/src/Content/Item.php b/src/Content/Item.php index ccd3396c2..ca60139ea 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -256,63 +256,6 @@ class Item if (!empty($item['verb'])) { $xmlhead = ''; - if (stristr($item['verb'], Activity::POKE)) { - $verb = urldecode(substr($item['verb'], strpos($item['verb'],'#') + 1)); - if (!$verb) { - $this->profiler->stopRecording(); - return; - } - if ($item['object-type'] == '' || $item['object-type'] !== Activity\ObjectType::PERSON) { - $this->profiler->stopRecording(); - return; - } - - $obj = XML::parseString($xmlhead . $item['object']); - - $Bname = $obj->title; - $Blink = $obj->id; - $Bphoto = ''; - - foreach ($obj->link as $l) { - $atts = $l->attributes(); - switch ($atts['rel']) { - case 'alternate': $Blink = $atts['href']; - case 'photo': $Bphoto = $atts['href']; - } - } - - $author = [ - 'uid' => 0, - 'id' => $item['author-id'], - 'network' => $item['author-network'], - 'url' => $item['author-link'], - ]; - $A = '[url=' . Contact::magicLinkByContact($author) . ']' . $item['author-name'] . '[/url]'; - - if (!empty($Blink)) { - $B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]'; - } else { - $B = ''; - } - - if ($Bphoto != '' && !empty($Blink)) { - $Bphoto = '[url=' . Contact::magicLink($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]'; - } - - /* - * we can't have a translation string with three positions but no distinguishable text - * So here is the translate string. - */ - $txt = $this->l10n->t('%1$s poked %2$s'); - - // now translate the verb - $poked_t = trim(sprintf($txt, '', '')); - $txt = str_replace($poked_t, $this->l10n->t($verb), $txt); - - // then do the sprintf on the translation string - $item['body'] = sprintf($txt, $A, $B) . "\n\n\n" . $Bphoto; - } - if ($this->activity->match($item['verb'], Activity::TAG)) { $fields = ['author-id', 'author-link', 'author-name', 'author-network', 'verb', 'object-type', 'resource-id', 'body', 'plink']; @@ -382,7 +325,7 @@ class Item public function photoMenu(array $item, string $formSecurityToken): string { $this->profiler->startRecording('rendering'); - $sub_link = $poke_link = $contact_url = $pm_url = $status_link = ''; + $sub_link = $contact_url = $pm_url = $status_link = ''; $photos_link = $posts_link = $block_link = $ignore_link = ''; if (local_user() && local_user() == $item['uid'] && $item['gravity'] == GRAVITY_PARENT && !$item['self'] && !$item['mention']) { @@ -425,7 +368,6 @@ class Item if ($cid && !$item['self']) { $contact_url = 'contact/' . $cid; - $poke_link = $contact_url . '/poke'; $posts_link = $contact_url . '/posts'; if (in_array($network, [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA])) { @@ -450,10 +392,6 @@ class Item $menu[$this->l10n->t('Languages')] = 'javascript:alert(\'' . ModelItem::getLanguageMessage($item) . '\');'; } - if ($network == Protocol::DFRN) { - $menu[$this->l10n->t('Poke')] = $poke_link; - } - if ((($cid == 0) || ($rel == Contact::FOLLOWER)) && in_array($item['network'], Protocol::FEDERATED)) { $menu[$this->l10n->t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']) . '&auto=1'; diff --git a/src/Core/L10n.php b/src/Core/L10n.php index 430f9e3d5..0f879c494 100644 --- a/src/Core/L10n.php +++ b/src/Core/L10n.php @@ -429,32 +429,6 @@ class L10n return $ret; } - /** - * Load poke verbs - * - * @return array index is present tense verb - * value is array containing past tense verb, translation of present, translation of past - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - * @hook poke_verbs pokes array - */ - public function getPokeVerbs(): array - { - // index is present tense verb - // value is array containing past tense verb, translation of present, translation of past - $arr = [ - 'poke' => ['poked', $this->t('poke'), $this->t('poked')], - 'ping' => ['pinged', $this->t('ping'), $this->t('pinged')], - 'prod' => ['prodded', $this->t('prod'), $this->t('prodded')], - 'slap' => ['slapped', $this->t('slap'), $this->t('slapped')], - 'finger' => ['fingered', $this->t('finger'), $this->t('fingered')], - 'rebuff' => ['rebuffed', $this->t('rebuff'), $this->t('rebuffed')], - ]; - - Hook::callAll('poke_verbs', $arr); - - return $arr; - } - /** * Creates a new L10n instance based on the given langauge * diff --git a/src/Model/Contact.php b/src/Model/Contact.php index c873c3941..a836454a5 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1041,7 +1041,6 @@ class Contact $pm_url = ''; $status_link = ''; $photos_link = ''; - $poke_link = ''; if ($uid == 0) { $uid = local_user(); @@ -1084,10 +1083,6 @@ class Contact $pm_url = DI::baseUrl() . '/message/new/' . $contact['id']; } - if (($contact['network'] == Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) { - $poke_link = 'contact/' . $contact['id'] . '/poke'; - } - $contact_url = DI::baseUrl() . '/contact/' . $contact['id']; $posts_link = DI::baseUrl() . '/contact/' . $contact['id'] . '/conversations'; @@ -1122,7 +1117,6 @@ class Contact 'network' => [DI::l10n()->t('Network Posts') , $posts_link , false], 'edit' => [DI::l10n()->t('View Contact') , $contact_url , false], 'pm' => [DI::l10n()->t('Send PM') , $pm_url , false], - 'poke' => [DI::l10n()->t('Poke') , $poke_link , false], 'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link , true], 'unfollow'=> [DI::l10n()->t('UnFollow') , $unfollow_link , true], ]; diff --git a/src/Model/Item.php b/src/Model/Item.php index 5029eb618..0f363ab81 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1085,11 +1085,7 @@ class Item // Check for hashtags in the body and repair or add hashtag links $item['body'] = self::setHashtags($item['body']); - if (stristr($item['verb'], Activity::POKE)) { - $notify_type = Delivery::POKE; - } else { - $notify_type = Delivery::POST; - } + $notify_type = Delivery::POST; // Filling item related side tables if (!empty($item['attach'])) { diff --git a/src/Model/Notification/Type.php b/src/Model/Notification/Type.php index 57953b00d..d972f3831 100644 --- a/src/Model/Notification/Type.php +++ b/src/Model/Notification/Type.php @@ -40,7 +40,7 @@ class Type const SUGGEST = 32; /** @var int Notification about being tagged in a post */ const TAG_SELF = 128; - /** @var int Notification about getting poked/prodded/etc. */ + /** @var int Notification about getting poked/prodded/etc. (Obsolete) */ const POKE = 512; /** @var int Notification about either a contact had posted something directly or the contact is a mentioned forum */ const SHARE = 1024; diff --git a/src/Module/Contact/Poke.php b/src/Module/Contact/Poke.php deleted file mode 100644 index 5836c513f..000000000 --- a/src/Module/Contact/Poke.php +++ /dev/null @@ -1,183 +0,0 @@ -. - * - */ - -namespace Friendica\Module\Contact; - -use Friendica\BaseModule; -use Friendica\Content\Widget; -use Friendica\Core\Hook; -use Friendica\Core\Logger; -use Friendica\Core\Renderer; -use Friendica\Core\System; -use Friendica\Database\DBA; -use Friendica\DI; -use Friendica\Model; -use Friendica\Model\Contact; -use Friendica\Network\HTTPException; -use Friendica\Protocol\Activity; -use Friendica\Util\XML; - -class Poke extends BaseModule -{ - protected function post(array $request = []) - { - if (!local_user() || empty($this->parameters['id'])) { - return self::postReturn(false); - } - - $uid = local_user(); - - if (empty($_POST['verb'])) { - return self::postReturn(false); - } - - $verb = $_POST['verb']; - - $verbs = DI::l10n()->getPokeVerbs(); - if (!array_key_exists($verb, $verbs)) { - return self::postReturn(false); - } - - $activity = Activity::POKE . '#' . urlencode($verbs[$verb][0]); - - $contact_id = intval($this->parameters['id']); - if (!$contact_id) { - return self::postReturn(false); - } - - Logger::info('verb ' . $verb . ' contact ' . $contact_id); - - $contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => $this->parameters['id'], 'uid' => local_user()]); - if (!DBA::isResult($contact)) { - return self::postReturn(false); - } - - $a = DI::app(); - - $private = !empty($_POST['private']) ? Model\Item::PRIVATE : Model\Item::PUBLIC; - - $user = Model\User::getById($a->getLoggedInUserId()); - $allow_cid = ($private ? '<' . $contact['id']. '>' : $user['allow_cid']); - $allow_gid = ($private ? '' : $user['allow_gid']); - $deny_cid = ($private ? '' : $user['deny_cid']); - $deny_gid = ($private ? '' : $user['deny_gid']); - - $actor = Contact::getById($a->getContactId()); - - $uri = Model\Item::newURI(); - - $arr = []; - - $arr['guid'] = System::createUUID(); - $arr['uid'] = $uid; - $arr['uri'] = $uri; - $arr['wall'] = 1; - $arr['contact-id'] = $actor['id']; - $arr['owner-name'] = $actor['name']; - $arr['owner-link'] = $actor['url']; - $arr['owner-avatar'] = $actor['thumb']; - $arr['author-name'] = $actor['name']; - $arr['author-link'] = $actor['url']; - $arr['author-avatar'] = $actor['thumb']; - $arr['title'] = ''; - $arr['allow_cid'] = $allow_cid; - $arr['allow_gid'] = $allow_gid; - $arr['deny_cid'] = $deny_cid; - $arr['deny_gid'] = $deny_gid; - $arr['visible'] = 1; - $arr['verb'] = $activity; - $arr['private'] = $private; - $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['object'] = '' . Activity\ObjectType::PERSON . '' . XML::escape($contact['name']) . '' . XML::escape($contact['url']) . ''; - $arr['object'] .= '' . XML::escape('') . "\n"; - - $arr['object'] .= XML::escape('') . "\n"; - $arr['object'] .= '' . "\n"; - - $result = Model\Item::insert($arr); - - Hook::callAll('post_local_end', $arr); - - return self::postReturn($result); - } - - /** - * Since post() is called before rawContent(), we need to be able to return a JSON response in post() directly. - * - * @param bool $success - * @return bool - */ - private static function postReturn(bool $success) - { - if (!$success) { - notice(DI::l10n()->t('Error while sending poke, please retry.')); - } - - if (DI::mode()->isAjax()) { - System::jsonExit(['success' => $success]); - } - - return $success; - } - - protected function content(array $request = []): string - { - if (!local_user()) { - throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.')); - } - - if (empty($this->parameters['id'])) { - throw new HTTPException\BadRequestException(); - } - - $contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => $this->parameters['id'], 'uid' => local_user()]); - if (!DBA::isResult($contact)) { - throw new HTTPException\NotFoundException(); - } - - DI::page()['aside'] = Widget\VCard::getHTML(Model\Contact::getByURL($contact["url"], false)); - - $verbs = []; - foreach (DI::l10n()->getPokeVerbs() as $verb => $translations) { - if ($translations[1] !== 'NOTRANSLATION') { - $verbs[$verb] = $translations[1]; - } - } - - $tpl = Renderer::getMarkupTemplate('contact/poke.tpl'); - $o = Renderer::replaceMacros($tpl,[ - '$title' => DI::l10n()->t('Poke/Prod'), - '$desc' => DI::l10n()->t('poke, prod or do other things to somebody'), - '$id' => $contact['id'], - '$verb' => ['verb', DI::l10n()->t('Choose what you wish to do to recipient'), '', '', $verbs], - '$private' => ['private', DI::l10n()->t('Make this post private')], - '$loading' => DI::l10n()->t('Loading...'), - '$submit' => DI::l10n()->t('Submit'), - - ]); - - return $o; - } -} diff --git a/src/Module/Settings/Account.php b/src/Module/Settings/Account.php index d20827e6a..dcbb1861f 100644 --- a/src/Module/Settings/Account.php +++ b/src/Module/Settings/Account.php @@ -617,7 +617,6 @@ class Account extends BaseSettings '$notify5' => ['notify5', DI::l10n()->t('You receive a private message'), ($notify & Notification\Type::MAIL), Notification\Type::MAIL, ''], '$notify6' => ['notify6', DI::l10n()->t('You receive a friend suggestion'), ($notify & Notification\Type::SUGGEST), Notification\Type::SUGGEST, ''], '$notify7' => ['notify7', DI::l10n()->t('You are tagged in a post'), ($notify & Notification\Type::TAG_SELF), Notification\Type::TAG_SELF, ''], - '$notify8' => ['notify8', DI::l10n()->t('You are poked/prodded/etc. in a post'), ($notify & Notification\Type::POKE), Notification\Type::POKE, ''], '$lbl_notify' => DI::l10n()->t('Create a desktop notification when:'), '$notify_tagged' => ['notify_tagged', DI::l10n()->t('Someone tagged you'), is_null($notify_type) || $notify_type & UserNotification::TYPE_EXPLICIT_TAGGED, ''], diff --git a/src/Navigation/Notifications/Repository/Notify.php b/src/Navigation/Notifications/Repository/Notify.php index 7157868f5..8fb0f5fb0 100644 --- a/src/Navigation/Notifications/Repository/Notify.php +++ b/src/Navigation/Notifications/Repository/Notify.php @@ -358,25 +358,6 @@ class Notify extends BaseRepository $itemlink = $params['link']; break; - case Model\Notification\Type::POKE: - $subject = $l10n->t('%1$s %2$s poked you', $subjectPrefix, $params['source_name']); - - $preamble = $l10n->t('%1$s poked you at %2$s', $params['source_name'], $sitename); - $epreamble = $l10n->t('%1$s [url=%2$s]poked you[/url].', - '[url='.$params['source_link'].']'.$params['source_name'].'[/url]', - $params['link'] - ); - - $subject = str_replace('poked', $l10n->t($params['activity']), $subject); - $preamble = str_replace('poked', $l10n->t($params['activity']), $preamble); - $epreamble = str_replace('poked', $l10n->t($params['activity']), $epreamble); - - $sitelink = $l10n->t('Please visit %s to view and/or reply to the conversation.'); - $tsitelink = sprintf($sitelink, $siteurl); - $hsitelink = sprintf($sitelink, ''.$sitename.''); - $itemlink = $params['link']; - break; - case Model\Notification\Type::INTRO: $itemlink = $params['link']; $subject = $l10n->t('%s Introduction received', $subjectPrefix); diff --git a/src/Protocol/Activity.php b/src/Protocol/Activity.php index 0f15e851c..ea1feeefe 100644 --- a/src/Protocol/Activity.php +++ b/src/Protocol/Activity.php @@ -164,15 +164,6 @@ final class Activity */ const ANNOUNCE = ActivityNamespace::ACTIVITY2 . 'Announce'; - /** - * Pokes an user. - * - * @see https://github.com/friendica/friendica/wiki/ActivityStreams#activity_poke - * @var string - */ - const POKE = ActivityNamespace::ZOT . '/activity/poke'; - - const O_UNFOLLOW = ActivityNamespace::OSTATUS . '/unfollow'; const O_UNFAVOURITE = ActivityNamespace::OSTATUS . '/unfavorite'; diff --git a/src/Protocol/ActivityPub/Delivery.php b/src/Protocol/ActivityPub/Delivery.php index 6e97b0b92..38f1f52b9 100644 --- a/src/Protocol/ActivityPub/Delivery.php +++ b/src/Protocol/ActivityPub/Delivery.php @@ -103,8 +103,6 @@ class Delivery $success = ActivityPub\Transmitter::sendContactSuggestion($uid, $inbox, $item_id); } elseif ($cmd == WorkerDelivery::RELOCATION) { // @todo Implementation pending - } elseif ($cmd == WorkerDelivery::POKE) { - // Implementation not planned } elseif ($cmd == WorkerDelivery::REMOVAL) { $success = ActivityPub\Transmitter::sendProfileDeletion($uid, $inbox); } elseif ($cmd == WorkerDelivery::PROFILEUPDATE) { diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index fd5739b62..80e92fa15 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1577,61 +1577,6 @@ class DFRN } } - /** - * Send a "poke" - * - * @param array $item The new item record - * @param array $importer Record of the importer user mixed with contact of the content - * @return void - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - * @todo set proper type-hints (array?) - */ - private static function doPoke(array $item, array $importer) - { - $verb = urldecode(substr($item['verb'], strpos($item['verb'], '#')+1)); - if (!$verb) { - return; - } - $xo = XML::parseString($item['object']); - - if (($xo->type == Activity\ObjectType::PERSON) && ($xo->id)) { - // somebody was poked/prodded. Was it me? - $Blink = ''; - foreach ($xo->link as $l) { - $atts = $l->attributes(); - switch ($atts['rel']) { - case 'alternate': - $Blink = $atts['href']; - break; - - default: - break; - } - } - - if ($Blink && Strings::compareLink($Blink, DI::baseUrl() . '/profile/' . $importer['nickname'])) { - $author = DBA::selectFirst('contact', ['id', 'name', 'thumb', 'url'], ['id' => $item['author-id']]); - - $parent = Post::selectFirst(['id'], ['uri' => $item['thr-parent'], 'uid' => $importer['importer_uid']]); - $item['parent'] = $parent['id']; - - // send a notification - DI::notify()->createFromArray( - [ - 'type' => Notification\Type::POKE, - 'otype' => Notification\ObjectType::PERSON, - 'activity' => $verb, - 'verb' => $item['verb'], - 'uid' => $importer['importer_uid'], - 'cid' => $author['id'], - 'item' => $item, - 'link' => DI::baseUrl() . '/display/' . urlencode($item['guid']), - ] - ); - } - } - } - /** * Processes several actions, depending on the verb * @@ -2155,11 +2100,6 @@ class DFRN if ($item['uid'] == 0) { Item::distribute($posted_id); } - - if (stristr($item['verb'], Activity::POKE)) { - $item['id'] = $posted_id; - self::doPoke($item, $importer); - } } } diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 7f64a9d6a..f1acd8fd4 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -45,7 +45,6 @@ class Delivery const RELOCATION = 'relocate'; const DELETION = 'drop'; const POST = 'wall-new'; - const POKE = 'poke'; const REMOVAL = 'removeme'; const PROFILEUPDATE = 'profileupdate'; @@ -247,7 +246,7 @@ class Delivery */ private static function setFailedQueue(string $cmd, array $item) { - if (!in_array($cmd, [Delivery::POST, Delivery::POKE])) { + if ($cmd != Delivery::POST) { return; } @@ -326,7 +325,7 @@ class Delivery if ($public_dfrn) { Logger::info('Relay delivery to ' . $contact["url"] . ' with guid ' . $target_item["guid"] . ' returns ' . $deliver_status); - if (in_array($cmd, [Delivery::POST, Delivery::POKE])) { + if ($cmd == Delivery::POST) { if (($deliver_status >= 200) && ($deliver_status <= 299)) { Model\Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); @@ -356,7 +355,7 @@ class Delivery Model\GServer::setProtocol($contact['gsid'] ?? 0, $protocol); - if (in_array($cmd, [Delivery::POST, Delivery::POKE])) { + if ($cmd == Delivery::POST) { Model\Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol); } } else { @@ -364,7 +363,7 @@ class Delivery Model\Contact::markForArchival($contact); Logger::info('Delivery failed: defer message', ['id' => ($target_item['guid'] ?? '') ?: $target_item['id']]); - if (!Worker::defer() && in_array($cmd, [Delivery::POST, Delivery::POKE])) { + if (!Worker::defer() && $cmd == Delivery::POST) { Model\Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } } @@ -443,7 +442,7 @@ class Delivery Model\GServer::setProtocol($contact['gsid'] ?? 0, Model\Post\DeliveryData::DIASPORA); - if (in_array($cmd, [Delivery::POST, Delivery::POKE])) { + if ($cmd == Delivery::POST) { Model\Post\DeliveryData::incrementQueueDone($target_item['uri-id'], Model\Post\DeliveryData::DIASPORA); } } else { @@ -458,10 +457,10 @@ class Delivery if (empty($contact['contact-type']) || ($contact['contact-type'] != Model\Contact::TYPE_RELAY)) { Logger::info('Delivery failed: defer message', ['id' => ($target_item['guid'] ?? '') ?: $target_item['id']]); // defer message for redelivery - if (!Worker::defer() && in_array($cmd, [Delivery::POST, Delivery::POKE])) { + if (!Worker::defer() && $cmd == Delivery::POST) { Model\Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } - } elseif (in_array($cmd, [Delivery::POST, Delivery::POKE])) { + } elseif ($cmd == Delivery::POST) { Model\Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } } @@ -490,7 +489,7 @@ class Delivery return; } - if (!in_array($cmd, [self::POST, self::POKE])) { + if ($cmd != self::POST) { return; } diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 843d50ca0..d06dfead6 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -467,7 +467,7 @@ class Notifier Hook::callAll('notifier_end', $target_item); // Workaround for pure connector posts - if (in_array($cmd, [Delivery::POST, Delivery::POKE])) { + if ($cmd == Delivery::POST) { if ($delivery_queue_count == 0) { Post\DeliveryData::incrementQueueDone($target_item['uri-id']); $delivery_queue_count = 1; diff --git a/static/routes.config.php b/static/routes.config.php index f9935a53f..65beac70b 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -372,7 +372,6 @@ return [ '/{id:\d+}/conversations' => [Module\Contact\Conversations::class, [R::GET]], '/{id:\d+}/contacts[/{type}]' => [Module\Contact\Contacts::class, [R::GET]], '/{id:\d+}/media' => [Module\Contact\Media::class, [R::GET]], - '/{id:\d+}/poke' => [Module\Contact\Poke::class, [R::GET, R::POST]], '/{id:\d+}/posts' => [Module\Contact\Posts::class, [R::GET]], '/{id:\d+}/revoke' => [Module\Contact\Revoke::class, [R::GET, R::POST]], '/archived' => [Module\Contact::class, [R::GET]], diff --git a/view/templates/contact/poke.tpl b/view/templates/contact/poke.tpl deleted file mode 100644 index 88e50cf59..000000000 --- a/view/templates/contact/poke.tpl +++ /dev/null @@ -1,11 +0,0 @@ -

    {{$title}}

    - -

    {{$desc nofilter}}

    - -
    - {{include file="field_select.tpl" field=$verb}} - {{include file="field_checkbox.tpl" field=$private}} -

    - -

    -
    diff --git a/view/templates/hovercard.tpl b/view/templates/hovercard.tpl index 862871dca..563a5a248 100644 --- a/view/templates/hovercard.tpl +++ b/view/templates/hovercard.tpl @@ -18,11 +18,10 @@
    - {{* here are the differnt actions like privat message, poke, delete and so on *}} + {{* here are the different actions like private message, delete and so on *}} {{* @todo we have two different photo menus one for contacts and one for items at the network stream. We currently use the contact photo menu, so the items options are missing We need to move them *}}
    {{if $profile.actions.pm}}{{$profile.actions.pm.0}}{{/if}} - {{if $profile.actions.poke}}{{$profile.actions.poke.0}}{{/if}}
    {{if $profile.actions.network}}{{/if}} diff --git a/view/templates/settings/account.tpl b/view/templates/settings/account.tpl index d369583d3..8e9f80dc3 100644 --- a/view/templates/settings/account.tpl +++ b/view/templates/settings/account.tpl @@ -101,7 +101,6 @@ {{include file="field_intcheckbox.tpl" field=$notify5}} {{include file="field_intcheckbox.tpl" field=$notify6}} {{include file="field_intcheckbox.tpl" field=$notify7}} - {{include file="field_intcheckbox.tpl" field=$notify8}}
    {{$lbl_notify}}
    diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index 6fdcd3d24..edd7282f7 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -443,23 +443,6 @@ $(document).ready(function () { }); }); - $body.on("submit", ".modal-body #poke-wrapper", function (e) { - e.preventDefault(); - - let $form = $(this); - let $pokeSubmit = $form.find("button[type=submit]").button("loading"); - - $.post($form.attr("action"), $form.serialize(), "json") - .then(function (data) { - if (data.success) { - $("#modal").modal("hide"); - } - }) - .always(function () { - $pokeSubmit.button("reset"); - }); - }); - if (!navigator.canShare || !navigator.canShare()) { $('.button-browser-share').hide(); } diff --git a/view/theme/frio/php/frio_boot.php b/view/theme/frio/php/frio_boot.php index c0f84ac29..70111ab3b 100644 --- a/view/theme/frio/php/frio_boot.php +++ b/view/theme/frio/php/frio_boot.php @@ -68,20 +68,20 @@ function is_modal() { } /** - * Array with modalpages + * Array with modal pages * * The array contains the page names of the pages * which should displayed as modals * - * @return array Pagenames as path + * @return array Page names as path */ function get_modalpage_list() { - //Arry of pages wich getting bootstrap modal dialogs - $modalpages = ['poke/', - 'message/new', - 'settings/oauth/add', - 'events/new', -// 'fbrowser/image/' + //Array of pages which getting bootstrap modal dialogs + $modalpages = [ + 'message/new', + 'settings/oauth/add', + 'events/new', +// 'fbrowser/image/' ]; return $modalpages; diff --git a/view/theme/frio/templates/contact_template.tpl b/view/theme/frio/templates/contact_template.tpl index f72a4900f..0cd55f8d3 100644 --- a/view/theme/frio/templates/contact_template.tpl +++ b/view/theme/frio/templates/contact_template.tpl @@ -50,11 +50,6 @@ {{/if}} - {{if $contact.photo_menu.poke}} - - {{/if}} {{if $contact.photo_menu.network}} @@ -178,11 +173,6 @@ We use this part to filter the contacts with jquery.textcomplete *}} {/if} - {if $photo_menu.poke} - - {/if} {if $photo_menu.network} diff --git a/view/theme/frio/templates/poke_content.tpl b/view/theme/frio/templates/poke_content.tpl deleted file mode 100644 index b015c4447..000000000 --- a/view/theme/frio/templates/poke_content.tpl +++ /dev/null @@ -1,48 +0,0 @@ - -
    - -

    {{$title}}

    -
    {{$desc nofilter}}
    - -
    - -
    - - {{* The input field with the recipient name*}} -
    - - - - -
    - - {{* The drop-down list with different actions *}} -
    - - -
    - - {{* The checkbox to select if the "poke message" should be private *}} -
    - - -
    - -
    - -
    - -
    - -
    - -
    - -
    -
    - -
    diff --git a/view/theme/frio/templates/settings/account.tpl b/view/theme/frio/templates/settings/account.tpl index a24bf5dd4..82f25863c 100644 --- a/view/theme/frio/templates/settings/account.tpl +++ b/view/theme/frio/templates/settings/account.tpl @@ -152,7 +152,6 @@ {{include file="field_intcheckbox.tpl" field=$notify5}} {{include file="field_intcheckbox.tpl" field=$notify6}} {{include file="field_intcheckbox.tpl" field=$notify7}} - {{include file="field_intcheckbox.tpl" field=$notify8}}
    {{$lbl_notify}}
    diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index f446f3b17..4254a9904 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -1,10 +1,26 @@ . + * * Name: frio * Description: Bootstrap V3 theme. The theme is currently under construction, so it is far from finished. For further information have a look at the
    ReadMe. * Version: V.0.8.5 * Author: Rabuzarus - * */ use Friendica\App; @@ -105,7 +121,7 @@ function frio_item_photo_links(App $a, &$body_info) /** * Replace links of the item_photo_menu hook * - * This function replaces the original poke and the message links + * This function replaces the original message links * to call the addToModal javascript function so this pages can * be loaded in a bootstrap modal * @@ -115,7 +131,7 @@ function frio_item_photo_links(App $a, &$body_info) function frio_item_photo_menu(App $a, &$arr) { foreach ($arr['menu'] as $k => $v) { - if (strpos($v, '/poke') === 0 || strpos($v, 'message/new/') === 0) { + if (strpos($v, 'message/new/') === 0) { $v = 'javascript:addToModal(\'' . $v . '\'); return false;'; $arr['menu'][$k] = $v; } @@ -125,7 +141,7 @@ function frio_item_photo_menu(App $a, &$arr) /** * Replace links of the contact_photo_menu * - * This function replaces the original poke and the message links + * This function replaces the original message link * to call the addToModal javascript function so this pages can * be loaded in a bootstrap modal * Additionally the profile, status and photo page links will be changed @@ -138,13 +154,7 @@ function frio_contact_photo_menu(App $a, &$args) { $cid = $args['contact']['id']; - if (!empty($args['menu']['poke'])) { - $pokelink = $args['menu']['poke'][1]; - } else { - $pokelink = ''; - } - - if (!empty($args['menu']['poke'])) { + if (!empty($args['menu']['pm'])) { $pmlink = $args['menu']['pm'][1]; } else { $pmlink = ''; @@ -166,13 +176,9 @@ function frio_contact_photo_menu(App $a, &$args) } } - // Add to pm and poke links a new key with the value 'modal'. - // Later we can make conditions in the corresponing templates (e.g. + // Add to pm link a new key with the value 'modal'. + // Later we can make conditions in the corresponding templates (e.g. // contact_template.tpl) - if (strpos($pokelink, $cid . '/poke') !== false) { - $args['menu']['poke'][3] = 'modal'; - } - if (strpos($pmlink, 'message/new/' . $cid) !== false) { $args['menu']['pm'][3] = 'modal'; } diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 7698b0d3d..3489de031 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -2721,13 +2721,6 @@ margin-left: 0px; border: 1px solid #7C7D7B; } -/* ========== */ -/* = Poke = */ -/* ========== */ -#poke-recip { - float: none; -} - /* ================= */ /* = Notifications = */ /* ================= */