fix function signatures

This commit is contained in:
ansuz 2017-10-03 14:08:40 +02:00
parent 351b95d6a9
commit 09c0a473e2
2 changed files with 7 additions and 15 deletions

View File

@ -447,7 +447,6 @@ define([
}); });
}); });
sframeChan.on('Q_CONTACTS_GET_FRIEND_INFO', function (curvePublic, cb) { sframeChan.on('Q_CONTACTS_GET_FRIEND_INFO', function (curvePublic, cb) {
console.error(curvePublic);
messenger.getFriendInfo(curvePublic, function (e, info) { messenger.getFriendInfo(curvePublic, function (e, info) {
cb({ cb({
error: e, error: e,

View File

@ -18,38 +18,32 @@ define([], function () {
_handlers[key].push(f); _handlers[key].push(f);
}; };
sFrameChan.on('EV_CONTACTS_MESSAGE', function (err, data) { sFrameChan.on('EV_CONTACTS_MESSAGE', function (data) {
//if (err || data.error) { return void console.error(err || data.error); }
_handlers.message.forEach(function (f) { _handlers.message.forEach(function (f) {
f(err || data.error, data); f(data);
}); });
}); });
sFrameChan.on('EV_CONTACTS_JOIN', function (err, data) { sFrameChan.on('EV_CONTACTS_JOIN', function (data) {
if (err || data.error) { return void console.error(err || data.error); }
_handlers.join.forEach(function (f) { _handlers.join.forEach(function (f) {
f(data.curvePublic, data.channel); f(data.curvePublic, data.channel);
}); });
}); });
sFrameChan.on('EV_CONTACTS_LEAVE', function (err, data) { sFrameChan.on('EV_CONTACTS_LEAVE', function (data) {
if (err || data.error) { return void console.error(err || data.error); }
_handlers.leave.forEach(function (f) { _handlers.leave.forEach(function (f) {
f(data.curvePublic, data.channel); f(data.curvePublic, data.channel);
}); });
}); });
sFrameChan.on('EV_CONTACTS_UPDATE', function (err, data) { sFrameChan.on('EV_CONTACTS_UPDATE', function (data) {
if (err || data.error) { return void console.error(err || data.error); }
_handlers.update.forEach(function (f) { _handlers.update.forEach(function (f) {
f(data.info, data.curvePublic); f(data.info, data.curvePublic);
}); });
}); });
sFrameChan.on('EV_CONTACTS_FRIEND', function (err, data) { sFrameChan.on('EV_CONTACTS_FRIEND', function (data) {
if (err || data.error) { return void console.error(err || data.error); }
_handlers.friend.forEach(function (f) { _handlers.friend.forEach(function (f) {
f(data.curvePublic); f(data.curvePublic);
}); });
}); });
sFrameChan.on('EV_CONTACTS_UNFRIEND', function (err, data) { sFrameChan.on('EV_CONTACTS_UNFRIEND', function (data) {
if (err || data.error) { return void console.error(err || data.error); }
_handlers.unfriend.forEach(function (f) { _handlers.unfriend.forEach(function (f) {
f(data.curvePublic); f(data.curvePublic);
}); });
@ -58,7 +52,6 @@ define([], function () {
/*** QUERIES ***/ /*** QUERIES ***/
messenger.getFriendList = function (cb) { messenger.getFriendList = function (cb) {
sFrameChan.query('Q_CONTACTS_GET_FRIEND_LIST', null, function (err, data) { sFrameChan.query('Q_CONTACTS_GET_FRIEND_LIST', null, function (err, data) {
console.error('GET FRIEND LIST');
cb(err || data.error, data.data); cb(err || data.error, data.data);
}); });
}; };