Add unfriend, mute and unmute buttons in profile

This commit is contained in:
yflory
2019-12-11 13:28:07 +01:00
parent 11ddb96422
commit aa8dd95310
4 changed files with 68 additions and 10 deletions

View File

@@ -428,20 +428,21 @@ define([
}
var channel = ctx.channels[data.channel];
if (!channel) {
return void cb({error: "NO_SUCH_CHANNEL"});
}
// Unfriend with mailbox
if (ctx.store.mailbox && data.curvePublic && data.notifications) {
Messaging.removeFriend(ctx.store, curvePublic, function (obj) {
if (obj && obj.error) { return void cb({error:obj.error}); }
ctx.updateMetadata();
cb(obj);
});
return;
}
// Unfriend with channel
if (!channel) {
return void cb({error: "NO_SUCH_CHANNEL"});
}
try {
var msg = [Types.unfriend, proxy.curvePublic, +new Date()];
var msgStr = JSON.stringify(msg);