]> git.mxchange.org Git - friendica.git/commitdiff
Remove poke feature
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 9 Aug 2022 17:21:42 +0000 (13:21 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 9 Aug 2022 18:55:55 +0000 (14:55 -0400)
27 files changed:
doc/API-Entities.md
doc/Addons.md
doc/de/Addons.md
src/Content/Item.php
src/Core/L10n.php
src/Model/Contact.php
src/Model/Item.php
src/Model/Notification/Type.php
src/Module/Contact/Poke.php [deleted file]
src/Module/Settings/Account.php
src/Navigation/Notifications/Repository/Notify.php
src/Protocol/Activity.php
src/Protocol/ActivityPub/Delivery.php
src/Protocol/DFRN.php
src/Worker/Delivery.php
src/Worker/Notifier.php
static/routes.config.php
view/templates/contact/poke.tpl [deleted file]
view/templates/hovercard.tpl
view/templates/settings/account.tpl
view/theme/frio/js/theme.js
view/theme/frio/php/frio_boot.php
view/theme/frio/templates/contact_template.tpl
view/theme/frio/templates/poke_content.tpl [deleted file]
view/theme/frio/templates/settings/account.tpl
view/theme/frio/theme.php
view/theme/smoothly/style.css

index 6a851014e97fe2507fb60c3937401429ac4486bd..bd84cb70765ba3d4322de6e8556ff7c3bc4489b3 100644 (file)
@@ -765,7 +765,7 @@ Identical to [the Twitter Media Object](https://developer.twitter.com/en/docs/tw
 <li>64: Unused</li>
 <li>128: Mention</li>
 <li>256: Tag added to a post</li>
-<li>512: Poke</li>
+<li>512: Poke (Obsolete)</li>
 <li>1024: New post</li>
 <li>16384: System email</li>
 <li>32768: System event</li>
index 3dca7031321f8020a6b6354b0dd469204ed8891c..bbc0ed61c19895537eb6ae95df75a7aa6dcd32b8 100644 (file)
@@ -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);
index 163426604adeb6403b6bca401202f0c4be673e02..5a4ca98a0b8669391d64472ed81609b8b19f3ebc 100644 (file)
@@ -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);
index ccd3396c2231902e9a0457a2750d614500ee5361..ca60139eaf9982dde17c57b00007753b93256e61 100644 (file)
@@ -256,63 +256,6 @@ class Item
                if (!empty($item['verb'])) {
                        $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) {
-                                       $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';
index 430f9e3d5ee11aba26f2868e6ec3f771da69c742..0f879c494848ae6c73239b9b922dd8e194dfaea9 100644 (file)
@@ -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
         *
index c873c3941e8c912519e39aea97e868a661c2f769..a836454a53c4fc4640175f719a07c6440caa0263 100644 (file)
@@ -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],
                        ];
index 5029eb618bc68cad9069967c2f8ff69e9d5dc42f..0f363ab81d59b583307c94e2154f0c41304f798a 100644 (file)
@@ -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'])) {
index 57953b00d068f0b53e219a126336a8cd8e18ef1e..d972f38314862e2c422e57baee7d50ccceec7863 100644 (file)
@@ -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 (file)
index 5836c51..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-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'] = '<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";
-
-               $arr['object'] .= XML::escape('<link rel="photo" type="image/jpeg" href="' . $contact['photo'] . '" />') . "\n";
-               $arr['object'] .= '</link></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;
-       }
-}
index d20827e6ab7b669b10dfeb392f7208cd7fd377c8..dcbb1861f209db45b7fe3679413f063c739f867f 100644 (file)
@@ -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, ''],
index 7157868f541608fb49a16d90a027b95dae8420da..8fb0f5fb072d92a8b5a70d07c4641b7fab7ba953 100644 (file)
@@ -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, '<a href="'.$siteurl.'">'.$sitename.'</a>');
-                               $itemlink =  $params['link'];
-                               break;
-
                        case Model\Notification\Type::INTRO:
                                $itemlink = $params['link'];
                                $subject = $l10n->t('%s Introduction received', $subjectPrefix);
index 0f15e851c3df8ee3a5ec7900bcceffb27f68d040..ea1feeefee82c2d4259f05ac3e5c0ea1bc4ee2f8 100644 (file)
@@ -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';
 
