Browse Source

Fixed message invalid peer bug

master
Igor Zhukov 10 years ago
parent
commit
ccab402f7c
  1. 10
      app/js/services.js

10
app/js/services.js

@ -1728,7 +1728,7 @@ angular.module('myApp.services', ['myApp.i18n'])
if (toID < 0) { if (toID < 0) {
return toID; return toID;
} else if (message.out) { } else if (message.out || message.flags & 2) {
return toID; return toID;
} }
return message.from_id; return message.from_id;
@ -2032,10 +2032,6 @@ angular.module('myApp.services', ['myApp.i18n'])
peerID = getMessagePeer(message), peerID = getMessagePeer(message),
historyStorage = historiesStorage[peerID]; historyStorage = historiesStorage[peerID];
if (!message.out) {
AppUsersManager.forceUserOnline(message.from_id);
}
if (historyStorage !== undefined) { if (historyStorage !== undefined) {
var topMsgID = historiesStorage[peerID].history[0]; var topMsgID = historiesStorage[peerID].history[0];
if (historiesStorage[peerID].history.indexOf(message.id) != -1) { if (historiesStorage[peerID].history.indexOf(message.id) != -1) {
@ -2055,6 +2051,10 @@ angular.module('myApp.services', ['myApp.i18n'])
saveMessages([message]); saveMessages([message]);
if (!message.out) {
AppUsersManager.forceUserOnline(message.from_id);
}
if (historyStorage.count !== null) { if (historyStorage.count !== null) {
historyStorage.count++; historyStorage.count++;
} }

Loading…
Cancel
Save