Browse Source

Saved messages

Closes #1548
Closes #1542
master
Igor Zhukov 7 years ago
parent
commit
90380025f6
  1. 21
      app/js/controllers.js
  2. 32
      app/js/directives.js
  3. 1
      app/js/locales/en-us.json
  4. 31
      app/js/messages_manager.js
  5. 12
      app/js/services.js
  6. 4
      app/partials/desktop/dialog.html
  7. 4
      app/partials/desktop/head.html
  8. 18
      app/partials/desktop/im.html
  9. 2
      app/partials/desktop/message.html
  10. 4
      app/partials/mobile/dialog.html
  11. 4
      app/partials/mobile/head.html
  12. 12
      app/partials/mobile/im.html

21
app/js/controllers.js

@ -790,7 +790,17 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
function sortDialogs () { function sortDialogs () {
var myID = false
if ($scope.forPeerSelect) {
myID = AppUsersManager.getSelf().id
}
$scope.dialogs.sort(function (d1, d2) { $scope.dialogs.sort(function (d1, d2) {
if (d1.peerID == myID) {
return -1
}
else if (d2.peerID == myID) {
return 1
}
return d2.index - d1.index return d2.index - d1.index
}) })
} }
@ -974,6 +984,13 @@ angular.module('myApp.controllers', ['myApp.i18n'])
if (curJump != jump) { if (curJump != jump) {
return $q.reject() return $q.reject()
} }
if (!query && !offsetIndex && $scope.forPeerSelect) {
var myID = AppUsersManager.getSelf().id
return AppMessagesManager.getConversation(myID).then(function (dialog) {
result.dialogs.unshift(dialog)
return result
})
}
return result return result
}) })
} }
@ -1017,9 +1034,13 @@ angular.module('myApp.controllers', ['myApp.i18n'])
if (searchMessages) { if (searchMessages) {
wrappedDialog.unreadCount = -1 wrappedDialog.unreadCount = -1
} else {
if (peersInDialogs[dialog.peerID]) {
return
} else { } else {
peersInDialogs[dialog.peerID] = true peersInDialogs[dialog.peerID] = true
} }
}
dialogsList.push(wrappedDialog) dialogsList.push(wrappedDialog)
}) })

32
app/js/directives.js

