From 5512d1fab79734c182f6b0f058bfd5145c90dd5b Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 27 May 2019 17:55:28 +0200 Subject: [PATCH] Remove test code --- www/common/outer/async-store.js | 21 --------------------- www/common/outer/mailbox.js | 8 -------- www/common/sframe-common-title.js | 14 -------------- 3 files changed, 43 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 869890b7c..39aac9b54 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -639,27 +639,6 @@ define([ // Set the display name (username) in the proxy Store.setDisplayName = function (clientId, value, cb) { - if (store.mailbox && store.proxy.friends) { - // XXX test mailbox, should be removed in prod - /*store.mailbox.post('notifications', 'NAME_CHANGED', { - old: store.proxy[Constants.displayNameKey], - new: value - }); - Object.keys(store.proxy.friends).forEach(function (curve) { - var f = store.proxy.friends[curve]; - if (!f.notifications) { return; } - store.mailbox.sendTo('NAME_CHANGED', { - old: store.proxy[Constants.displayNameKey], - new: value - }, { - channel: f.notifications, - curvePublic: curve - }, function (obj) { - if (obj && obj.error) { return void console.error(obj.error); } - console.log('notif sent to '+f); - }); - });*/ - } if (store.modules['profile']) { store.modules['profile'].setName(value); } diff --git a/www/common/outer/mailbox.js b/www/common/outer/mailbox.js index 4deaea5e2..d2bc41705 100644 --- a/www/common/outer/mailbox.js +++ b/www/common/outer/mailbox.js @@ -10,7 +10,6 @@ define([ var TYPES = [ 'notifications', - 'test' ]; var BLOCKING_TYPES = [ ]; @@ -177,13 +176,6 @@ proxy.mailboxes = { var keys = getMyKeys(ctx); if (!keys) { return void console.error("missing asymmetric encryption keys"); } var crypto = Crypto.Mailbox.createEncryptor(keys); - // XXX remove 'test' - if (type === 'test') { - crypto = { - encrypt: function (x) { return x; }, - decrypt: function (x) { return x; } - }; - } var cfg = { network: ctx.store.network, channel: m.channel, diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js index d204f5268..496cbfcb9 100644 --- a/www/common/sframe-common-title.js +++ b/www/common/sframe-common-title.js @@ -71,20 +71,6 @@ define([ evTitleChange.fire(title); if (titleUpdated) { titleUpdated(undefined, title); - // XXX Test notifications from inner - var users = metadataMgr.getMetadata().users; - var me = metadataMgr.getNetfluxId(); - Object.keys(users).forEach(function (netfluxId) { - if (netfluxId === me) { return; } - var user = users[netfluxId]; - if (!user.curvePublic || !user.notifications) { return; } - Common.mailbox.sendTo("TEST_NOTIF_TITLE", { - new_title: title - }, { - channel: user.notifications, - curvePublic: user.curvePublic - }); - }); } }); });