You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/09/06 09:07:12 UTC
[1/2] incubator-ponymail git commit: bug out if we've already
rendered this email
Repository: incubator-ponymail
Updated Branches:
refs/heads/coffee-and-cake 1820d0b7a -> 3605a82b9
bug out if we've already rendered this email
Sometimes, the threading will go haywire and claim an
email is the child of itself. let's ignore those.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/00f00e94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/00f00e94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/00f00e94
Branch: refs/heads/coffee-and-cake
Commit: 00f00e94427662750fa0548454ff756b65bb3701
Parents: 1820d0b
Author: Daniel Gruno <hu...@apache.org>
Authored: Tue Sep 6 11:06:49 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Tue Sep 6 11:06:49 2016 +0200
----------------------------------------------------------------------
site/js/coffee/email_display_threaded.coffee | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/00f00e94/site/js/coffee/email_display_threaded.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/email_display_threaded.coffee b/site/js/coffee/email_display_threaded.coffee
index 37d37b5..b1d92a5 100644
--- a/site/js/coffee/email_display_threaded.coffee
+++ b/site/js/coffee/email_display_threaded.coffee
@@ -20,6 +20,7 @@ class ThreadedEmailDisplay extends BasicEmailDisplay
constructor: (@parent, @mid, index, tjson = null) ->
@placeholder = get("placeholder_" + @mid) || new HTML('div', { class: "email_placeholder", id: "placeholder_" + @mid})
+ @shown = {}
me = this
@@ -45,6 +46,11 @@ class ThreadedEmailDisplay extends BasicEmailDisplay
return this
threadedFetch: (parent, thread, nestedness) ->
+ ### First off, we don't want duplicates due to whatever bug, so bug out if we've already rendered this email ###
+ if @shown[thread.tid]
+ return
+ @shown[thread.tid] = true
+
### Make the thread item placeholder ###
bodyplace = new HTML('div', {id: "placeholder_#{@mid}_#{thread.tid}", class:"email_boxed"})
[2/2] incubator-ponymail git commit: regen JS
Posted by hu...@apache.org.
regen JS
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/3605a82b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/3605a82b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/3605a82b
Branch: refs/heads/coffee-and-cake
Commit: 3605a82b950155e567586e92d33043050c3f1f1f
Parents: 00f00e9
Author: Daniel Gruno <hu...@apache.org>
Authored: Tue Sep 6 11:07:01 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Tue Sep 6 11:07:01 2016 +0200
----------------------------------------------------------------------
site/js/ponymail-coffee.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/3605a82b/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index c3b8156..a522aa8 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -720,6 +720,8 @@ BasicEmailDisplay = (function() {
for (j = 0, len = ref.length; j < len; j++) {
file = ref[j];
fsize = file.size;
+
+ /* Compact size to MB, KB or bytes */
if (fsize > (1024 * 1024)) {
fsize = (fsize / (1024 * 1024)).toFixed(2) + "MB";
} else if (fsize > 1024) {
@@ -727,6 +729,8 @@ BasicEmailDisplay = (function() {
} else {
fsize = fsize + " bytes";
}
+
+ /* Make a link with the filename and size */
link = new HTML('a', {
href: "api/email.lua?attachment=true&file=" + file.hash + "&id=" + json.mid,
style: {
@@ -1096,6 +1100,7 @@ ThreadedEmailDisplay = (function(superClass) {
"class": "email_placeholder",
id: "placeholder_" + this.mid
});
+ this.shown = {};
me = this;
/* Find the thread or fake one */
@@ -1122,8 +1127,14 @@ ThreadedEmailDisplay = (function(superClass) {
ThreadedEmailDisplay.prototype.threadedFetch = function(parent, thread, nestedness) {
- /* Make the thread item placeholder */
+ /* First off, we don't want duplicates due to whatever bug, so bug out if we've already rendered this email */
var bcolor, bcolors, bodyplace, item, j, len, me, place, r, ref, replyplace;
+ if (this.shown[thread.tid]) {
+ return;
+ }
+ this.shown[thread.tid] = true;
+
+ /* Make the thread item placeholder */
bodyplace = new HTML('div', {
id: "placeholder_" + this.mid + "_" + thread.tid,
"class": "email_boxed"