diff --git a/http/js/iznik/views/pages/user/newsfeed.js b/http/js/iznik/views/pages/user/newsfeed.js index 07aaf443c..f0062137c 100644 --- a/http/js/iznik/views/pages/user/newsfeed.js +++ b/http/js/iznik/views/pages/user/newsfeed.js @@ -1448,14 +1448,39 @@ define([ } } - var replies = self.model.get('replies') - self.replies = new Iznik.Collections.Replies(replies) + var origreplies = self.model.get('replies') + var replies = [] + var users = []; + self.contributors = [] - _.each(replies, function (reply) { - if (reply.user) { - self.contributors[reply.user.id] = reply.user.displayname + + function unnest(origreplies) { + _.each(origreplies, function(reply) { + replies.push(reply) + + if (reply.user) { + self.contributors[reply.user.id] = reply.user.displayname + users[reply.user.id] = reply.user + } + + if (reply.replies && reply.replies.length) { + // In the new version of FD we have nested replies. Make sure we at least display these (flattened) in + // this version. + unnest(reply.replies) + } + }) + } + + unnest(origreplies) + console.log("Replies", replies) + + for (var i = 0; i < replies.length; i++) { + if (!replies[i].user && replies[i].userid) { + replies[i].user = users[replies[i].userid] } - }) + } + + self.replies = new Iznik.Collections.Replies(replies) var replyel = self.$('.js-replies') diff --git a/http/js/iznik/views/pages/user/pages.js b/http/js/iznik/views/pages/user/pages.js index b1ac7738d..959e44634 100644 --- a/http/js/iznik/views/pages/user/pages.js +++ b/http/js/iznik/views/pages/user/pages.js @@ -325,14 +325,16 @@ define([ self.listenToOnce(Iznik.Session, 'isLoggedIn', function (loggedIn) { // We have some groups near their chosen location. var mygroups = Iznik.Session.get('groups'); - mygroups.each(function(group) { - if (group.get('type') == 'Freegle' && - group.get('privategroup')) { - // We are a member of a private group. That should appear at the top. - groups.append(''); - groups.find('option:last').text(group.get('namedisplay')); - } - }); + if (mygroups) { + mygroups.each(function(group) { + if (group.get('type') == 'Freegle' && + group.get('privategroup')) { + // We are a member of a private group. That should appear at the top. + groups.append(''); + groups.find('option:last').text(group.get('namedisplay')); + } + }); + } var homegroup = null; var homegrouptime = null; diff --git a/http/template/modtools/user/logentry.html b/http/template/modtools/user/logentry.html index c04a5882a..f08632faa 100644 --- a/http/template/modtools/user/logentry.html +++ b/http/template/modtools/user/logentry.html @@ -55,6 +55,8 @@ Outcome for #{{msgid}}: {{text}} <% } else if (subtype == 'Autoapproved') { %> Auto-approved #{{msgid}} - either Yahoo problems or not moderated + <% } else if (subtype == 'WorryWords') { %> + Message #{{msgid}} {{text}} <% } else { %>