mirror of https://github.com/xwiki-labs/cryptpad
implement channel removal in amnesiadb
This commit is contained in:
parent
3232671a6a
commit
1b2c129380
|
@ -19,6 +19,10 @@ module.exports.create = function(conf, cb){
|
||||||
var db=[],
|
var db=[],
|
||||||
index=0;
|
index=0;
|
||||||
|
|
||||||
|
if (conf.removeChannels) {
|
||||||
|
console.log("Server is set to remove channels %sms after the last remaining client leaves.", conf.channelRemovalTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
cb({
|
cb({
|
||||||
message: function(channelName, content, cb){
|
message: function(channelName, content, cb){
|
||||||
var val = {
|
var val = {
|
||||||
|
@ -41,5 +45,12 @@ module.exports.create = function(conf, cb){
|
||||||
});
|
});
|
||||||
if (cb) { cb(); }
|
if (cb) { cb(); }
|
||||||
},
|
},
|
||||||
|
removeChannel: function (channelName, cb) {
|
||||||
|
var err = false;
|
||||||
|
db = db.filter(function (msg) {
|
||||||
|
return msg.chan !== channelName;
|
||||||
|
});
|
||||||
|
cb(err);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue