Browse Source

fix notification about new DMs on my own twists

readme-update
Simon Grim 8 years ago
parent
commit
8e167315d6
  1. 9
      js/twister_newmsgs.js

9
js/twister_newmsgs.js

@ -203,8 +203,11 @@ function requestDMsCount() {
var newDMsUpdated; var newDMsUpdated;
for (var u in dmUsers) { for (var u in dmUsers) {
if (dmUsers[u]) { if (!dmUsers[u])
var dmData = dmUsers[u][0]; continue;
var dmData = dmUsers[u][0];
if (dmData.from !== defaultScreenName) {
if (u in _lastDMIdPerUser && u in _newDMsPerUser) { if (u in _lastDMIdPerUser && u in _newDMsPerUser) {
if (dmData.id !== _lastDMIdPerUser[u]) { if (dmData.id !== _lastDMIdPerUser[u]) {
_newDMsPerUser[u] += dmData.id - _lastDMIdPerUser[u]; _newDMsPerUser[u] += dmData.id - _lastDMIdPerUser[u];
@ -214,8 +217,8 @@ function requestDMsCount() {
_newDMsPerUser[u] = dmData.id + 1; _newDMsPerUser[u] = dmData.id + 1;
newDMsUpdated = true; newDMsUpdated = true;
} }
_lastDMIdPerUser[u] = dmData.id;
} }
_lastDMIdPerUser[u] = dmData.id;
} }
if (newDMsUpdated) { if (newDMsUpdated) {
saveDMsToStorage(); saveDMsToStorage();

Loading…
Cancel
Save