diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 126450f0f..80dcb0e63 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -4035,6 +4035,7 @@ define([ common.mailbox.sendTo("INVITE_TO_TEAM_ANSWER", { answer: yes, teamChannel: msg.content.team.channel, + teamName: teamName, user: { displayName: user.name, avatar: user.avatar, diff --git a/www/common/notifications.js b/www/common/notifications.js index ed44c2917..192d2b4c6 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -294,7 +294,8 @@ define([ // Display the notification var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous; - var teamName = Util.fixHTML(Util.find(msg, ['content', 'team', 'metadata', 'name']) || ''); + var teamName = Util.fixHTML(Util.find(msg, ['content', 'team', 'metadata', 'name']) || '') || + Util.fixHTML(Util.find(msg, ['content', 'teamName'])); var key = 'team_' + (msg.content.answer ? 'accept' : 'decline') + 'Invitation'; content.getFormatText = function () { return Messages._getKey(key, [name, teamName]); diff --git a/www/notifications/inner.js b/www/notifications/inner.js index 6fc8bf1ca..2e89c5078 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -93,6 +93,10 @@ define([ return ud.content.hash === data.content.hash; }); notifsData.push(data); + if (data.content.msg.type === 'REQUEST_PAD_ACCESS') { return; } // FIXME find a way to display this notifications wihtout knowing the title + if (data.content.msg.type === 'INVITE_TO_TEAM_ANSWER') { console.log(data); } + if (data.content.msg.type === 'INVITE_TO_TEAM_ANSWER' + && !data.content.msg.content.teamName) { return; } // FIXME find a way to display this notifications wihtout knowing the team name var el = common.mailbox.createElement(data); var time = new Date(data.content.time); $(el).find(".cp-notification-content").append(h("span.notification-time", time.toLocaleString()));