index 6e97b0b92731bcb237636fc596dd8fb3cf837de5..38f1f52b9c601c6a2b38f73d95f84d32d9f36b99 100644 (file)
@@ -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) {
index fd5739b62d6740bfa6db73a8c3057a00b5921073..80e92fa1510197fd3c2d058254d8933d08af1f72 100644 (file)
@@ -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);
-                       }
                }
        }
 
index 7f64a9d6a21dfd0c0ff6ab3d16191d07818a06c4..f1acd8fd4181cc9da69c79dce13582b8c3b726db 100644 (file)
@@ -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;
                }
 
index 843d50ca059cded968b1b420c854c584dd2a2396..d06dfead615d9cf6a5e7978da77acf0fb23a2475 100644 (file)
@@ -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;
index f9935a53f40e3ea0f8ab6eeb5265e92d4ef7f33a..65beac70b2208287cfd5ddb6ffb9c8a0a3909d13 100644 (file)
@@ -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 (file)
index 88e50cf..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<h2 class="heading">{{$title}}</h2>
-
-<p>{{$desc nofilter}}</p>
-
-<form id="poke-wrapper" action="contact/{{$id}}/poke" method="post">
-       {{include file="field_select.tpl" field=$verb}}
-       {{include file="field_checkbox.tpl" field=$private}}
-       <p class="text-right">
-               <button type="submit" class="btn btn-primary" name="submit" value="{{$submit}}" data-loading-text="{{$loading}}">{{$submit}}</button>
-       </p>
-</form>
index 862871dca9bea7a822be7decdd8753279da58de4..563a5a248e25e1989fbf1decf4192598231141c9 100644 (file)
 
                        </div>
                        <div class="hover-card-actions  right-aligned">
-                               {{* 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 *}}
                                <div class="hover-card-actions-social">
                                        {{if $profile.actions.pm}}<a class="btn btn-labeled btn-primary btn-sm add-to-modal" href="{{$profile.actions.pm.1}}" aria-label="{{$profile.actions.pm.0}}"><i class="fa fa-envelope" aria-hidden="true" title="{{$profile.actions.pm.0}}"></i><span class="sr-only">{{$profile.actions.pm.0}}</span></a>{{/if}}
-                                       {{if $profile.actions.poke}}<a class="btn btn-labeled btn-primary btn-sm add-to-modal" href="{{$profile.actions.poke.1}}" aria-label="{{$profile.actions.poke.0}}"><i class="fa fa-heartbeat" aria-hidden="true" title="{{$profile.actions.poke.0}}"></i><span class="sr-only">{{$profile.actions.poke.0}}</span></a>{{/if}}
                                </div>
                                <div class="hover-card-actions-connection">
                                        {{if $profile.actions.network}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.network.1}}" aria-label="{{$profile.actions.network.0}}" title="{{$profile.actions.network.0}}"><i class="fa fa-cloud" aria-hidden="true"></i></a>{{/if}}
index d369583d36030e75dade0b365f85d2059d05abac..8e9f80dc39cf77edbceb940f0141bd8310b46c5d 100644 (file)
                                {{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}}
                        </div>
 
                        <div id="settings-notify-desc">{{$lbl_notify}}</div>
index 6fdcd3d241307277260d906aaf7ad74778665c8c..edd7282f792e06bc5bae83e76f77292aceac3ea5 100644 (file)
@@ -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();
        }
index c0f84ac2908c2be5a8852705854eff627ec4b97a..70111ab3b8d50c72744245b1bb6743e6a31d5014 100644 (file)
@@ -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;
index f72a4900fff38d430b31cb157335104594497554..0cd55f8d3e40535a1136220823584b84b9812e27 100644 (file)
                                        <i class="fa fa-envelope" aria-hidden="true"></i>
                                </button>
                                {{/if}}
-                               {{if $contact.photo_menu.poke}}
-                               <button type="button" class="contact-action-link btn-link" onclick="addToModal('{{$contact.photo_menu.poke.1}}'); return false;" data-toggle="tooltip" title="{{$contact.photo_menu.poke.0}}">
-                                       <i class="fa fa-heartbeat" aria-hidden="true"></i>
-                               </button>
-                               {{/if}}
                                {{if $contact.photo_menu.network}}
                                <a class="contact-action-link btn-link" href="{{$contact.photo_menu.network.1}}" data-toggle="tooltip" title="{{$contact.photo_menu.network.0}}">
                                        <i class="fa fa-cloud" aria-hidden="true"></i>
