Add account name in metadata manager
parent
d88704fb50
commit
f5855a2870
|
@ -1,8 +0,0 @@
|
|||
define([
|
||||
'jquery'
|
||||
], function ($) {
|
||||
var common = {};
|
||||
|
||||
|
||||
return common;
|
||||
});
|
|
@ -198,6 +198,9 @@ define([
|
|||
}
|
||||
return '';
|
||||
};
|
||||
common.getAccountName = function () {
|
||||
return localStorage[common.userNameKey];
|
||||
};
|
||||
|
||||
var randomToken = function () {
|
||||
return Math.random().toString(16).replace(/0./, '');
|
||||
|
|
|
@ -5,6 +5,7 @@ define([], function () {
|
|||
var members = [];
|
||||
var metadataObj = UNINIT;
|
||||
var metadataLazyObj = UNINIT;
|
||||
var priv = {};
|
||||
var dirty = true;
|
||||
var changeHandlers = [];
|
||||
|
||||
|
@ -52,6 +53,9 @@ define([], function () {
|
|||
|
||||
sframeChan.on('EV_METADATA_UPDATE', function (ev) {
|
||||
meta = ev;
|
||||
if (ev.priv) {
|
||||
priv = ev.priv;
|
||||
}
|
||||
change(true);
|
||||
});
|
||||
sframeChan.on('EV_RT_CONNECT', function (ev) {
|
||||
|
@ -95,6 +99,9 @@ define([], function () {
|
|||
checkUpdate(false);
|
||||
var list = members.slice().filter(function (m) { return m.length === 32; });
|
||||
return list.length - Object.keys(metadataObj.users).length;
|
||||
},
|
||||
getPrivatedata : function () {
|
||||
return priv;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -473,7 +473,7 @@ define([
|
|||
var titleCfg = { getHeadingText: getHeadingText };
|
||||
Title = Cryptpad.createTitle(titleCfg, realtimeOptions.onLocal, Cryptpad);
|
||||
var configTb = {
|
||||
displayed: ['userlist'],
|
||||
displayed: ['userlist', 'useradmin'],
|
||||
//title: Title.getTitleConfig(),
|
||||
userList: cpNfInner.metadataMgr,
|
||||
readOnly: readOnly,
|
||||
|
|
|
@ -47,6 +47,9 @@ define([
|
|||
profile: Cryptpad.getProfileUrl(),
|
||||
curvePublic: Cryptpad.getProxy().curvePublic,
|
||||
netfluxId: Cryptpad.getNetwork().webChannels[0].myID,
|
||||
},
|
||||
priv: {
|
||||
accountName: Cryptpad.getAccountName()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -75,4 +78,4 @@ define([
|
|||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue