]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Mail.php
Restore the behaviour to remove the remote contact upon termination
[friendica.git] / src / Model / Mail.php
index 37ebd123aa46082abf5fc297ea95950c20870e2f..24a174b6b58251df7c5dd674c4ad75d207c50b46 100644 (file)
@@ -56,13 +56,11 @@ class Mail
 
                if (strlen($replyto)) {
                        $reply = true;
-                       $r = q("SELECT `convid` FROM `mail` WHERE `uid` = %d AND (`uri` = '%s' OR `parent-uri` = '%s') LIMIT 1",
-                               intval(local_user()),
-                               DBA::escape($replyto),
-                               DBA::escape($replyto)
-                       );
-                       if (DBA::isResult($r)) {
-                               $convid = $r[0]['convid'];
+                       $condition = ["`uid` = ? AND (`uri` = ? OR `parent-uri` = ?)",
+                               local_user(), $replyto, $replyto];
+                       $mail = DBA::selectFirst('mail', ['convid'], $condition);
+                       if (DBA::isResult($mail)) {
+                               $convid = $mail['convid'];
                        }
                }