ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [incubator-ponymail] branch master updated: Also look for references: header when threading
Date Tue, 03 Apr 2018 10:23:46 GMT
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 5618877  Also look for references: header when threading
5618877 is described below

commit 5618877c99b4a21aafe426161c15778432562376
Author: Daniel Gruno <humbedooh@apache.org>
AuthorDate: Tue Apr 3 12:23:23 2018 +0200

    Also look for references: header when threading
    
    Thsi fixes #444.
---
 CHANGELOG.md        | 1 +
 site/api/thread.lua | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62f5479..eb756ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
 - Bug: does not make sense to allow empty domain name in LID (#434)
 - Bug: Inconsistent LID validation (#356)
 - Enh: option to reduce stats.lua output (#438)
+- Bug: Threading should take References header into account (#444)
 
 ## CHANGES in 0.10:
 - Bug: Use correct dependency order to fix OAuth login problem (#431)
diff --git a/site/api/thread.lua b/site/api/thread.lua
index e7be4f7..bf67f70 100644
--- a/site/api/thread.lua
+++ b/site/api/thread.lua
@@ -39,7 +39,8 @@ local function fetchChildren(r, pdoc, c, biglist, account)
     biglist = biglist or {}
     local children = {}
     -- find any emails that reference this one
-    local docs = elastic.findFast('in-reply-to:"' .. r:escape(pdoc['message-id'])..'"', 50,
"mbox")
+    local emid = r:escape(pdoc['message-id'])
+    local docs = elastic.findFast( ('in-reply-to:"%s" OR references:"%s"'):format(emid, emid),
50, "mbox")
     for k, doc in pairs(docs) do
         -- if we haven't seen this email before, check for its kids and add it to the bunch
         if (not biglist[doc['message-id']]) and aaa.canAccessDoc(r, doc, account) then
@@ -121,4 +122,4 @@ function handle(r)
     return cross.OK
 end
 
-cross.start(handle)
\ No newline at end of file
+cross.start(handle)

-- 
To stop receiving notification emails like this one, please contact
humbedooh@apache.org.

Mime
View raw message