mirror of https://github.com/xwiki-labs/cryptpad
serverside component of admin metadata history
This commit is contained in:
parent
6090f645d9
commit
b903e1351d
|
@ -663,6 +663,26 @@ var getLastChannelTime = function (Env, Server, cb, data) {
|
|||
});
|
||||
};
|
||||
|
||||
var getMetadataHistory = function (Env, Server, cb, data) {
|
||||
var id = Array.isArray(data) && data[1];
|
||||
if (!Core.isValidId(id)) { return void cb('INVALID_CHAN'); }
|
||||
|
||||
var lines = [];
|
||||
Env.msgStore.readChannelMetadata(id, (err, line) => {
|
||||
if (err) { return; }
|
||||
lines.push(line);
|
||||
}, err => {
|
||||
if (err) {
|
||||
Env.Log.error('ADMIN_GET_METADATA_HISTORY', {
|
||||
error: err,
|
||||
id: id,
|
||||
});
|
||||
return void cb(err);
|
||||
}
|
||||
cb(void 0, lines);
|
||||
});
|
||||
};
|
||||
|
||||
var commands = {
|
||||
ACTIVE_SESSIONS: getActiveSessions,
|
||||
ACTIVE_PADS: getActiveChannelCount,
|
||||
|
@ -680,6 +700,7 @@ var commands = {
|
|||
GET_USER_STORAGE_STATS: getUserStorageStats,
|
||||
GET_PIN_LOG_STATUS: getPinLogStatus,
|
||||
|
||||
GET_METADATA_HISTORY: getMetadataHistory,
|
||||
GET_STORED_METADATA: getStoredMetadata,
|
||||
GET_DOCUMENT_SIZE: getDocumentSize,
|
||||
GET_LAST_CHANNEL_TIME: getLastChannelTime,
|
||||
|
|
Loading…
Reference in New Issue