From 824141d3e508d971651e3786466bc91fe5224f95 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 7 May 2017 17:11:09 +0000 Subject: [PATCH] Mails shouldn't be duplicated anymore when sending --- include/diaspora.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/diaspora.php b/include/diaspora.php index 0c3ff68da4..69a2e9e572 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -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)) { -- 2.39.5