]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #6470 from rabuzarus/20190118_-_some_more_magic_links
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 19 Jan 2019 15:06:35 +0000 (10:06 -0500)
committerGitHub <noreply@github.com>
Sat, 19 Jan 2019 15:06:35 +0000 (10:06 -0500)
use magic links for common/all friends and the directory

index.php
src/App.php
src/Worker/Notifier.php
view/theme/vier/theme.php

index efcfe439246d5187c542b3a42f8263788bdd3f6d..16fc2e0d084482fb3ea0c66263516c0dde50a6ff 100644 (file)
--- a/index.php
+++ b/index.php
@@ -4,6 +4,10 @@
  * Friendica
  */
 
+if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
+       die('Vendor path not found. Please execute "bin/composer.phar --no-dev install" on the command line in the web root.');
+}
+
 require __DIR__ . '/vendor/autoload.php';
 
 // We assume that the index.php is called by a frontend process
index ac513b531aaf2605782ec04fc330cc2aae8338a2..26c93b250029d9509168fbad703607775b92d083 100644 (file)
@@ -1720,6 +1720,12 @@ class App
 
                $content = '';
 
+               // Load current theme info after module has been executed as theme could have been set in module
+               $theme_info_file = 'view/theme/' . $this->getCurrentTheme() . '/theme.php';
+               if (file_exists($theme_info_file)) {
+                       require_once $theme_info_file;
+               }
+
                // Call module functions
                if ($this->module_loaded) {
                        $this->page['page_title'] = $this->module;
@@ -1760,12 +1766,6 @@ class App
                        }
                }
 
-               // Load current theme info after module has been executed as theme could have been set in module
-               $theme_info_file = 'view/theme/' . $this->getCurrentTheme() . '/theme.php';
-               if (file_exists($theme_info_file)) {
-                       require_once $theme_info_file;
-               }
-
                // initialise content region
                if ($this->getMode()->isNormal()) {
                        Core\Addon::callHooks('page_content_top', $this->page['content']);
index e78920baedfddd63c6033bb5d92103df97fb1c09..fa0de8fb5ea883bd2fd15b11b1e9d5598640e084 100644 (file)
@@ -436,8 +436,9 @@ class Notifier
                                // The function will ensure that there are no duplicates
                                $r1 = Diaspora::participantsForThread($item_id, $r1);
 
-                               // Add the relay to the list, avoid duplicates
-                               if (!$followup) {
+                               // Add the relay to the list, avoid duplicates.
+                               // Don't send community posts to the relay. Forum posts via the Diaspora protocol are looking ugly.
+                               if (!$followup && !self::isForumPost($target_item, $owner)) {
                                        $r1 = Diaspora::relayList($item_id, $r1);
                                }
                        }
@@ -453,8 +454,16 @@ class Notifier
                                foreach ($r as $rr) {
                                        $conversants[] = $rr['id'];
                                        Logger::log('Public delivery of item ' . $target_item["guid"] . ' (' . $item_id . ') to ' . json_encode($rr), Logger::DEBUG);
-                                       Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
-                                               'Delivery', $cmd, $item_id, (int)$rr['id']);
+
+                                       // Ensure that posts with our own protocol arrives before Diaspora posts arrive.
+                                       // Situation is that sometimes Friendica servers receive Friendica posts over the Diaspora protocol first.
+                                       // The conversion in Markdown reduces the formatting, so these posts should arrive after the Friendica posts.
+                                       if ($rr['network'] == Protocol::DIASPORA) {
+                                               $deliver_options = ['priority' => $a->queue['priority'], 'dont_fork' => true];
+                                       } else {
+                                               $deliver_options = ['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true];
+                                       }
+                                       Worker::add($deliver_options, 'Delivery', $cmd, $item_id, (int)$rr['id']);
                                }
                        }
 
@@ -477,8 +486,16 @@ class Notifier
                                }
 
                                Logger::log('Delivery of item ' . $item_id . ' to ' . json_encode($contact), Logger::DEBUG);
-                               Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
-                                               'Delivery', $cmd, $item_id, (int)$contact['id']);
+
+                               // Ensure that posts with our own protocol arrives before Diaspora posts arrive.
+                               // Situation is that sometimes Friendica servers receive Friendica posts over the Diaspora protocol first.
+                               // The conversion in Markdown reduces the formatting, so these posts should arrive after the Friendica posts.
+                               if ($contact['network'] == Protocol::DIASPORA) {
+                                       $deliver_options = ['priority' => $a->queue['priority'], 'dont_fork' => true];
+                               } else {
+                                       $deliver_options = ['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true];
+                               }
+                               Worker::add($deliver_options, 'Delivery', $cmd, $item_id, (int)$contact['id']);
                        }
                }
 
index b9684ad8754ba7906a55be4c63fc7f6935b41d06..41553cf8c4aa765795bf81d5c98dbfd48d8d1175 100644 (file)
@@ -313,10 +313,6 @@ function vier_community_info()
                /// @TODO This whole thing is hard-coded, better rewrite to Intercepting Filter Pattern (future-todo)
                $r = [];
 
-               if (Addon::isEnabled("appnet")) {
-                       $r[] = ["photo" => "images/appnet.png", "name" => "App.net"];
-               }
-
                if (Addon::isEnabled("buffer")) {
                        $r[] = ["photo" => "images/buffer.png", "name" => "Buffer"];
                }
@@ -329,10 +325,6 @@ function vier_community_info()
                        $r[] = ["photo" => "images/dreamwidth.png", "name" => "Dreamwidth"];
                }
 
-               if (Addon::isEnabled("fbpost")) {
-                       $r[] = ["photo" => "images/facebook.png", "name" => "Facebook"];
-               }
-
                if (Addon::isEnabled("ifttt")) {
                        $r[] = ["photo" => "addon/ifttt/ifttt.png", "name" => "IFTTT"];
                }
@@ -341,10 +333,6 @@ function vier_community_info()
                        $r[] = ["photo" => "images/gnusocial.png", "name" => "GNU Social"];
                }
 
-               if (Addon::isEnabled("gpluspost")) {
-                       $r[] = ["photo" => "images/googleplus.png", "name" => "Google+"];
-               }
-
                /// @TODO old-lost code (and below)?
                //if (Addon::isEnabled("ijpost")) {
                //      $r[] = array("photo" => "images/", "name" => "");