From 7114bfaa5246adf65406414cf7690a60217bda3a Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 13 Jul 2017 21:09:29 +0200 Subject: [PATCH] lint compliance --- www/common/common-messaging.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/www/common/common-messaging.js b/www/common/common-messaging.js index 865cc0856..573887ae1 100644 --- a/www/common/common-messaging.js +++ b/www/common/common-messaging.js @@ -95,7 +95,7 @@ define([ }); $remove.click(function (e) { e.stopPropagation(); - Cryptpad.confirm("TODO: Are you sure?", function (yes) { + common.confirm("TODO: Are you sure?", function (yes) { if (!yes) { return; } remove(data.edPublic); }); @@ -142,12 +142,13 @@ define([ channel.messages.push([cryptMsg.slice(0,64), parsedMsg]); return; } + var proxy; if (parsedMsg[0] === Types.update) { - var proxy = common.getProxy(); + proxy = common.getProxy(); if (parsedMsg[1] === common.getProxy().edPublic) { return; } var newdata = parsedMsg[3]; var data = getFriend(common, parsedMsg[1]); - var types = [] + var types = []; Object.keys(newdata).forEach(function (k) { if (data[k] !== newdata[k]) { types.push(k); @@ -158,7 +159,7 @@ define([ return; } if (parsedMsg[0] === Types.unfriend) { - var proxy = common.getProxy(); + proxy = common.getProxy(); if (parsedMsg[1] === common.getProxy().edPublic) { return; } channel.wc.leave(Types.unfriend); channel.removeUI(); @@ -320,12 +321,12 @@ define([ var remove = function (edPublic) { var data = getFriend(common, edPublic); var channel = channels[data.channel]; - var newdata = createData(common, data.channel); + //var newdata = createData(common, data.channel); var msg = [Types.unfriend, proxy.edPublic, +new Date()]; var msgStr = JSON.stringify(msg); var cryptMsg = channel.encryptor.encrypt(msgStr); channel.wc.bcast(cryptMsg).then(function () { - removeFromFriendList(common, edPublici, function () { + removeFromFriendList(common, edPublic, function () { channel.wc.leave(Types.unfriend); channel.removeUI(); }); @@ -421,7 +422,7 @@ define([ }); }); - Cryptpad.onDisplayNameChanged(function() { + common.onDisplayNameChanged(function() { Object.keys(channels).forEach(function (chan) { var channel = channels[chan]; var newdata = createData(common, chan);