@@ -178,11 +173,6 @@ We use this part to filter the contacts with jquery.textcomplete *}}
                                        <i class="fa fa-envelope" aria-hidden="true"></i>
                                </button>
                                {/if}
-                               {if $photo_menu.poke}
-                               <button type="button" class="contact-action-link btn-link" onclick="addToModal('{$photo_menu.poke.1}')" data-toggle="tooltip" title="{$photo_menu.poke.0}">
-                                       <i class="fa fa-heartbeat" aria-hidden="true"></i>
-                               </button>
-                               {/if}
                                {if $photo_menu.network}
                                <a class="contact-action-link btn-link" href="{$photo_menu.network.1}" data-toggle="tooltip" title="{$photo_menu.network.0}">
                                        <i class="fa fa-cloud" aria-hidden="true"></i>
diff --git a/view/theme/frio/templates/poke_content.tpl b/view/theme/frio/templates/poke_content.tpl
deleted file mode 100644 (file)
index b015c44..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-
-<div id="poke-wrapper">
-
-       <h3 class="heading">{{$title}}</h3>
-       <div id="poke-desc">{{$desc nofilter}}</div>
-
-       <form id="poke-form" action="poke" method="get">
-
-               <div id="poke-content-wrapper">
-
-                       {{* The input field with the recipient name*}}
-                       <div id="poke-recip-wrapper" class="form-group">
-                               <label for="poke-recip">{{$clabel}}</label>
-                               <input id="poke-recip" class="form-control" type="text" size="64" maxlength="255" value="{{$name}}" name="pokename" autocomplete="off" />
-                               <input id="poke-recip-complete" type="hidden" value="{{$id}}" name="cid" />
-                               <input id="poke-parent" type="hidden" value="{{$parent}}" name="parent" />
-                       </div>
-
-                       {{* The drop-down list with different actions *}}
-                       <div id="poke-action-wrapper" class="form-group">
-                               <label for="poke-verb-select">{{$choice}}</label>
-                               <select name="verb" id="poke-verb-select" class="form-control">
-                               {{foreach $verbs as $v}}
-                               <option value="{{$v.0}}">{{$v.1}}</option>
-                               {{/foreach}}
-                               </select>
-                       </div>
-
-                       {{* The checkbox to select if the "poke message" should be private *}}
-                       <div id="poke-private-desc" class="checkbox">
-                               <input type="checkbox" id=poke-private-desc-checkbox" name="private" {{if $parent}}disabled="disabled"{{/if}} value="1" />
-                               <label for="poke-private-desc-checkbox">{{$prv_desc}}</label>
-                       </div>
-
-               </div>
-
-               <div id="poke-content-wrapper-end"></div>
-
-               <div id="poke-submit-wrapper">
-                       <button class="btn btn-primary pull-right" type="submit" name="submit" value="{{$submit}}"><i class="fa fa-slideshare"></i>&nbsp;{{$submit}}</button>
-               </div>
-
-               <div id="poke-submit-wrapper-end"></div>
-
-       </form>
-       <div id="poke-wrapper-end"></div>
-
-</div>
index a24bf5dd4f88b273b369a64e2e7c311ab36baff5..82f25863c2a4d1f980ff361c4fe2ee4408b8a951 100644 (file)
                                                        {{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}}
                                                </div>
 
                                                <div id="settings-notify-desc">{{$lbl_notify}}</div>
index f446f3b17197bb86dce8e33a82fa682ca7128dbb..4254a99048dcb9d72e084fd43965f2a3c8c345e8 100644 (file)
@@ -1,10 +1,26 @@
 <?php
-/*
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  * 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 <a href="https://github.com/friendica/friendica/tree/develop/view/theme/frio/README.md">ReadMe</a>.
  * Version: V.0.8.5
  * Author: Rabuzarus <https://friendica.kommune4.de/profile/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';
        }
index 7698b0d3d35e489c0ca0553833856ce61c1b7c06..3489de03184d633240bf8eae5c020e7145febc2a 100644 (file)
@@ -2721,13 +2721,6 @@ margin-left: 0px;
        border: 1px solid #7C7D7B;
 }
 
-/* ========== */
-/* = Poke = */
-/* ========== */
-#poke-recip {
-       float: none;
-}
-
 /* ================= */
 /* = Notifications = */
 /* ================= */