Implement ADD_OWNER notification with pending_owner metadata

This commit is contained in:
yflory
2019-08-30 16:41:48 +02:00
parent 738030e8c0
commit 9822c28f3b
8 changed files with 231 additions and 32 deletions

View File

@@ -210,6 +210,27 @@ define([
};
};
handlers['ADD_OWNER'] = function (common, data) {
var content = data.content;
var msg = content.msg;
// Display the notification
content.getFormatText = function () {
return Messages._getKey('friendRequest_notification', [name]);
};
// Check authenticity
if (msg.author !== msg.content.curvePublic) { return; }
// if not archived, add handlers
if (!content.archived) {
content.handler = function () {
UIElements.displayAddOwnerModal(common, data);
};
}
};
// NOTE: don't forget to fixHTML everything returned by "getFormatText"
return {