|
|
@ -134,54 +134,54 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// if not archived, add handlers
|
|
|
|
// if not archived, add handlers
|
|
|
|
content.handler = function () {
|
|
|
|
if (!content.archived) {
|
|
|
|
var metadataMgr = common.getMetadataMgr();
|
|
|
|
content.handler = function () {
|
|
|
|
var priv = metadataMgr.getPrivateData();
|
|
|
|
var metadataMgr = common.getMetadataMgr();
|
|
|
|
|
|
|
|
var priv = metadataMgr.getPrivateData();
|
|
|
|
var link = h('a', {
|
|
|
|
|
|
|
|
href: '#'
|
|
|
|
var link = h('a', {
|
|
|
|
}, Messages.requestEdit_viewPad);
|
|
|
|
href: '#'
|
|
|
|
var verified = h('p');
|
|
|
|
}, Messages.requestEdit_viewPad);
|
|
|
|
var $verified = $(verified);
|
|
|
|
var verified = h('p');
|
|
|
|
|
|
|
|
var $verified = $(verified);
|
|
|
|
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
|
|
|
|
|
|
|
|
var title = Util.fixHTML(msg.content.title);
|
|
|
|
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
|
|
|
|
|
|
|
|
var title = Util.fixHTML(msg.content.title);
|
|
|
|
if (priv.friends && priv.friends[msg.author]) {
|
|
|
|
|
|
|
|
$verified.addClass('cp-notifications-requestedit-verified');
|
|
|
|
if (priv.friends && priv.friends[msg.author]) {
|
|
|
|
var f = priv.friends[msg.author];
|
|
|
|
$verified.addClass('cp-notifications-requestedit-verified');
|
|
|
|
$verified.append(h('span.fa.fa-certificate'));
|
|
|
|
var f = priv.friends[msg.author];
|
|
|
|
var $avatar = $(h('span.cp-avatar')).appendTo($verified);
|
|
|
|
$verified.append(h('span.fa.fa-certificate'));
|
|
|
|
$verified.append(h('p', Messages._getKey('requestEdit_fromFriend', [f.displayName])));
|
|
|
|
var $avatar = $(h('span.cp-avatar')).appendTo($verified);
|
|
|
|
common.displayAvatar($avatar, f.avatar, f.displayName);
|
|
|
|
$verified.append(h('p', Messages._getKey('requestEdit_fromFriend', [f.displayName])));
|
|
|
|
} else {
|
|
|
|
common.displayAvatar($avatar, f.avatar, f.displayName);
|
|
|
|
$verified.append(Messages._getKey('requestEdit_fromStranger', [name]));
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
$verified.append(Messages._getKey('requestEdit_fromStranger', [name]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var div = h('div', [
|
|
|
|
var div = h('div', [
|
|
|
|
UI.setHTML(h('p'), Messages._getKey('requestEdit_confirm', [title, name])),
|
|
|
|
UI.setHTML(h('p'), Messages._getKey('requestEdit_confirm', [title, name])),
|
|
|
|
verified,
|
|
|
|
verified,
|
|
|
|
link
|
|
|
|
link
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
$(link).click(function (e) {
|
|
|
|
$(link).click(function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
e.stopPropagation();
|
|
|
|
common.openURL(msg.content.href);
|
|
|
|
common.openURL(msg.content.href);
|
|
|
|
});
|
|
|
|
|
|
|
|
UI.confirm(div, function (yes) {
|
|
|
|
|
|
|
|
if (!yes) { return; }
|
|
|
|
|
|
|
|
common.getSframeChannel().event('EV_GIVE_ACCESS', {
|
|
|
|
|
|
|
|
channel: msg.content.channel,
|
|
|
|
|
|
|
|
user: msg.content.user
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
defaultDismiss(common, data)();
|
|
|
|
UI.confirm(div, function (yes) {
|
|
|
|
}, {
|
|
|
|
if (!yes) { return; }
|
|
|
|
ok: Messages.friendRequest_accept,
|
|
|
|
common.getSframeChannel().event('EV_GIVE_ACCESS', {
|
|
|
|
cancel: Messages.later
|
|
|
|
channel: msg.content.channel,
|
|
|
|
});
|
|
|
|
user: msg.content.user
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
defaultDismiss(common, data)();
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
ok: Messages.friendRequest_accept,
|
|
|
|
|
|
|
|
cancel: Messages.later
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (!content.archived) {
|
|
|
|
|
|
|
|
content.dismissHandler = defaultDismiss(common, data);
|
|
|
|
content.dismissHandler = defaultDismiss(common, data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -284,5 +284,6 @@ define([
|
|
|
|
remove: function (common, data) {
|
|
|
|
remove: function (common, data) {
|
|
|
|
common.removeFriendRequest(data.hash);
|
|
|
|
common.removeFriendRequest(data.hash);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
allowed: Object.keys(handlers)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|