Fix some jshints
This commit is contained in:
parent
3292177a96
commit
626b63ee7c
1 changed files with 7 additions and 6 deletions
|
@ -58,7 +58,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
extension.browserAction(window.openInbox);
|
extension.browserAction(window.openInbox);
|
||||||
};
|
}
|
||||||
|
|
||||||
function onMessageReceived(pushMessage) {
|
function onMessageReceived(pushMessage) {
|
||||||
var now = new Date().getTime();
|
var now = new Date().getTime();
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
extension.on('message:decrypted', function(options) {
|
extension.on('message:decrypted', function(options) {
|
||||||
var message = messages.add({id: options.message_id});
|
var message = messages.add({id: options.message_id});
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
var type = 'incoming';
|
var type = 'incoming';
|
||||||
if (source === textsecure.storage.getUnencrypted("number_id").split('.')[0] && pushMessageContent.sync) {
|
if (source === textsecure.storage.getUnencrypted("number_id").split('.')[0] && pushMessageContent.sync) {
|
||||||
type = 'outgoing';
|
type = 'outgoing';
|
||||||
timestamp = pushMessageContent.sync.timestamp
|
timestamp = pushMessageContent.sync.timestamp;
|
||||||
}
|
}
|
||||||
return textsecure.processDecrypted(pushMessageContent, source).then(function(pushMessageContent) {
|
return textsecure.processDecrypted(pushMessageContent, source).then(function(pushMessageContent) {
|
||||||
var now = new Date().getTime();
|
var now = new Date().getTime();
|
||||||
|
@ -151,6 +151,7 @@
|
||||||
var attributes = {};
|
var attributes = {};
|
||||||
conversation.fetch().always(function() {
|
conversation.fetch().always(function() {
|
||||||
if (pushMessageContent.group) {
|
if (pushMessageContent.group) {
|
||||||
|
var group_update = {};
|
||||||
if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.UPDATE) {
|
if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.UPDATE) {
|
||||||
attributes = {
|
attributes = {
|
||||||
type : 'group',
|
type : 'group',
|
||||||
|
@ -159,14 +160,14 @@
|
||||||
avatar : pushMessageContent.group.avatar,
|
avatar : pushMessageContent.group.avatar,
|
||||||
members : pushMessageContent.group.members,
|
members : pushMessageContent.group.members,
|
||||||
};
|
};
|
||||||
var group_update = conversation.changedAttributes(_.pick(pushMessageContent.group, 'name', 'avatar'));
|
group_update = conversation.changedAttributes(_.pick(pushMessageContent.group, 'name', 'avatar'));
|
||||||
var difference = _.difference(pushMessageContent.group.members, conversation.get('members'));
|
var difference = _.difference(pushMessageContent.group.members, conversation.get('members'));
|
||||||
if (difference.length > 0) {
|
if (difference.length > 0) {
|
||||||
group_update.joined = difference;
|
group_update.joined = difference;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.QUIT) {
|
else if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.QUIT) {
|
||||||
var group_update = { left: source };
|
group_update = { left: source };
|
||||||
attributes = { members: _.without(conversation.get('members'), source) };
|
attributes = { members: _.without(conversation.get('members'), source) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,5 +230,5 @@
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log('got delivery receipt for unknown message', pushMessage.source, timestamp);
|
console.log('got delivery receipt for unknown message', pushMessage.source, timestamp);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue