Mails shouldn't be duplicated anymore when sending

This commit is contained in:
Michael 2017-05-07 17:11:09 +00:00
parent c52b2f392f
commit 824141d3e5

View file

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