]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #7233 from nupplaphil/bug/installer_replace_macro
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 7 Jun 2019 00:37:11 +0000 (20:37 -0400)
committerGitHub <noreply@github.com>
Fri, 7 Jun 2019 00:37:11 +0000 (20:37 -0400)
Fixing Installer - ReplaceMacro

composer.lock
mod/item.php
src/Model/Item.php
src/Protocol/Diaspora.php
src/Worker/APDelivery.php
src/Worker/Delivery.php
src/Worker/Notifier.php
view/js/main.js
view/templates/hovercard.tpl
view/theme/frio/js/modal.js

index de76b4589a3e8e290afeb6fee21eb890596b82fb..75c10b78f026eaea9b8c83d3a73c828ff90932e7 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "350fdeacf9fcc039538e00a9a943f6d6",
+    "content-hash": "67821d2270bdf8cdd24e7a047b9544e7",
     "packages": [
         {
             "name": "asika/simple-console",
             "version": "v1.6.5",
             "source": {
                 "type": "git",
-                "url": "https://github.com/bovigo/vfsStream.git",
+                "url": "https://github.com/mikey179/vfsStream.git",
                 "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145",
+                "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145",
                 "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145",
                 "shasum": ""
             },
                 }
             ],
             "description": "Provides the functionality to compare PHP values for equality",
-            "homepage": "https://github.com/sebastianbergmann/comparator",
+            "homepage": "http://www.github.com/sebastianbergmann/comparator",
             "keywords": [
                 "comparator",
                 "compare",
                 }
             ],
             "description": "Provides functionality to handle HHVM/PHP environments",
-            "homepage": "https://github.com/sebastianbergmann/environment",
+            "homepage": "http://www.github.com/sebastianbergmann/environment",
             "keywords": [
                 "Xdebug",
                 "environment",
                 }
             ],
             "description": "Provides the functionality to export PHP variables for visualization",
-            "homepage": "https://github.com/sebastianbergmann/exporter",
+            "homepage": "http://www.github.com/sebastianbergmann/exporter",
             "keywords": [
                 "export",
                 "exporter"
                 }
             ],
             "description": "Snapshotting of global state",
-            "homepage": "https://github.com/sebastianbergmann/global-state",
+            "homepage": "http://www.github.com/sebastianbergmann/global-state",
             "keywords": [
                 "global state"
             ],
                 }
             ],
             "description": "Provides functionality to recursively process PHP variables",
-            "homepage": "https://github.com/sebastianbergmann/recursion-context",
+            "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
             "time": "2016-11-19T07:33:16+00:00"
         },
         {
                 },
                 {
                     "name": "Gert de Pagter",
-                    "email": "BackEndTea@gmail.com"
+                    "email": "backendtea@gmail.com"
                 }
             ],
             "description": "Symfony polyfill for ctype functions",
index b064bbce8e8a318d591ed5830754fd8b39027612..1fccbca4d6b85fa072729b6bad8005027998c26d 100644 (file)
@@ -40,6 +40,7 @@ use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Emailer;
 use Friendica\Util\Security;
 use Friendica\Util\Strings;
+use Friendica\Worker\Delivery;
 
 require_once 'include/items.php';
 
@@ -603,7 +604,7 @@ function item_post(App $a) {
                $origin = $_REQUEST['origin'];
        }
 
-       $notify_type = ($toplevel_item_id ? 'comment-new' : 'wall-new');
+       $notify_type = ($toplevel_item_id ? Delivery::COMMENT : Delivery::POST);
 
        $uri = ($message_id ? $message_id : Item::newURI($api_source ? $profile_uid : $uid, $guid));
 
index 8ae412cd0a7d2fa7f1f416e76b424d36680ec01b..e57b3cbd3c740649234a4c11fc12373da26822bb 100644 (file)
@@ -28,6 +28,7 @@ use Friendica\Util\Network;
 use Friendica\Util\Security;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
+use Friendica\Worker\Delivery;
 use Text_LanguageDetect;
 
 class Item extends BaseObject
@@ -1521,7 +1522,7 @@ class Item extends BaseObject
                        $allow_gid = $item['allow_gid'];
                        $deny_cid  = $item['deny_cid'];
                        $deny_gid  = $item['deny_gid'];
