Fix bug chat history not deleted

This commit is contained in:
ClemDee
2019-06-07 15:43:24 +02:00
parent e52acda334
commit f6cc3aa8c3
3 changed files with 16 additions and 8 deletions

View File

@@ -943,6 +943,16 @@ define([
cb();
};
var clearOwnedChannel = function (id, cb) {
var channel = getChannel(id);
if (!channel) { return void cb({error: 'NO_CHANNEL'}); }
if (!store.rpc) { return void cb({error: 'RPC_NOT_READY'}); }
store.rpc.clearOwnedChannel(id, function (err) {
cb({error:err});
});
channel.messages = [];
}
network.on('disconnect', function () {
emit('DISCONNECT');
});
@@ -1000,6 +1010,9 @@ define([
if (cmd === 'SET_CHANNEL_HEAD') {
return void setChannelHead(data.id, data.sig, cb);
}
if (cmd === 'CLEAR_OWNED_CHANNEL') {
return void clearOwnedChannel(data, cb);
}
};
Object.freeze(messenger);