Fix missing title in notification history
This commit is contained in:
@@ -4035,6 +4035,7 @@ define([
|
|||||||
common.mailbox.sendTo("INVITE_TO_TEAM_ANSWER", {
|
common.mailbox.sendTo("INVITE_TO_TEAM_ANSWER", {
|
||||||
answer: yes,
|
answer: yes,
|
||||||
teamChannel: msg.content.team.channel,
|
teamChannel: msg.content.team.channel,
|
||||||
|
teamName: teamName,
|
||||||
user: {
|
user: {
|
||||||
displayName: user.name,
|
displayName: user.name,
|
||||||
avatar: user.avatar,
|
avatar: user.avatar,
|
||||||
|
|||||||
@@ -294,7 +294,8 @@ define([
|
|||||||
|
|
||||||
// Display the notification
|
// Display the notification
|
||||||
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
|
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';
|
var key = 'team_' + (msg.content.answer ? 'accept' : 'decline') + 'Invitation';
|
||||||
content.getFormatText = function () {
|
content.getFormatText = function () {
|
||||||
return Messages._getKey(key, [name, teamName]);
|
return Messages._getKey(key, [name, teamName]);
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ define([
|
|||||||
return ud.content.hash === data.content.hash;
|
return ud.content.hash === data.content.hash;
|
||||||
});
|
});
|
||||||
notifsData.push(data);
|
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 el = common.mailbox.createElement(data);
|
||||||
var time = new Date(data.content.time);
|
var time = new Date(data.content.time);
|
||||||
$(el).find(".cp-notification-content").append(h("span.notification-time", time.toLocaleString()));
|
$(el).find(".cp-notification-content").append(h("span.notification-time", time.toLocaleString()));
|
||||||
|
|||||||
Reference in New Issue
Block a user