@ -3140,7 +3140,7 @@ angular.module('myApp.directives', ['myApp.filters'])
} }
}) })
.directive('myUserStatus', function ($filter, $rootScope, AppUsersManager) { .directive('myUserStatus', function (_, $filter, $rootScope, AppUsersManager) {
var statusFilter = $filter('userStatus') var statusFilter = $filter('userStatus')
var ind = 0 var ind = 0
var statuses = {} var statuses = {}
@ -3166,11 +3166,17 @@ angular.module('myApp.directives', ['myApp.filters'])
function link ($scope, element, attrs) { function link ($scope, element, attrs) {
var userID var userID
var curInd = ind++ var curInd = ind++
var forDialog = attrs.forDialog && $scope.$eval(attrs.forDialog)
var update = function () { var update = function () {
var user = AppUsersManager.getUser(userID) var user = AppUsersManager.getUser(userID)
if (forDialog && user.pFlags.self) {
element.html('')
} else {
element element
.html(statusFilter(user, attrs.botChatPrivacy)) .html(statusFilter(user, attrs.botChatPrivacy))
.toggleClass('status_online', (user.status && user.status._ == 'userStatusOnline') || false) .toggleClass('status_online', (user.status && user.status._ == 'userStatusOnline') || false)
}
// console.log(dT(), 'update status', element[0], user.status && user.status, tsNow(true), element.html()) // console.log(dT(), 'update status', element[0], user.status && user.status, tsNow(true), element.html())
} }
@ -3331,7 +3337,7 @@ angular.module('myApp.directives', ['myApp.filters'])
} }
}) })
.directive('myPeerLink', function ($rootScope, AppChatsManager, AppUsersManager, AppMessagesIDsManager) { .directive('myPeerLink', function (_, $rootScope, AppPeersManager, AppChatsManager, AppUsersManager, AppMessagesIDsManager) {
return { return {
link: link link: link
} }
@ -3340,6 +3346,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var override = attrs.userOverride && $scope.$eval(attrs.userOverride) || {} var override = attrs.userOverride && $scope.$eval(attrs.userOverride) || {}
var short = attrs.short && $scope.$eval(attrs.short) var short = attrs.short && $scope.$eval(attrs.short)
var username = attrs.username && $scope.$eval(attrs.username) var username = attrs.username && $scope.$eval(attrs.username)
var forDialog = attrs.forDialog && $scope.$eval(attrs.forDialog)
var peerID var peerID
var update = function () { var update = function () {
@ -3348,6 +3355,9 @@ angular.module('myApp.directives', ['myApp.filters'])
} }
if (peerID > 0) { if (peerID > 0) {
var user = AppUsersManager.getUser(peerID) var user = AppUsersManager.getUser(peerID)
if (forDialog && user.pFlags.self) {
element.text(_('user_name_saved_msgs_raw'))
} else {
var prefix = username ? '@' : '' var prefix = username ? '@' : ''
var key = username ? 'username' : (short ? 'rFirstName' : 'rFullName') var key = username ? 'username' : (short ? 'rFirstName' : 'rFullName')
@ -3356,9 +3366,11 @@ angular.module('myApp.directives', ['myApp.filters'])
(override[key] || user[key] || '').valueOf() + (override[key] || user[key] || '').valueOf() +
(attrs.verified && user.pFlags && user.pFlags.verified ? ' <i class="icon-verified"></i>' : '') (attrs.verified && user.pFlags && user.pFlags.verified ? ' <i class="icon-verified"></i>' : '')
) )
if (attrs.color && $scope.$eval(attrs.color)) { if (attrs.color && $scope.$eval(attrs.color)) {
element.addClass('user_color_' + user.num) element.addClass('user_color_' + user.num)
} }
}
} else { } else {
var chat = AppChatsManager.getChat(-peerID) var chat = AppChatsManager.getChat(-peerID)
@ -3375,12 +3387,19 @@ angular.module('myApp.directives', ['myApp.filters'])
AppUsersManager.openUser(peerID, override) AppUsersManager.openUser(peerID, override)
} else { } else {
var chatID = -peerID var chatID = -peerID
var postID = $scope.$eval(attrs.postId) var postID = attrs.postId && $scope.$eval(attrs.postId)
var savedFrom = attrs.savedFrom && $scope.$eval(attrs.savedFrom)
if (postID) { if (postID) {
$rootScope.$broadcast('history_focus', { $rootScope.$broadcast('history_focus', {
peerString: AppChatsManager.getChatString(chatID), peerString: AppChatsManager.getChatString(chatID),
messageID: AppMessagesIDsManager.getFullMessageID(parseInt(postID), chatID) messageID: AppMessagesIDsManager.getFullMessageID(parseInt(postID), chatID)
}) })
} else if (savedFrom) {
var peerMid = savedFrom.split('_')
$rootScope.$broadcast('history_focus', {
peerString: AppPeersManager.getPeerString(peerMid[0]),
messageID: peerMid[1]
})
} else { } else {
AppChatsManager.openChat(chatID) AppChatsManager.openChat(chatID)
} }
@ -3426,6 +3445,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var initEl = $('<span class="peer_initials nocopy ' + (attrs.imgClass || '') + '"></span>') var initEl = $('<span class="peer_initials nocopy ' + (attrs.imgClass || '') + '"></span>')
var jump = 0 var jump = 0
var prevClass = false var prevClass = false
var forDialog = attrs.forDialog && $scope.$eval(attrs.forDialog)
var setPeerID = function (newPeerID) { var setPeerID = function (newPeerID) {
if (peerID == newPeerID) { if (peerID == newPeerID) {
@ -3453,6 +3473,12 @@ angular.module('myApp.directives', ['myApp.filters'])
peerPhoto = peer.photo && angular.copy(peer.photo.photo_small) peerPhoto = peer.photo && angular.copy(peer.photo.photo_small)
if (forDialog && peer.pFlags && peer.pFlags.self) {
initEl.remove()
imgEl.prependTo(element).attr('src', 'img/icons/icon120.png')
return
}
var hasPhoto = peerPhoto !== undefined var hasPhoto = peerPhoto !== undefined
if (hasPhoto) { if (hasPhoto) {

1
app/js/locales/en-us.json

@ -169,6 +169,7 @@
"user_name_deleted": "DELETED", "user_name_deleted": "DELETED",
"user_first_name_deleted": "DELETED", "user_first_name_deleted": "DELETED",
"user_name_saved_msgs": "Saved Messages",
"user_status_online": "online", "user_status_online": "online",
"user_status_last_seen": "last seen {0}", "user_status_last_seen": "last seen {0}",
"user_status_recently": "last seen recently", "user_status_recently": "last seen recently",

31
app/js/messages_manager.js

@ -116,6 +116,19 @@ angular.module('myApp.services')
}) })
} }
function getConversation(peerID) {
var foundDialog = getDialogByPeerID(peerID)
if (foundDialog.length) {
return $q.when(foundDialog[0])
}
return $q.when({
peerID: peerID,
top_message: 0,
index: generateDialogIndex(generateDialogPinnedDate()),
pFlags: {}
})
}
function getDialogByPeerID (peerID) { function getDialogByPeerID (peerID) {
for (var i = 0; i < dialogsStorage.dialogs.length; i++) { for (var i = 0; i < dialogsStorage.dialogs.length; i++) {
if (dialogsStorage.dialogs[i].peerID == peerID) { if (dialogsStorage.dialogs[i].peerID == peerID) {
@ -1376,16 +1389,25 @@ angular.module('myApp.services')
apiMessage.date -= ServerTimeManager.serverTimeOffset apiMessage.date -= ServerTimeManager.serverTimeOffset
apiMessage.peerID = peerID
apiMessage.fromID = apiMessage.pFlags.post ? peerID : apiMessage.from_id
var fwdHeader = apiMessage.fwd_from var fwdHeader = apiMessage.fwd_from
if (fwdHeader) { if (fwdHeader) {
if (peerID == AppUsersManager.getSelf().id) {
if (fwdHeader.saved_from_peer && fwdHeader.saved_from_msg_id) {
var savedFromPeerID = AppPeersManager.getPeerID(fwdHeader.saved_from_peer)
var savedFromMid = AppMessagesIDsManager.getFullMessageID(fwdHeader.saved_from_msg_id, AppPeersManager.isChannel(savedFromPeerID) ? -savedFromPeerID : 0)
apiMessage.savedFrom = savedFromPeerID + '_' + savedFromMid
}
apiMessage.fromID = fwdHeader.channel_id ? -fwdHeader.channel_id : fwdHeader.from_id
} else {
apiMessage.fwdFromID = fwdHeader.channel_id ? -fwdHeader.channel_id : fwdHeader.from_id apiMessage.fwdFromID = fwdHeader.channel_id ? -fwdHeader.channel_id : fwdHeader.from_id
apiMessage.fwdPostID = fwdHeader.channel_post apiMessage.fwdPostID = fwdHeader.channel_post
}
fwdHeader.date -= ServerTimeManager.serverTimeOffset fwdHeader.date -= ServerTimeManager.serverTimeOffset
} }
apiMessage.peerID = peerID
apiMessage.fromID = apiMessage.pFlags.post ? peerID : apiMessage.from_id
if (apiMessage.via_bot_id > 0) { if (apiMessage.via_bot_id > 0) {
apiMessage.viaBotID = apiMessage.via_bot_id apiMessage.viaBotID = apiMessage.via_bot_id
} }
@ -2362,7 +2384,7 @@ angular.module('myApp.services')
to_id: AppPeersManager.getOutputPeer(dialog.peerID), to_id: AppPeersManager.getOutputPeer(dialog.peerID),
deleted: true, deleted: true,
date: tsNow(true), date: tsNow(true),
pFlags: {} pFlags: {out: true}
} }
} else { } else {
return message return message
@ -3754,6 +3776,7 @@ angular.module('myApp.services')
return { return {
getConversations: getConversations, getConversations: getConversations,
getConversation: getConversation,
getHistory: getHistory, getHistory: getHistory,
getSearch: getSearch, getSearch: getSearch,
getMessage: getMessage, getMessage: getMessage,

12
app/js/services.js

@ -52,8 +52,16 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
if (!user) { if (!user) {
return false return false
} }
var serviceText = ''
if (user.pFlags.self) {
serviceText = _('user_name_saved_msgs_raw')
}
return (user.first_name || '') + ' ' + (user.last_name || '') + ' ' + (user.phone || '') + ' ' + (user.username || '') return (user.first_name || '') +
' ' + (user.last_name || '') +
' ' + (user.phone || '') +
' ' + (user.username || '') +
' ' + serviceText
} }
function getContacts (query) { function getContacts (query) {
@ -4385,6 +4393,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var scope = $rootScope.$new() var scope = $rootScope.$new()
scope.multiSelect = false scope.multiSelect = false
scope.noMessages = true scope.noMessages = true
scope.forPeerSelect = true
if (options) { if (options) {
angular.extend(scope, options) angular.extend(scope, options)
} }
@ -4408,6 +4417,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var scope = $rootScope.$new() var scope = $rootScope.$new()
scope.multiSelect = true scope.multiSelect = true
scope.noMessages = true scope.noMessages = true
scope.forPeerSelect = true
if (options) { if (options) {
angular.extend(scope, options) angular.extend(scope, options)
} }

4
app/partials/desktop/dialog.html

@ -18,12 +18,12 @@
></i> ></i>
</div> </div>
<div class="im_dialog_photo pull-left" my-peer-photolink="::dialogMessage.peerID" img-class="im_dialog_photo" watch="true"></div> <div class="im_dialog_photo pull-left" my-peer-photolink="::dialogMessage.peerID" img-class="im_dialog_photo" watch="true" for-dialog="true"></div>
<div class="im_dialog_message_wrap"> <div class="im_dialog_message_wrap">
<div class="im_dialog_peer"> <div class="im_dialog_peer">
<span my-peer-link="dialogMessage.peerID" verified="true"></span> <span my-peer-link="dialogMessage.peerID" verified="true" for-dialog="true"></span>
</div> </div>
<div ng-switch="dialogMessage.typing ? 'typing' : (!dialogMessage.unreadCount && dialogMessage.draft ? 'draft' : (dialogMessage.deleted ? 'deleted' : 'message'))"> <div ng-switch="dialogMessage.typing ? 'typing' : (!dialogMessage.unreadCount && dialogMessage.draft ? 'draft' : (dialogMessage.deleted ? 'deleted' : 'message'))">

4
app/partials/desktop/head.html

@ -99,9 +99,9 @@
<a class="tg_head_btn" ng-switch-default ng-click="showPeerInfo()"> <a class="tg_head_btn" ng-switch-default ng-click="showPeerInfo()">
<div class="tg_head_peer_info"> <div class="tg_head_peer_info">
<span class="tg_head_peer_title" my-peer-link="historyPeer.id" peer-watch="true" dir="auto"></span> <span class="tg_head_peer_title" my-peer-link="historyPeer.id" peer-watch="true" dir="auto" for-dialog="true"></span>
<span class="tg_head_peer_status" ng-switch="historyPeer.id > 0"> <span class="tg_head_peer_status" ng-switch="historyPeer.id > 0">
<span ng-switch-when="true" my-user-status="historyPeer.id"></span> <span ng-switch-when="true" my-user-status="historyPeer.id" for-dialog="true"></span>
<span ng-switch-default my-chat-status="-historyPeer.id"></span> <span ng-switch-default my-chat-status="-historyPeer.id"></span>
</span> </span>
</div> </div>

18
app/partials/desktop/im.html

@ -36,12 +36,12 @@
</div> </div>
</div> </div>
<div class="im_dialog_photo pull-left" my-peer-photolink="searchPeer" img-class="im_dialog_photo" watch="true"></div> <div class="im_dialog_photo pull-left" my-peer-photolink="searchPeer" img-class="im_dialog_photo" watch="true" for-dialog="true"></div>
<div class="im_dialog_message_wrap"> <div class="im_dialog_message_wrap">
<div class="im_dialog_peer"> <div class="im_dialog_peer">
<span my-peer-link="searchPeer"></span> <span my-peer-link="searchPeer" for-dialog="true"></span>
</div> </div>
<div class="im_dialog_message"> <div class="im_dialog_message">
@ -61,13 +61,13 @@
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li class="im_dialog_wrap" ng-repeat="myResult in myResults track by myResult.id" ng-class="{active: curDialog.peerID == myResult.id}"> <li class="im_dialog_wrap" ng-repeat="myResult in myResults track by myResult.id" ng-class="{active: curDialog.peerID == myResult.id}">
<a class="im_dialog" ng-mousedown="dialogSelect(myResult.peerString)"> <a class="im_dialog" ng-mousedown="dialogSelect(myResult.peerString)">
<div class="im_dialog_photo pull-left" my-peer-photolink="myResult.id" img-class="im_dialog_photo" watch="true"></div> <div class="im_dialog_photo pull-left" my-peer-photolink="myResult.id" img-class="im_dialog_photo" watch="true" for-dialog="true"></div>
<div class="im_dialog_message_wrap"> <div class="im_dialog_message_wrap">
<div class="im_dialog_peer"> <div class="im_dialog_peer">
<span class="im_dialog_user" my-peer-link="myResult.id" verified="true"></span> <span class="im_dialog_user" my-peer-link="myResult.id" verified="true" for-dialog="true"></span>
</div> </div>
<div class="im_dialog_message" ng-switch="myResult.id > 0"> <div class="im_dialog_message" ng-switch="myResult.id > 0">
<span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::myResult.id"></span> <span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::myResult.id" for-dialog="true"></span>
<span ng-switch-default class="im_dialog_message_text" my-chat-status="::-myResult.id"></span> <span ng-switch-default class="im_dialog_message_text" my-chat-status="::-myResult.id"></span>
</div> </div>
</div> </div>
@ -81,15 +81,15 @@
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li class="im_dialog_wrap" ng-repeat="foundPeer in foundPeers track by foundPeer.id" ng-class="{active: curDialog.peerID == foundPeer.id}"> <li class="im_dialog_wrap" ng-repeat="foundPeer in foundPeers track by foundPeer.id" ng-class="{active: curDialog.peerID == foundPeer.id}">
<a class="im_dialog" ng-mousedown="dialogSelect(foundPeer.peerString)"> <a class="im_dialog" ng-mousedown="dialogSelect(foundPeer.peerString)">
<div class="im_dialog_photo pull-left" my-peer-photolink="foundPeer.id" img-class="im_dialog_photo" watch="true"></div> <div class="im_dialog_photo pull-left" my-peer-photolink="foundPeer.id" img-class="im_dialog_photo" watch="true" for-dialog="true"></div>
<div class="im_dialog_message_wrap"> <div class="im_dialog_message_wrap">
<div class="im_dialog_peer"> <div class="im_dialog_peer">
<span class="im_dialog_user" my-peer-link="foundPeer.id" verified="true"></span> <span class="im_dialog_user" my-peer-link="foundPeer.id" verified="true" for-dialog="true"></span>
</div> </div>
<div class="im_dialog_message"> <div class="im_dialog_message">
<span class="im_dialog_message_text" ng-switch="foundPeer.id > 0"> <span class="im_dialog_message_text" ng-switch="foundPeer.id > 0">
<span ng-bind="::'@' + foundPeer.username + ', '"></span> <span ng-bind="::'@' + foundPeer.username + ', '"></span>
<span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::foundPeer.id"></span> <span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::foundPeer.id" for-dialog="true"></span>
<span ng-switch-default class="im_dialog_message_text" my-chat-status="::-foundPeer.id"></span> <span ng-switch-default class="im_dialog_message_text" my-chat-status="::-foundPeer.id"></span>
</span> </span>
</div> </div>
@ -212,7 +212,7 @@
<div class="im_send_form_wrap clearfix" ng-controller="AppImSendController" ng-class="{im_send_reply_form_wrap: draftMessage.replyToMsgID > 0}"> <div class="im_send_form_wrap clearfix" ng-controller="AppImSendController" ng-class="{im_send_reply_form_wrap: draftMessage.replyToMsgID > 0}">
<a class="pull-right im_panel_peer_photo" my-peer-photolink="historyPeer.id" img-class="im_panel_peer_photo" watch="true" ng-show="!draftMessage.isBroadcast"> <a class="pull-right im_panel_peer_photo" my-peer-photolink="historyPeer.id" img-class="im_panel_peer_photo" watch="true" for-dialog="true" ng-show="!draftMessage.isBroadcast">
<i class="icon im_panel_peer_online" ng-show="historyPeer.id > 0 &amp;&amp; historyPeer.data.status._ == 'userStatusOnline'"></i> <i class="icon im_panel_peer_online" ng-show="historyPeer.id > 0 &amp;&amp; historyPeer.data.status._ == 'userStatusOnline'"></i>
</a> </a>
<a class="pull-left im_panel_own_photo" my-peer-photolink="draftMessage.isBroadcast ? historyPeer.id : ownID" img-class="im_panel_own_photo" watch="true" ng-click="openSettings()" no-open="true"></a> <a class="pull-left im_panel_own_photo" my-peer-photolink="draftMessage.isBroadcast ? historyPeer.id : ownID" img-class="im_panel_own_photo" watch="true" ng-click="openSettings()" no-open="true"></a>

2
app/partials/desktop/message.html

@ -47,7 +47,7 @@
<div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media ? true : false}"> <div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media ? true : false}">
<span class="im_message_author_wrap"> <span class="im_message_author_wrap">
<span class="copyonly">[<span ng-bind="::historyMessage.date | time"></span>] </span><a class="im_message_author" my-peer-link="historyMessage.fromID" short="historyMessage.peerID > 0" color="historyMessage.peerID < 0" no-watch="true"></a><a ng-if="::historyMessage.viaBotID && !historyMessage.fwdFromID" class="im_message_author_via" ng-click="selectInlineBot(historyMessage.viaBotID, $event)"><span class="copyonly">&nbsp;</span><span my-i18n="message_via_bot"><my-i18n-param name="bot"><span class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></span></my-i18n-param></span></a><span class="copyonly">:</span><span class="im_message_author_admin" my-message-admin-badge="historyMessage"></span> <span class="copyonly">[<span ng-bind="::historyMessage.date | time"></span>] </span><a class="im_message_author" my-peer-link="historyMessage.fromID" short="historyMessage.peerID > 0" color="historyMessage.peerID < 0" no-watch="true" saved-from="historyMessage.savedFrom"></a><a ng-if="::historyMessage.viaBotID && !historyMessage.fwdFromID" class="im_message_author_via" ng-click="selectInlineBot(historyMessage.viaBotID, $event)"><span class="copyonly">&nbsp;</span><span my-i18n="message_via_bot"><my-i18n-param name="bot"><span class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></span></my-i18n-param></span></a><span class="copyonly">:</span><span class="im_message_author_admin" my-message-admin-badge="historyMessage"></span>
</span> </span>

4
app/partials/mobile/dialog.html

@ -18,12 +18,12 @@
></i> ></i>
</div> </div>
<div class="im_dialog_photo pull-left" my-peer-photolink="::dialogMessage.peerID" img-class="im_dialog_photo" watch="true"></div> <div class="im_dialog_photo pull-left" my-peer-photolink="::dialogMessage.peerID" img-class="im_dialog_photo" watch="true" for-dialog="true"></div>
<div class="im_dialog_message_wrap" ng-class="{im_dialog_message_wtyping: dialogMessage.typing > 0}"> <div class="im_dialog_message_wrap" ng-class="{im_dialog_message_wtyping: dialogMessage.typing > 0}">
<div class="im_dialog_peer"> <div class="im_dialog_peer">
<span my-peer-link="dialogMessage.peerID" verified="true"></span> <span my-peer-link="dialogMessage.peerID" verified="true" for-dialog="true"></span>
</div> </div>
<div ng-switch="dialogMessage.typing ? 'typing' : (!dialogMessage.unreadCount && dialogMessage.draft ? 'draft' : (dialogMessage.deleted ? 'deleted' : 'message'))"> <div ng-switch="dialogMessage.typing ? 'typing' : (!dialogMessage.unreadCount && dialogMessage.draft ? 'draft' : (dialogMessage.deleted ? 'deleted' : 'message'))">

4
app/partials/mobile/head.html

@ -81,7 +81,7 @@
<span ng-switch-when="1" class="status_online"> <span ng-switch-when="1" class="status_online">
<my-i18n msgid="head_typing"></my-i18n><span my-loading-dots></span> <my-i18n msgid="head_typing"></my-i18n><span my-loading-dots></span>
</span> </span>
<span ng-switch-default my-user-status="historyPeer.id"></span> <span ng-switch-default my-user-status="historyPeer.id" for-dialog="true"></span>
</small> </small>
</div> </div>
</a> </a>
@ -90,7 +90,7 @@
<a href="#/im" class="navbar-quick-group-back"> <a href="#/im" class="navbar-quick-group-back">
<i class="icon icon-back"></i> <i class="icon icon-back"></i>
<div class="navbar-quick-back-title"> <div class="navbar-quick-back-title">
<h4 my-peer-link="historyPeer.id" peer-watch="true"></h4> <h4 my-peer-link="historyPeer.id" peer-watch="true" for-dialog="true"></h4>
<small ng-switch="historyState.typing.length"> <small ng-switch="historyState.typing.length">
<span ng-switch-when="0" class="tg_head_peer_status" my-chat-status="-historyPeer.id"></span> <span ng-switch-when="0" class="tg_head_peer_status" my-chat-status="-historyPeer.id"></span>
<my-i18n> <my-i18n>

12
app/partials/mobile/im.html

@ -32,13 +32,13 @@
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li class="im_dialog_wrap" ng-repeat="myResult in myResults track by myResult.id" ng-class="{active: curDialog.peerID == myResult.id}"> <li class="im_dialog_wrap" ng-repeat="myResult in myResults track by myResult.id" ng-class="{active: curDialog.peerID == myResult.id}">
<a class="im_dialog" ng-mousedown="dialogSelect(myResult.peerString)"> <a class="im_dialog" ng-mousedown="dialogSelect(myResult.peerString)">
<div class="im_dialog_photo pull-left" my-peer-photolink="myResult.id" img-class="im_dialog_photo" watch="true"></div> <div class="im_dialog_photo pull-left" my-peer-photolink="myResult.id" img-class="im_dialog_photo" watch="true" for-dialog="true"></div>
<div class="im_dialog_message_wrap"> <div class="im_dialog_message_wrap">
<div class="im_dialog_peer"> <div class="im_dialog_peer">
<span class="im_dialog_user" my-peer-link="myResult.id" verified="true"></span> <span class="im_dialog_user" my-peer-link="myResult.id" verified="true" for-dialog="true"></span>
</div> </div>
<div class="im_dialog_message" ng-switch="myResult.id > 0"> <div class="im_dialog_message" ng-switch="myResult.id > 0">
<span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::myResult.id"></span> <span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::myResult.id" for-dialog="true"></span>
<span ng-switch-default class="im_dialog_message_text" my-chat-status="::-myResult.id"></span> <span ng-switch-default class="im_dialog_message_text" my-chat-status="::-myResult.id"></span>
</div> </div>
</div> </div>
@ -52,15 +52,15 @@
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li class="im_dialog_wrap" ng-repeat="foundPeer in foundPeers track by foundPeer.id" ng-class="{active: curDialog.peerID == foundPeer.id}"> <li class="im_dialog_wrap" ng-repeat="foundPeer in foundPeers track by foundPeer.id" ng-class="{active: curDialog.peerID == foundPeer.id}">
<a class="im_dialog" ng-mousedown="dialogSelect(foundPeer.peerString)"> <a class="im_dialog" ng-mousedown="dialogSelect(foundPeer.peerString)">
<div class="im_dialog_photo pull-left" my-peer-photolink="foundPeer.id" img-class="im_dialog_photo" watch="true"></div> <div class="im_dialog_photo pull-left" my-peer-photolink="foundPeer.id" img-class="im_dialog_photo" watch="true" for-dialog="true"></div>
<div class="im_dialog_message_wrap"> <div class="im_dialog_message_wrap">
<div class="im_dialog_peer"> <div class="im_dialog_peer">
<span class="im_dialog_user" my-peer-link="foundPeer.id" verified="true"></span> <span class="im_dialog_user" my-peer-link="foundPeer.id" verified="true" for-dialog="true"></span>
</div> </div>
<div class="im_dialog_message"> <div class="im_dialog_message">
<span class="im_dialog_message_text" ng-switch="foundPeer.id > 0"> <span class="im_dialog_message_text" ng-switch="foundPeer.id > 0">
<span ng-bind="::'@' + foundPeer.username + ', '"></span> <span ng-bind="::'@' + foundPeer.username + ', '"></span>
<span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::foundPeer.id"></span> <span ng-switch-when="true" class="im_dialog_message_text" my-user-status="::foundPeer.id" for-dialog="true"></span>
<span ng-switch-default class="im_dialog_message_text" my-chat-status="::-foundPeer.id"></span> <span ng-switch-default class="im_dialog_message_text" my-chat-status="::-foundPeer.id"></span>
</span> </span>
</div> </div>

Loading…
Cancel
Save