Decline a friend request

This commit is contained in:
yflory
2019-05-23 15:25:05 +02:00
parent 67e39253cf
commit 06a07d069e
5 changed files with 25 additions and 3 deletions

View File

@@ -15,6 +15,13 @@ define([
}
cb();
};
handlers['DECLINE_FRIEND_REQUEST'] = function (ctx, box, data, cb) {
// Our friend request was declined.
if (!ctx.store.proxy.friends_pending[data.msg.author]) { return void cb(true); }
delete ctx.store.proxy.friends_pending[data.msg.author];
ctx.updateMetadata();
cb();
};
handlers['ACCEPT_FRIEND_REQUEST'] = function (ctx, box, data, cb) {
// Our friend request was accepted.
// Make sure we really sent it