]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_notify.php
Issue 8605: "show less" now displays "show less"
[friendica.git] / mod / dfrn_notify.php
index 8c00ace7231e67b2ba994787c8ea2f04c44ff4c6..33953c6a284b3253cef2901d09b595ee1f950622 100644 (file)
@@ -1,17 +1,34 @@
 <?php
-
 /**
- * @file mod/dfrn_notify.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @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/>.
+ *
  * The dfrn notify endpoint
- * @see PDF with dfrn specs: https://github.com/friendica/friendica/blob/master/spec/dfrn2.pdf
+ *
+ * @see PDF with dfrn specs: https://github.com/friendica/friendica/blob/stable/spec/dfrn2.pdf
  */
 
 use Friendica\App;
-use Friendica\Core\Config;
 use Friendica\Core\Logger;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
+use Friendica\Model\Conversation;
 use Friendica\Model\User;
 use Friendica\Protocol\DFRN;
 use Friendica\Protocol\Diaspora;
@@ -128,7 +145,7 @@ function dfrn_notify_post(App $a) {
                System::xmlExit(0, 'relationship dissolved');
        }
 
-       $rino = Config::get('system', 'rino_encrypt');
+       $rino = DI::config()->get('system', 'rino_encrypt');
        $rino = intval($rino);
 
        if (strlen($key)) {
@@ -176,7 +193,7 @@ function dfrn_notify_post(App $a) {
 
        Logger::log('Importing post from ' . $importer['addr'] . ' to ' . $importer['nickname'] . ' with the RINO ' . $rino_remote . ' encryption.', Logger::DEBUG);
 
-       $ret = DFRN::import($data, $importer);
+       $ret = DFRN::import($data, $importer, false, Conversation::PARCEL_LEGACY_DFRN);
        System::xmlExit($ret, 'Processed');
 
        // NOTREACHED
@@ -208,7 +225,7 @@ function dfrn_dispatch_public($postdata)
        Logger::log('Importing post from ' . $msg['author'] . ' with the public envelope.', Logger::DEBUG);
 
        // Now we should be able to import it
-       $ret = DFRN::import($msg['message'], $importer);
+       $ret = DFRN::import($msg['message'], $importer, false, Conversation::PARCEL_DIASPORA_DFRN);
        System::xmlExit($ret, 'Done');
 }
 
@@ -241,7 +258,7 @@ function dfrn_dispatch_private($user, $postdata)
        Logger::log('Importing post from ' . $msg['author'] . ' to ' . $user['nickname'] . ' with the private envelope.', Logger::DEBUG);
 
        // Now we should be able to import it
-       $ret = DFRN::import($msg['message'], $importer);
+       $ret = DFRN::import($msg['message'], $importer, false, Conversation::PARCEL_DIASPORA_DFRN);
        System::xmlExit($ret, 'Done');
 }
 
@@ -343,7 +360,7 @@ function dfrn_notify_content(App $a) {
                $encrypted_id = bin2hex($encrypted_id);
 
 
-               $rino = Config::get('system', 'rino_encrypt');
+               $rino = DI::config()->get('system', 'rino_encrypt');
                $rino = intval($rino);
 
                Logger::log("Local rino version: ". $rino, Logger::DATA);