mirror of https://github.com/xwiki-labs/cryptpad
Remove test code
This commit is contained in:
parent
2e96f13d0c
commit
5512d1fab7
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue