]> git.mxchange.org Git - friendica.git/commitdiff
Mails shouldn't be duplicated anymore when sending
authorMichael <heluecht@pirati.ca>
Sun, 7 May 2017 17:11:09 +0000 (17:11 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 7 May 2017 17:11:09 +0000 (17:11 +0000)
include/diaspora.php

index 0c3ff68da46c0cba78f7123149da574ee82ee1ec..69a2e9e572a864ccbf72e2f74afdbe8165c5a31f 100644 (file)
@@ -1516,8 +1516,9 @@ class Diaspora {
 
                $person = self::person_by_handle($msg_author);
 
-               $r = q("SELECT `id` FROM `mail` WHERE `uri` = '%s' LIMIT 1",
-                       dbesc($message_uri)
+               $r = q("SELECT `id` FROM `mail` WHERE `guid` = '%s' AND `uid` = %d LIMIT 1",
+                       dbesc($msg_guid),
+                       intval($importer["uid"])
                );
                if (dbm::is_result($r)) {
                        logger("duplicate message already delivered.", LOGGER_DEBUG);
@@ -1813,8 +1814,8 @@ class Diaspora {
                        return false;
                }
 
-               $r = q("SELECT `id` FROM `mail` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
-                       dbesc($message_uri),
+               $r = q("SELECT `id` FROM `mail` WHERE `guid` = '%s' AND `uid` = %d LIMIT 1",
+                       dbesc($guid),
                        intval($importer["uid"])
                );
                if (dbm::is_result($r)) {