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 {
display: block;
}
.im_emoji_btn {
display: none;
}
}

View File

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

View File

@ -6,7 +6,7 @@
</div>
<span
class="im_dialog_badge badge"
ng-show="dialogMessage.unreadCount > 0"
ng-show="dialogMessage.unreadCount > 0 &amp;&amp; !dialogMessage.out"
ng-bind="dialogMessage.unreadCount"
></span>
<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_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
</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()">
Cancel
</a>