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

@@ -981,7 +981,7 @@ define([
// Try to get the owner's mailbox from the pad metadata first.
// If it's is an older owned pad, check if the owner is a friend
// or an acquaintance (from async-store directly in requestAccess)
Cryptpad.getPadMetadata({
Cryptpad.pad.getPadMetadata({
channel: secret.channel
}, waitFor(function (obj) {
obj = obj || {};
@@ -1004,6 +1004,15 @@ define([
});
});
sframeChan.on('Q_GET_PAD_METADATA', function (data, cb) {
if (!data || !data.channel) {
data = {
channel: secret.channel
};
}
console.log(data);
Cryptpad.getPadMetadata(data, cb);
});
sframeChan.on('Q_SET_PAD_METADATA', function (data, cb) {
Cryptpad.setPadMetadata(data, cb);
});