-                       $notify_type = 'wall-new';
+                       $notify_type = Delivery::POST;
                } else {
                        // find the parent and snarf the item id and ACLs
                        // and anything else we need to inherit
@@ -1558,8 +1559,8 @@ class Item extends BaseObject
                                $allow_gid      = $parent['allow_gid'];
                                $deny_cid       = $parent['deny_cid'];
                                $deny_gid       = $parent['deny_gid'];
-                               $item['wall']    = $parent['wall'];
-                               $notify_type    = 'comment-new';
+                               $item['wall']   = $parent['wall'];
+                               $notify_type    = Delivery::COMMENT;
 
                                /*
                                 * If the parent is private, force privacy for the entire conversation
@@ -1603,6 +1604,10 @@ class Item extends BaseObject
                        }
                }
 
+               if (stristr($item['verb'], ACTIVITY_POKE)) {
+                       $notify_type = Delivery::POKE;
+               }
+
                $item['parent-uri-id'] = ItemURI::getIdByURI($item['parent-uri']);
                $item['thr-parent-id'] = ItemURI::getIdByURI($item['thr-parent']);
 
@@ -1881,11 +1886,13 @@ class Item extends BaseObject
                        Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $notify_type, $current_post);
                } elseif ($item['visible'] && ((!empty($parent) && $parent['origin']) || $item['origin'])) {
                        if ($item['gravity'] == GRAVITY_ACTIVITY) {
-                               $cmd = $item['origin'] ? 'activity-new' : 'activity-import';
+                               $cmd = $item['origin'] ? Delivery::ACTIVITY : 'activity-import';
                        } elseif ($item['gravity'] == GRAVITY_COMMENT) {
-                               $cmd = $item['origin'] ? 'comment-new' : 'comment-import';
+                               $cmd = $item['origin'] ? Delivery::COMMENT : 'comment-import';
+                       } elseif (!empty($notify_type)) {
+                               $cmd = $notify_type;
                        } else {
-                               $cmd = 'wall-new';
+                               $cmd = Delivery::POST;
                        }
 
                        Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $cmd, $current_post);
index e341de208033148971c7cb2e86246277ccc7cff3..ac1cf9c38d469793b7d7179de1cca1a0707167b0 100644 (file)
@@ -37,6 +37,7 @@ use Friendica\Util\Map;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
+use Friendica\Worker\Delivery;
 use SimpleXMLElement;
 
 /**
@@ -2148,9 +2149,9 @@ class Diaspora
                                continue;
                        }
                        if ($comment['verb'] == ACTIVITY_POST) {
-                               $cmd = $comment['self'] ? 'comment-new' : 'comment-import';
+                               $cmd = $comment['self'] ? Delivery::COMMENT : 'comment-import';
                        } else {
-                               $cmd = $comment['self'] ? 'like' : 'comment-import';
+                               $cmd = $comment['self'] ? Delivery::ACTIVITY : 'activity-import';
                        }
                        Logger::log("Send ".$cmd." for item ".$comment['id']." to contact ".$contact_id, Logger::DEBUG);
                        Worker::add(PRIORITY_HIGH, 'Delivery', $cmd, $comment['id'], $contact_id);
index 25c1dfb71929a7269166b61c035ad05b248b0282..632f6cffc5dae09736391dafa11befa0ae6d7993 100644 (file)
@@ -37,6 +37,9 @@ class APDelivery extends BaseObject
                } elseif ($cmd == Delivery::SUGGESTION) {
                        $success = ActivityPub\Transmitter::sendContactSuggestion($uid, $inbox, $target_id);
                } elseif ($cmd == Delivery::RELOCATION) {
+                       // @todo Implementation pending
+               } elseif ($cmd == Delivery::POKE) {
+                       // Implementation not planned
                } elseif ($cmd == Delivery::REMOVAL) {
                        $success = ActivityPub\Transmitter::sendProfileDeletion($uid, $inbox);
                } elseif ($cmd == Delivery::PROFILEUPDATE) {
index 6cd824365175ee8b0b52d95cc09f61010e2dd2eb..97bc58ef67411fd52345cd85e74790c7105798d2 100644 (file)
@@ -26,7 +26,9 @@ class Delivery extends BaseObject
        const RELOCATION    = 'relocate';
        const DELETION      = 'drop';
        const POST          = 'wall-new';
+       const POKE          = 'poke';
        const COMMENT       = 'comment-new';
+       const ACTIVITY      = 'activity-new';
        const REMOVAL       = 'removeme';
        const PROFILEUPDATE = 'profileupdate';
 
index 5094734808ca39cdca395792bac12e12206641cc..c2f61c55a426325ef97734ee1ae39d1bade45e0d 100644 (file)
@@ -442,7 +442,7 @@ class Notifier
                                        }
 
                                        if (in_array($rr['network'], [Protocol::DFRN, Protocol::DIASPORA]) && ($rr['protocol'] == Protocol::ACTIVITYPUB) &&
-                                               !in_array($cmd, [Delivery::SUGGESTION, Delivery::REMOVAL, Delivery::RELOCATION])) {
+                                               !in_array($cmd, [Delivery::SUGGESTION, Delivery::REMOVAL, Delivery::RELOCATION, Delivery::POKE])) {
                                                Logger::info('Contact is Friendica AP, so skipping delivery via legacy DFRN', ['url' => $rr['url']]);
                                                continue;
                                        }
@@ -482,7 +482,7 @@ class Notifier
                        }
 
                        if (in_array($contact['network'], [Protocol::DFRN, Protocol::DIASPORA]) && ($contact['protocol'] == Protocol::ACTIVITYPUB) &&
-                               !in_array($cmd, [Delivery::SUGGESTION, Delivery::REMOVAL, Delivery::RELOCATION])) {
+                               !in_array($cmd, [Delivery::SUGGESTION, Delivery::REMOVAL, Delivery::RELOCATION, Delivery::POKE])) {
                                Logger::info('Contact is Friendica AP, so skipping delivery via legacy DFRN', ['url' => $contact['url']]);
                                continue;
                        }
index cd09de014376e36a946c1c790ad867abcab50082..a2e2698a821730dd81653f97781294bd21143dd2 100644 (file)
@@ -1,4 +1,21 @@
 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
+
+// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
+if (!Element.prototype.matches) {
+       Element.prototype.matches =
+               Element.prototype.matchesSelector ||
+               Element.prototype.mozMatchesSelector ||
+               Element.prototype.msMatchesSelector ||
+               Element.prototype.oMatchesSelector ||
+               Element.prototype.webkitMatchesSelector ||
+               function(s) {
+                       var matches = (this.document || this.ownerDocument).querySelectorAll(s),
+                               i = matches.length;
+                       while (--i >= 0 && matches.item(i) !== this) {}
+                       return i > -1;
+               };
+}
+
 function resizeIframe(obj) {
        _resizeIframe(obj, 0);
 }
index a688f57b202c1a25c16f21d868a24722e73f971b..017e096afc561b89c5bb77aaecb89b6fc4c22b09 100644 (file)
@@ -21,8 +21,8 @@
                                {{* here are the differnt actions like privat message, poke, 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" onclick="addToModal('{{$profile.actions.pm.1}}')" aria-label="{{$profile.actions.pm.0}}" title="{{$profile.actions.pm.0}}"><i class="fa fa-envelope" aria-hidden="true"></i></a>{{/if}}
-                                       {{if $profile.actions.poke}}<a class="btn btn-labeled btn-primary btn-sm" onclick="addToModal('{{$profile.actions.poke.1}}')" aria-label="{{$profile.actions.poke.0}}" title="{{$profile.actions.poke.0}}"><i class="fa fa-heartbeat" aria-hidden="true"></i></a>{{/if}}
+                                       {{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 ab263bc2ab76cb19082e7990b0d710fb56096fa4..9bca427779fcbc057e05aa5b81e4c84ea863d74e 100644 (file)
@@ -93,6 +93,21 @@ $(document).ready(function(){
                input.val(img);
                
        });
+
+       // Generic delegated event to open an anchor URL in a modal.
+       // Used in the hovercard.
+       document.getElementsByTagName('body')[0].addEventListener('click', function(e) {
+               var target = e.target;
+               while (target) {
+                       if (target.matches && target.matches('a.add-to-modal')) {
+                               addToModal(target.href);
+                               e.preventDefault();
+                               return false;
+                       }
+
+                       target = target.parentNode || null;
+               }
+       });
 });
 
 // Overwrite Dialog.show from main js to load the filebrowser into a bs modal.