We now set the protocol in "gserver" on receiving as well
[friendica.git/.git] / src / Protocol / Diaspora.php
index 950e8dc..c33896c 100644 (file)
@@ -35,6 +35,7 @@ use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Conversation;
 use Friendica\Model\FContact;
+use Friendica\Model\GServer;
 use Friendica\Model\Item;
 use Friendica\Model\ItemURI;
 use Friendica\Model\Mail;
@@ -1498,6 +1499,10 @@ class Diaspora
                        return false;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setProtocol($contact['gsid'], Post\DeliveryData::DIASPORA);
+               }
+
                $message_id = self::messageExists($importer["uid"], $guid);
                if ($message_id) {
                        return true;
@@ -1682,6 +1687,10 @@ class Diaspora
                        return false;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setProtocol($contact['gsid'], Post\DeliveryData::DIASPORA);
+               }
+
                $conversation = DBA::selectFirst('conv', [], ['uid' => $importer["uid"], 'guid' => $guid]);
                if (!DBA::isResult($conversation)) {
                        $r = q(
@@ -1741,6 +1750,10 @@ class Diaspora
                        return false;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setProtocol($contact['gsid'], Post\DeliveryData::DIASPORA);
+               }
+
                $message_id = self::messageExists($importer["uid"], $guid);
                if ($message_id) {
                        return true;
@@ -1851,6 +1864,10 @@ class Diaspora
                        return false;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setProtocol($contact['gsid'], Post\DeliveryData::DIASPORA);
+               }
+
                $conversation = null;
 
                $condition = ['uid' => $importer["uid"], 'guid' => $conversation_guid];
@@ -1911,6 +1928,10 @@ class Diaspora
                        return false;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setProtocol($contact['gsid'], Post\DeliveryData::DIASPORA);
+               }
+
                if (self::messageExists($importer["uid"], $guid)) {
                        return true;
                }
@@ -2407,6 +2428,10 @@ class Diaspora
                        return false;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setProtocol($contact['gsid'], Post\DeliveryData::DIASPORA);
+               }
+
                $message_id = self::messageExists($importer["uid"], $guid);
                if ($message_id) {
                        return true;
@@ -2679,6 +2704,10 @@ class Diaspora
                        return false;
                }
 
+               if (!empty($contact['gsid'])) {
+                       GServer::setProtocol($contact['gsid'], Post\DeliveryData::DIASPORA);
+               }
+
                $message_id = self::messageExists($importer["uid"], $guid);
                if ($message_id) {
                        return true;