Fix missing title in notification history

pull/1/head
yflory 5 years ago
parent 741acbd6ef
commit 0044d622f1

@ -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,

@ -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]);

@ -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()));

Loading…
Cancel
Save