This commit is contained in:
Igor Zhukov 2014-03-20 18:31:57 +04:00
parent dcd408e676
commit 8a185e8aa9
4 changed files with 39 additions and 37 deletions

View File

@ -2469,10 +2469,6 @@ a.contacts_modal_contact:hover .contacts_modal_contact_status {
.im_page_peer_not_selected .im_dialog_message { .im_page_peer_not_selected .im_dialog_message {
display: block; display: block;
} }
.im_emoji_btn {
display: none;
}
} }

View File

@ -920,26 +920,25 @@ angular.module('myApp.services', [])
historyStorage = historiesStorage[peerID], historyStorage = historiesStorage[peerID],
foundDialog = getDialogByPeerID(peerID); foundDialog = getDialogByPeerID(peerID);
if (!historyStorage || if (!foundDialog[0] || !foundDialog[0].unread_count) {
!historyStorage.history.length ||
foundDialog[0] && !foundDialog[0].unread_count) {
// console.log('bad1', historyStorage, foundDialog[0]);
return false;
}
var messageID, if (!historyStorage && !historyStorage.history.length) {
message; return false;
// console.log(historyStorage); }
for (i = 0; i < historyStorage.history.length; i++) {
messageID = historyStorage.history[i]; var messageID,
message = messagesStorage[messageID]; message,
// console.log('ms', message); foundUnread = false;
if (message && !message.out) { for (i = historyStorage.history.length; i >= 0; i--) {
if (message.unread) { messageID = historyStorage.history[i];
// console.log('unread'); message = messagesStorage[messageID];
// console.log('ms', message);
if (message && !message.out && message.unread) {
foundUnread = true;
break; break;
} }
// console.log('bad2', message); }
if (!foundUnread) {
return false; return false;
} }
} }
@ -959,17 +958,19 @@ angular.module('myApp.services', [])
}); });
var messageID, message, i, peerID, foundDialog, dialog; if (historyStorage && historyStorage.history.length) {
for (i = 0; i < historyStorage.history.length; i++) { var messageID, message, i, peerID, foundDialog, dialog;
messageID = historyStorage.history[i]; for (i = 0; i < historyStorage.history.length; i++) {
message = messagesStorage[messageID]; messageID = historyStorage.history[i];
if (message && !message.out) { message = messagesStorage[messageID];
message.unread = false; if (message && !message.out) {
if (messagesForHistory[messageID]) { message.unread = false;
messagesForHistory[messageID].unread = false; if (messagesForHistory[messageID]) {
} messagesForHistory[messageID].unread = false;
if (messagesForDialogs[messageID]) { }
messagesForDialogs[messageID].unread = false; if (messagesForDialogs[messageID]) {
messagesForDialogs[messageID].unread = false;
}
} }
} }
} }
@ -2364,6 +2365,7 @@ angular.module('myApp.services', [])
return { category: cat, row: row, column: column }; return { category: cat, row: row, column: column };
} }
} }
console.error('emoji not found in spritesheet', emojiCode);
return null; return null;
} }
@ -2420,10 +2422,11 @@ angular.module('myApp.services', [])
} }
else if (match[6]) { else if (match[6]) {
if (emojiCode = emojiMap[match[6]]) { if ((emojiCode = emojiMap[match[6]]) &&
emojiFound = true; (emojiCoords = getEmojiSpritesheetCoords(emojiCode))) {
emojiTitle = encodeEntities(emojiData[emojiCode][1][0]); emojiTitle = encodeEntities(emojiData[emojiCode][1][0]);
emojiCoords = getEmojiSpritesheetCoords(emojiCode); emojiFound = true;
html.push( html.push(
'<span class="emoji emoji-', '<span class="emoji emoji-',
emojiCoords.category, emojiCoords.category,

View File

@ -6,7 +6,7 @@
</div> </div>
<span <span
class="im_dialog_badge badge" class="im_dialog_badge badge"
ng-show="dialogMessage.unreadCount > 0" ng-show="dialogMessage.unreadCount > 0 &amp;&amp; !dialogMessage.out"
ng-bind="dialogMessage.unreadCount" ng-bind="dialogMessage.unreadCount"
></span> ></span>
<i <i

View File

@ -107,9 +107,12 @@
<div class="im_edit_panel_wrap clearfix" ng-show="selectActions" ng-class="{im_edit_panel_wrap_loaded: true}"> <div class="im_edit_panel_wrap clearfix" ng-show="selectActions" ng-class="{im_edit_panel_wrap_loaded: true}">
<div class="im_edit_panel_border"></div> <div class="im_edit_panel_border"></div>
<a class="im_edit_flush_link" ng-click="selectedFlush()"> <a class="im_edit_flush_link" ng-click="selectedFlush()" ng-show="historyPeer.id < 0">
Clear History Clear History
</a> </a>
<a class="im_edit_flush_link" ng-click="selectedFlush()" ng-show="historyPeer.id > 0">
Delete Chat
</a>
<a class="im_edit_cancel_link" ng-click="selectedCancel()"> <a class="im_edit_cancel_link" ng-click="selectedCancel()">
Cancel Cancel
</a> </a>