From commits-return-1032-archive-asf-public=cust-asf.ponee.io@ponymail.incubator.apache.org Fri Mar 2 21:09:39 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1AC6618062F for ; Fri, 2 Mar 2018 21:09:38 +0100 (CET) Received: (qmail 58063 invoked by uid 500); 2 Mar 2018 20:09:38 -0000 Mailing-List: contact commits-help@ponymail.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ponymail.incubator.apache.org Delivered-To: mailing list commits@ponymail.incubator.apache.org Received: (qmail 58054 invoked by uid 99); 2 Mar 2018 20:09:38 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2018 20:09:38 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 8A9CA8287A; Fri, 2 Mar 2018 20:09:37 +0000 (UTC) Date: Fri, 02 Mar 2018 20:09:37 +0000 To: "commits@ponymail.apache.org" Subject: [incubator-ponymail] branch master updated: duplication of data in response from thread.lua MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <152002137751.20254.7170036090813650120@gitbox.apache.org> From: sebb@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-ponymail X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 9c3d65682d84cb970693d6ebaf88e0aa43d08053 X-Git-Newrev: a105f9a3adfc1707574e4265356637dd96d0ef98 X-Git-Rev: a105f9a3adfc1707574e4265356637dd96d0ef98 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. sebb 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 a105f9a duplication of data in response from thread.lua a105f9a is described below commit a105f9a3adfc1707574e4265356637dd96d0ef98 Author: Sebb AuthorDate: Fri Mar 2 20:09:35 2018 +0000 duplication of data in response from thread.lua This fixes #440 --- CHANGELOG.md | 1 + site/api/thread.lua | 1 - site/js/dev/ponymail_email_displays.js | 4 ++-- site/js/dev/ponymail_timetravel.js | 18 +++++++++--------- site/js/ponymail.js | 22 +++++++++++----------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c18abbe..d5dac29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Changes in 0.11-SNAPSHOT +- Bug: duplication of data in response from thread.lua (#440) - Bug: Indentation in mail content (leading white-space) not shown (#432) - Bug: does not make sense to allow empty domain name in LID (#434) - Bug: Inconsistent LID validation (#356) diff --git a/site/api/thread.lua b/site/api/thread.lua index b32db2b..e7be4f7 100644 --- a/site/api/thread.lua +++ b/site/api/thread.lua @@ -112,7 +112,6 @@ function handle(r) --doc.body = nil r:puts(JSON.encode({ took = DEBUG and (r:clock() - START) or nil, - thread = doc, emails = emls_thrd, })) return cross.OK diff --git a/site/js/dev/ponymail_email_displays.js b/site/js/dev/ponymail_email_displays.js index f0b2db1..313ffe1 100644 --- a/site/js/dev/ponymail_email_displays.js +++ b/site/js/dev/ponymail_email_displays.js @@ -462,8 +462,8 @@ function highlightNewEmails(id) { } function displaySingleThread(json) { - if (json && json.thread) { - current_thread_json = [json.thread] + if (json && json.emails[0]) { + current_thread_json = [json.emails[0]] current_flat_json = json.emails } var thread = document.getElementById('thread_0') diff --git a/site/js/dev/ponymail_timetravel.js b/site/js/dev/ponymail_timetravel.js index a2ca405..e30f536 100644 --- a/site/js/dev/ponymail_timetravel.js +++ b/site/js/dev/ponymail_timetravel.js @@ -18,8 +18,8 @@ // simple func that just redirects to the original thread URL we just got if possible function timeTravelSingleThreadRedirect(json) { - if (json && json.thread) { - location.href = URL_BASE + "/thread.html/" + (pm_config.shortLinks ? shortenID(json.thread.mid) : json.thread.mid) + if (json && json.emails[0]) { + location.href = URL_BASE + "/thread.html/" + (pm_config.shortLinks ? shortenID(json.emails[0].mid) : json.emails[0].mid) } } @@ -39,24 +39,24 @@ function timeTravelListRedirect(json, state) { } } // Did we receive timetravel data? - if (json && json.thread) { + if (json && json.emails[0]) { var osubs = countSubs(current_thread_json[state.id]) - var nsubs = countSubs(json.thread) + var nsubs = countSubs(json.emails[0]) var oid = current_thread_json[state.id].tid // Did we actually get more emails now than we had before? - if (nsubs > osubs || nsubs >= osubs && !json.thread.irt) { + if (nsubs > osubs || nsubs >= osubs && !json.emails[0].irt) { if (prefs.displayMode == 'threaded') { toggleEmails_threaded(state.id) - current_thread_json[state.id] = json.thread + current_thread_json[state.id] = json.emails[0] toggleEmails_threaded(state.id) } else if (prefs.displayMode == 'treeview') { toggleEmails_treeview(state.id) - current_thread_json[state.id] = json.thread + current_thread_json[state.id] = json.emails[0] toggleEmails_treeview(state.id) } - var subs = countSubs(json.thread) - var parts = countParts(json.thread) + var subs = countSubs(json.emails[0]) + var parts = countParts(json.emails[0]) // If we have subs/people labels available, change them and set the newly found stats if (document.getElementById('subs_' + state.id) != null) { document.getElementById('subs_' + state.id).innerHTML = " " + subs + " replies" diff --git a/site/js/ponymail.js b/site/js/ponymail.js index fe928b5..7fce8e2 100644 --- a/site/js/ponymail.js +++ b/site/js/ponymail.js @@ -1824,8 +1824,8 @@ function highlightNewEmails(id) { } function displaySingleThread(json) { - if (json && json.thread) { - current_thread_json = [json.thread] + if (json && json.emails[0]) { + current_thread_json = [json.emails[0]] current_flat_json = json.emails } var thread = document.getElementById('thread_0') @@ -4721,8 +4721,8 @@ function showStats(json) { // simple func that just redirects to the original thread URL we just got if possible function timeTravelSingleThreadRedirect(json) { - if (json && json.thread) { - location.href = URL_BASE + "/thread.html/" + (pm_config.shortLinks ? shortenID(json.thread.mid) : json.thread.mid) + if (json && json.emails[0]) { + location.href = URL_BASE + "/thread.html/" + (pm_config.shortLinks ? shortenID(json.emails[0].mid) : json.emails[0].mid) } } @@ -4742,24 +4742,24 @@ function timeTravelListRedirect(json, state) { } } // Did we receive timetravel data? - if (json && json.thread) { + if (json && json.emails[0]) { var osubs = countSubs(current_thread_json[state.id]) - var nsubs = countSubs(json.thread) + var nsubs = countSubs(json.emails[0]) var oid = current_thread_json[state.id].tid // Did we actually get more emails now than we had before? - if (nsubs > osubs || nsubs >= osubs && !json.thread.irt) { + if (nsubs > osubs || nsubs >= osubs && !json.emails[0].irt) { if (prefs.displayMode == 'threaded') { toggleEmails_threaded(state.id) - current_thread_json[state.id] = json.thread + current_thread_json[state.id] = json.emails[0] toggleEmails_threaded(state.id) } else if (prefs.displayMode == 'treeview') { toggleEmails_treeview(state.id) - current_thread_json[state.id] = json.thread + current_thread_json[state.id] = json.emails[0] toggleEmails_treeview(state.id) } - var subs = countSubs(json.thread) - var parts = countParts(json.thread) + var subs = countSubs(json.emails[0]) + var parts = countParts(json.emails[0]) // If we have subs/people labels available, change them and set the newly found stats if (document.getElementById('subs_' + state.id) != null) { document.getElementById('subs_' + state.id).innerHTML = " " + subs + " replies" -- To stop receiving notification emails like this one, please contact sebb@apache.org.