Remove the ACCEPT or DECLINE friend request messages instantly

This commit is contained in:
yflory
2019-05-27 11:18:53 +02:00
parent d514854724
commit 8dd557a0f6
3 changed files with 65 additions and 33 deletions

View File

@@ -201,16 +201,19 @@ proxy.mailboxes = {
cfg.onConnect = function (wc, sendMessage) {
// Send a message to our box?
// NOTE: we use our own curvePublic so that we can decrypt our own message :)
box.sendMessage = function (msg) {
box.sendMessage = function (_msg) {
try {
msg = JSON.stringify(msg);
msg = JSON.stringify(_msg);
} catch (e) {
console.error(e);
}
sendMessage(msg, function (err, hash) {
if (m.viewed.indexOf(hash) === -1) {
m.viewed.push(hash);
}
box.content[hash] = _msg;
var message = {
msg: _msg,
hash: hash
};
showMessage(ctx, type, message);
}, keys.curvePublic);
};
box.queue.forEach(function (msg) {
@@ -357,7 +360,6 @@ proxy.mailboxes = {
}
});
// XXX test function used to populate a mailbox, should be removed in prod
mailbox.post = function (box, type, content) {
var b = ctx.boxes[box];
if (!b) { return; }