Browse Source

Merge branch 'layer-41'

master
Igor Zhukov 9 years ago
parent
commit
8894ab961f
  1. 64
      app/js/controllers.js
  2. 22
      app/js/directives.js
  3. 2
      app/js/filters.js
  4. 4
      app/js/lib/config.js
  5. 77
      app/js/lib/schema.tl.txt
  6. 31
      app/js/lib/tl_utils.js
  7. 4
      app/js/locales/en-us.json
  8. 531
      app/js/messages_manager.js
  9. 82
      app/js/services.js
  10. 2
      app/less/app.less
  11. 2
      app/partials/desktop/audio_player.html
  12. 2
      app/partials/desktop/chat_modal.html
  13. 8
      app/partials/desktop/dialog.html
  14. 24
      app/partials/desktop/dialog_service.html
  15. 4
      app/partials/desktop/message.html
  16. 24
      app/partials/desktop/message_service.html
  17. 2
      app/partials/desktop/user_modal.html
  18. 2
      app/partials/mobile/audio_player.html
  19. 2
      app/partials/mobile/chat_modal.html
  20. 8
      app/partials/mobile/dialog.html
  21. 4
      app/partials/mobile/message.html
  22. 24
      app/partials/mobile/message_service.html
  23. 2
      app/partials/mobile/user_modal.html

64
app/js/controllers.js

@ -749,7 +749,9 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -749,7 +749,9 @@ angular.module('myApp.controllers', ['myApp.i18n'])
case 'updateUserTyping':
case 'updateChatUserTyping':
if (!AppUsersManager.hasUser(update.user_id)) {
if (update.chat_id) {
if (update.chat_id &&
AppChatsManager.hasChat(update.chat_id) &&
!AppChatsManager.isChannel(update.chat_id)) {
AppProfileManager.getChatFull(update.chat_id);
}
return;
@ -1109,9 +1111,10 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1109,9 +1111,10 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$rootScope.selectedPeerID = peerID;
$scope.curDialog.peerID = peerID;
$scope.curDialog.inputPeer = AppPeersManager.getInputPeer(newPeer);
$scope.historyFilter.mediaType = false;
AppPeersManager.getInputPeer(newPeer);
updateBotActions();
selectedCancel(true);
@ -1241,7 +1244,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1241,7 +1244,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
AppPeersManager.isChannel(peerID) &&
(channel = AppChatsManager.getChat(-peerID))) {
var canSend = channel.pFlags.creator || channel.pFlags.editor;
var canSend = AppChatsManager.hasRights(-peerID, 'send');
if (!canSend) {
if (channel.pFlags.left) {
$scope.historyState.channelActions = 'join';
@ -1307,7 +1310,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1307,7 +1310,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
curLessJump = ++lessJump,
limit = 0,
backLimit = 20;
AppMessagesManager.getHistory($scope.curDialog.inputPeer, minID, limit, backLimit).then(function (historyResult) {
AppMessagesManager.getHistory($scope.curDialog.peerID, minID, limit, backLimit).then(function (historyResult) {
lessActive = false;
if (curJump != jump || curLessJump != lessJump) return;
@ -1356,8 +1359,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1356,8 +1359,8 @@ angular.module('myApp.controllers', ['myApp.i18n'])
inputMediaFilter = $scope.historyFilter.mediaType && {_: inputMediaFilters[$scope.historyFilter.mediaType]},
limit = Config.Mobile ? 20 : 0,
getMessagesPromise = inputMediaFilter
? AppMessagesManager.getSearch($scope.curDialog.inputPeer, '', inputMediaFilter, maxID, limit)
: AppMessagesManager.getHistory($scope.curDialog.inputPeer, maxID, limit);
? AppMessagesManager.getSearch($scope.curDialog.peerID, '', inputMediaFilter, maxID, limit)
: AppMessagesManager.getHistory($scope.curDialog.peerID, maxID, limit);
getMessagesPromise.then(function (historyResult) {
moreActive = false;
@ -1423,8 +1426,8 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1423,8 +1426,8 @@ angular.module('myApp.controllers', ['myApp.i18n'])
var curJump = ++jump,
inputMediaFilter = $scope.historyFilter.mediaType && {_: inputMediaFilters[$scope.historyFilter.mediaType]},
getMessagesPromise = inputMediaFilter
? AppMessagesManager.getSearch($scope.curDialog.inputPeer, '', inputMediaFilter, maxID)
: AppMessagesManager.getHistory($scope.curDialog.inputPeer, maxID, limit, backLimit, prerenderedLen);
? AppMessagesManager.getSearch($scope.curDialog.peerID, '', inputMediaFilter, maxID)
: AppMessagesManager.getHistory($scope.curDialog.peerID, maxID, limit, backLimit, prerenderedLen);
$scope.state.mayBeHasMore = true;
@ -1452,7 +1455,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1452,7 +1455,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
angular.forEach(historyResult.history, function (id) {
var message = AppMessagesManager.wrapForHistory(id);
if ($scope.historyState.skipped) {
delete message.unread;
delete message.pFlags.unread;
}
if (historyResult.unreadOffset) {
message.unreadAfter = true;
@ -1489,7 +1492,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1489,7 +1492,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}, 2800);
}
AppMessagesManager.readHistory($scope.curDialog.inputPeer);
AppMessagesManager.readHistory($scope.curDialog.peerID);
updateBotActions();
updateChannelActions();
@ -1664,7 +1667,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1664,7 +1667,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
function selectedFlush () {
ErrorService.confirm({type: 'HISTORY_FLUSH'}).then(function () {
AppMessagesManager.flushHistory($scope.curDialog.inputPeer).then(function () {
AppMessagesManager.flushHistory($scope.curDialog.peerID).then(function () {
selectedCancel();
});
})
@ -1839,7 +1842,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1839,7 +1842,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.historyState.typing.splice(0, $scope.historyState.typing.length);
$scope.$broadcast('ui_history_append_new', {
my: addedMessage.my,
idleScroll: unreadAfterIdle && !historyMessage.out && $rootScope.idle.isIDLE
idleScroll: unreadAfterIdle && !historyMessage.pFlags.out && $rootScope.idle.isIDLE
});
if (addedMessage.my && $scope.historyUnreadAfter) {
delete $scope.historyUnreadAfter;
@ -1848,9 +1851,9 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1848,9 +1851,9 @@ angular.module('myApp.controllers', ['myApp.i18n'])
// console.log('append check', $rootScope.idle.isIDLE, addedMessage.peerID, $scope.curDialog.peerID, historyMessage, history.messages[history.messages.length - 2]);
if ($rootScope.idle.isIDLE) {
if (historyMessage.unread &&
!historyMessage.out &&
!(history.messages[history.messages.length - 2] || {}).unread) {
if (historyMessage.pFlags.unread &&
!historyMessage.pFlags.out &&
!(history.messages[history.messages.length - 2] || {}).pFlags.unread) {
$scope.historyUnreadAfter = historyMessage.mid;
unreadAfterIdle = true;
@ -1858,7 +1861,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1858,7 +1861,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
} else {
$timeout(function () {
AppMessagesManager.readHistory($scope.curDialog.inputPeer);
AppMessagesManager.readHistory($scope.curDialog.peerID);
});
}
@ -1910,7 +1913,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1910,7 +1913,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
var hasOut = false;
var unreadAfterNew = false;
var historyMessage = history.messages[history.messages.length - 1];
var lastIsRead = !historyMessage || !historyMessage.unread;
var lastIsRead = !historyMessage || !historyMessage.pFlags.unread;
for (i = 0; i < len; i++) {
messageID = msgs[i];
if (messageID < maxID ||
@ -1921,15 +1924,15 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1921,15 +1924,15 @@ angular.module('myApp.controllers', ['myApp.i18n'])
history.messages.push(historyMessage);
history.ids.push(messageID);
if (!unreadAfterNew && isIDLE) {
if (historyMessage.unread &&
!historyMessage.out &&
if (historyMessage.pFlags.unread &&
!historyMessage.pFlags.out &&
lastIsRead) {
unreadAfterNew = messageID;
} else {
lastIsRead = !historyMessage.unread;
lastIsRead = !historyMessage.pFlags.unread;
}
}
if (!hasOut && historyMessage.out) {
if (!hasOut && historyMessage.pFlags.out) {
hasOut = true;
}
}
@ -1955,7 +1958,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1955,7 +1958,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
} else {
$timeout(function () {
AppMessagesManager.readHistory($scope.curDialog.inputPeer);
AppMessagesManager.readHistory($scope.curDialog.peerID);
});
}
@ -2043,7 +2046,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -2043,7 +2046,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$rootScope.$watch('idle.isIDLE', function (newVal) {
if (!newVal && $scope.curDialog && $scope.curDialog.peerID && !$scope.historyFilter.mediaType && !$scope.historyState.skipped) {
AppMessagesManager.readHistory($scope.curDialog.inputPeer);
AppMessagesManager.readHistory($scope.curDialog.peerID);
}
if (!newVal) {
unreadAfterIdle = false;
@ -2217,7 +2220,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -2217,7 +2220,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
// console.log(dT(), 'reset draft', $scope.curDialog.peer, forceDraft);
if (forceDraft) {
if (forceDraft == $scope.curDialog.peer) {
$scope.draftMessage.isBroadcast = AppPeersManager.isChannel($scope.curDialog.peerID);
$scope.draftMessage.isBroadcast = AppPeersManager.isChannel($scope.curDialog.peerID) && !AppPeersManager.isMegagroup($scope.curDialog.peerID);
$scope.$broadcast('ui_peer_draft');
return;
} else {
@ -2231,7 +2234,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -2231,7 +2234,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
Storage.get('draft' + $scope.curDialog.peerID).then(function (draftText) {
// console.log('Restore draft', 'draft' + $scope.curDialog.peerID, draftText);
$scope.draftMessage.text = draftText || '';
$scope.draftMessage.isBroadcast = AppPeersManager.isChannel($scope.curDialog.peerID);
$scope.draftMessage.isBroadcast = AppPeersManager.isChannel($scope.curDialog.peerID) && !AppPeersManager.isMegagroup($scope.curDialog.peerID);
// console.log('send broadcast', $scope.draftMessage);
$scope.$broadcast('ui_peer_draft');
});
@ -2368,7 +2371,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -2368,7 +2371,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
if (newVal && newVal.length) {
if (!$scope.historyFilter.mediaType && !$scope.historyState.skipped) {
AppMessagesManager.readHistory($scope.curDialog.inputPeer);
AppMessagesManager.readHistory($scope.curDialog.peerID);
}
var backupDraftObj = {};
@ -2382,11 +2385,12 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -2382,11 +2385,12 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
function onTyping () {
if ($scope.curDialog.inputPeer._ == 'inputPeerChannel') {
if (AppPeersManager.isChannel($scope.curDialog.peerID) &&
!AppPeersManager.isMegagroup($scope.curDialog.peerID)) {
return false;
}
MtpApiManager.invokeApi('messages.setTyping', {
peer: $scope.curDialog.inputPeer,
peer: AppPeersManager.getInputPeerByID($scope.curDialog.peerID),
action: {_: 'sendMessageTypingAction'}
});
}
@ -3076,7 +3080,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -3076,7 +3080,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.flushHistory = function () {
ErrorService.confirm({type: 'HISTORY_FLUSH'}).then(function () {
AppMessagesManager.flushHistory(AppPeersManager.getInputPeerByID($scope.userID)).then(function () {
AppMessagesManager.flushHistory($scope.userID).then(function () {
$scope.goToHistory();
});
});
@ -3236,7 +3240,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -3236,7 +3240,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.flushHistory = function () {
ErrorService.confirm({type: 'HISTORY_FLUSH'}).then(function () {
AppMessagesManager.flushHistory(AppPeersManager.getInputPeerByID(-$scope.chatID)).then(function () {
AppMessagesManager.flushHistory(-$scope.chatID).then(function () {
$rootScope.$broadcast('history_focus', {peerString: $scope.chatFull.peerString});
});
});

22
app/js/directives.js

@ -116,8 +116,8 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -116,8 +116,8 @@ angular.module('myApp.directives', ['myApp.filters'])
});
var deregisterUnreadAfter;
if (!$scope.historyMessage.out &&
($scope.historyMessage.unread || $scope.historyMessage.unreadAfter)) {
if (!$scope.historyMessage.pFlags.out &&
($scope.historyMessage.pFlags.unread || $scope.historyMessage.unreadAfter)) {
var applyUnreadAfter = function () {
if ($scope.peerHistory.peerID != $scope.historyPeer.id) {
return;
@ -141,10 +141,10 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -141,10 +141,10 @@ angular.module('myApp.directives', ['myApp.filters'])
applyUnreadAfter();
deregisterUnreadAfter = $scope.$on('messages_unread_after', applyUnreadAfter);
}
if ($scope.historyMessage.unread && $scope.historyMessage.out) {
if ($scope.historyMessage.pFlags.unread && $scope.historyMessage.pFlags.out) {
element.addClass(unreadClass);
var deregisterUnread = $scope.$on('messages_read', function () {
if (!$scope.historyMessage.unread) {
if (!$scope.historyMessage.pFlags.unread) {
element.removeClass(unreadClass);
deregisterUnread();
if (deregisterUnreadAfter && !unreadAfter) {
@ -2519,7 +2519,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2519,7 +2519,7 @@ angular.module('myApp.directives', ['myApp.filters'])
})
.directive('myUserStatus', function ($filter, AppUsersManager) {
.directive('myUserStatus', function ($filter, $rootScope, AppUsersManager) {
var statusFilter = $filter('userStatus'),
ind = 0,
@ -2527,6 +2527,13 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2527,6 +2527,13 @@ angular.module('myApp.directives', ['myApp.filters'])
setInterval(updateAll, 90000);
$rootScope.$on('stateSynchronized', function () {
setTimeout(function () {
updateAll();
}, 100);
});
return {
link: link
};
@ -2545,6 +2552,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2545,6 +2552,7 @@ angular.module('myApp.directives', ['myApp.filters'])
element
.html(statusFilter(user, attrs.botChatPrivacy))
.toggleClass('status_online', user.status && user.status._ == 'userStatusOnline' || false);
// console.log(dT(), 'update status', element[0], user.status && user.status, tsNow(true), element.html());
};
$scope.$watch(attrs.myUserStatus, function (newUserID) {
@ -2947,8 +2955,8 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2947,8 +2955,8 @@ angular.module('myApp.directives', ['myApp.filters'])
$scope.mediaPlayer.player.play();
if ($scope.message &&
!$scope.message.out &&
$scope.message.media_unread) {
!$scope.message.pFlags.out &&
$scope.message.pFlags.media_unread) {
AppMessagesManager.readMessages([$scope.message.mid]);
}
}, 300);

2
app/js/filters.js

@ -54,7 +54,7 @@ angular.module('myApp.filters', ['myApp.i18n']) @@ -54,7 +54,7 @@ angular.module('myApp.filters', ['myApp.i18n'])
case 'userStatusBot':
if (botChatPrivacy) {
if (user.pFlags.botNoPrivacy) {
if (user.pFlags.bot_chat_history) {
return _('user_status_bot_noprivacy');
} else {
return _('user_status_bot_privacy');

4
app/js/lib/config.js

File diff suppressed because one or more lines are too long

77
app/js/lib/schema.tl.txt

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
true#3fedd339 = True;
vector#1cb5c415 {t:Type} # [ t ] = Vector t;
error#c4b9f9bb code:int text:string = Error;
@ -80,7 +82,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL @@ -80,7 +82,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL
fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
userEmpty#200250ba id:int = User;
user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User;
user#22e49072 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
@ -93,25 +95,27 @@ userStatusLastWeek#7bf09fc = UserStatus; @@ -93,25 +95,27 @@ userStatusLastWeek#7bf09fc = UserStatus;
userStatusLastMonth#77ebc742 = UserStatus;
chatEmpty#9ba2d800 id:int = Chat;
chat#7312bc48 flags:# id:int title:string photo:ChatPhoto participants_count:int date:int version:int = Chat;
chat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat;
chatForbidden#7328bdb id:int title:string = Chat;
channel#678e9587 flags:# id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int = Chat;
channel#678e9587 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int = Chat;
channelForbidden#2d85832c id:int access_hash:long title:string = Chat;
chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;
channelFull#fab31aa3 flags:# id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite = ChatFull;
channelFull#9e341ddf flags:# can_view_participants:flags.3?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int = ChatFull;
chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
chatParticipantCreator#da13538a user_id:int = ChatParticipant;
chatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;
chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;
chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
chatParticipants#3f460fed chat_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
chatPhotoEmpty#37c1011c = ChatPhoto;
chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
messageEmpty#83e5de54 id:int = Message;
message#5ba66c13 flags:# id:int from_id:flags.8?int to_id:Peer fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int = Message;
messageService#c06b9607 flags:# id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message;
message#5ba66c13 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:flags.8?int to_id:Peer fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int = Message;
messageService#c06b9607 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia;
@ -129,10 +133,12 @@ messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction; @@ -129,10 +133,12 @@ messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
messageActionChatDeletePhoto#95e3fbef = MessageAction;
messageActionChatAddUser#5e3cfc4b user_id:int = MessageAction;
messageActionChatAddUser#488a7337 users:Vector<int> = MessageAction;
messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
messageActionChannelCreate#95d2ac92 title:string = MessageAction;
messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;
messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;
dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
dialogChannel#5b8496b2 peer:Peer top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int notify_settings:PeerNotifySettings pts:int = Dialog;
@ -260,6 +266,8 @@ updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update; @@ -260,6 +266,8 @@ updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
updateReadChannelInbox#4214f37f channel_id:int max_id:int = Update;
updateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector<int> pts:int pts_count:int = Update;
updateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;
updateChatAdmins#6e947941 chat_id:int enabled:Bool version:int = Update;
updateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -268,12 +276,12 @@ updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Ve @@ -268,12 +276,12 @@ updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Ve
updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
updatesTooLong#e317af7e = Updates;
updateShortMessage#f7d91a46 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
updateShortChatMessage#cac7fdd2 flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
updateShortMessage#f7d91a46 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
updateShortChatMessage#cac7fdd2 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
updateShortSentMessage#11f1331c flags:# id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
updateShortSentMessage#11f1331c flags:# unread:flags.0?true out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
@ -282,9 +290,9 @@ photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo; @@ -282,9 +290,9 @@ photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
dcOption#5d8c6cc flags:# id:int ip_address:string port:int = DcOption;
dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true id:int ip_address:string port:int = DcOption;
config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
config#6cb6e65e date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
@ -421,13 +429,13 @@ chatInviteEmpty#69df3769 = ExportedChatInvite; @@ -421,13 +429,13 @@ chatInviteEmpty#69df3769 = ExportedChatInvite;
chatInviteExported#fc2e05bc link:string = ExportedChatInvite;
chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
chatInvite#93e99b60 flags:# title:string = ChatInvite;
chatInvite#93e99b60 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string = ChatInvite;
inputStickerSetEmpty#ffb62b95 = InputStickerSet;
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
stickerSet#cd303b41 flags:# id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;
stickerSet#cd303b41 flags:# installed:flags.0?true disabled:flags.1?true official:flags.2?true id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
@ -440,9 +448,9 @@ keyboardButton#a2fa4880 text:string = KeyboardButton; @@ -440,9 +448,9 @@ keyboardButton#a2fa4880 text:string = KeyboardButton;
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
replyKeyboardHide#a03e5b85 flags:# = ReplyMarkup;
replyKeyboardForceReply#f4108aa0 flags:# = ReplyMarkup;
replyKeyboardMarkup#3502758c flags:# rows:Vector<KeyboardButtonRow> = ReplyMarkup;
replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;
replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup;
replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> = ReplyMarkup;
help.appChangelogEmpty#af7e0394 = help.AppChangelog;
help.appChangelog#4668e6bd text:string = help.AppChangelog;
@ -468,12 +476,12 @@ messageRange#ae30253 min_id:int max_id:int = MessageRange; @@ -468,12 +476,12 @@ messageRange#ae30253 min_id:int max_id:int = MessageRange;
messageGroup#e8346f53 min_id:int max_id:int count:int date:int = MessageGroup;
updates.channelDifferenceEmpty#3e11affb flags:# pts:int timeout:flags.1?int = updates.ChannelDifference;
updates.channelDifferenceTooLong#5e167646 flags:# pts:int timeout:flags.1?int top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
updates.channelDifference#2064674e flags:# pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
updates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;
updates.channelDifferenceTooLong#5e167646 flags:# final:flags.0?true pts:int timeout:flags.1?int top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;
channelMessagesFilter#cd77d957 flags:# ranges:Vector<MessageRange> = ChannelMessagesFilter;
channelMessagesFilter#cd77d957 flags:# important_only:flags.0?true exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;
channelMessagesFilterCollapsed#fa01232e = ChannelMessagesFilter;
channelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;
@ -486,6 +494,7 @@ channelParticipantCreator#e3e2e1f9 user_id:int = ChannelParticipant; @@ -486,6 +494,7 @@ channelParticipantCreator#e3e2e1f9 user_id:int = ChannelParticipant;
channelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;
channelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;
channelParticipantsKicked#3c37bb7a = ChannelParticipantsFilter;
channelParticipantsBots#b0d1865b = ChannelParticipantsFilter;
channelRoleEmpty#b285a0c6 = ChannelParticipantRole;
channelRoleModerator#9618d975 = ChannelParticipantRole;
@ -562,17 +571,17 @@ contacts.search#11f812d8 q:string limit:int = contacts.Found; @@ -562,17 +571,17 @@ contacts.search#11f812d8 q:string limit:int = contacts.Found;
contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
messages.getDialogs#859b3d3c offset:int limit:int = messages.Dialogs;
messages.getDialogs#6b47f94d offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs;
messages.getHistory#8a8ec2da peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.search#d4569248 flags:# peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
messages.search#d4569248 flags:# important_only:flags.0?true peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
messages.deleteHistory#b7c13bd9 peer:InputPeer max_id:int = messages.AffectedHistory;
messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
messages.sendMessage#fa88427a flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates;
messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;
messages.forwardMessages#708e0195 flags:# from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;
messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true broadcast:flags.4?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates;
messages.sendMedia#c8f16791 flags:# broadcast:flags.4?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;
messages.forwardMessages#708e0195 flags:# broadcast:flags.4?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
@ -603,8 +612,12 @@ messages.importChatInvite#6c50051c hash:string = Updates; @@ -603,8 +612,12 @@ messages.importChatInvite#6c50051c hash:string = Updates;
messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
messages.installStickerSet#7b30c3a6 stickerset:InputStickerSet disabled:Bool = Bool;
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates;
messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;
messages.getMessagesViews#c4c8a55d peer:InputPeer id:Vector<int> increment:Bool = Vector<int>;
messages.toggleChatAdmins#ec8bd9e1 chat_id:int enabled:Bool = Updates;
messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool;
messages.migrateChat#15a3b8e3 chat_id:int = Updates;
messages.searchGlobal#9e3cacb0 q:string offset_date:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
updates.getState#edd4882a = updates.State;
updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
@ -638,9 +651,9 @@ channels.getParticipants#24d98f92 channel:InputChannel filter:ChannelParticipant @@ -638,9 +651,9 @@ channels.getParticipants#24d98f92 channel:InputChannel filter:ChannelParticipant
channels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant;
channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
channels.createChannel#5521d844 flags:# title:string about:string users:Vector<InputUser> = Updates;
channels.createChannel#f4893d7f flags:# broadcast:flags.0?true megagroup:flags.1?true title:string about:string = Updates;
channels.editAbout#13e27f1e channel:InputChannel about:string = Bool;
channels.editAdmin#52b16962 channel:InputChannel user_id:InputUser role:ChannelParticipantRole = Bool;
channels.editAdmin#eb7611d0 channel:InputChannel user_id:InputUser role:ChannelParticipantRole = Updates;
channels.editTitle#566decd0 channel:InputChannel title:string = Updates;
channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
channels.toggleComments#aaa29e88 channel:InputChannel enabled:Bool = Updates;

31
app/js/lib/tl_utils.js

@ -261,6 +261,7 @@ TLSerialization.prototype.storeObject = function (obj, type, field) { @@ -261,6 +261,7 @@ TLSerialization.prototype.storeObject = function (obj, type, field) {
case 'bytes': return this.storeBytes(obj, field);
case 'double': return this.storeDouble(obj, field);
case 'Bool': return this.storeBool(obj, field);
case 'true': return;
}
if (angular.isArray(obj)) {
@ -510,14 +511,25 @@ TLDeserialization.prototype.fetchObject = function (type, field) { @@ -510,14 +511,25 @@ TLDeserialization.prototype.fetchObject = function (type, field) {
case 'bytes': return this.fetchBytes(field);
case 'double': return this.fetchDouble(field);
case 'Bool': return this.fetchBool(field);
case 'true': return true;
}
field = field || type || 'Object';
if (type.substr(0, 6) == 'Vector' || type.substr(0, 6) == 'vector') {
if (type.charAt(0) == 'V') {
var constructor = this.readInt(field + '[id]');
if (constructor != 0x1cb5c415) {
var constructor = this.readInt(field + '[id]'),
constructorCmp = uintToInt(constructor);
if (constructorCmp == 0x3072cfa1) { // Gzip packed
var compressed = this.fetchBytes(field + '[packed_string]'),
uncompressed = gzipUncompress(compressed),
buffer = bytesToArrayBuffer(uncompressed),
newDeserializer = (new TLDeserialization(buffer));
return newDeserializer.fetchObject(type, field);
}
if (constructorCmp != 0x1cb5c415) {
throw new Error('Invalid vector constructor ' + constructor);
}
}
@ -613,12 +625,15 @@ TLDeserialization.prototype.fetchObject = function (type, field) { @@ -613,12 +625,15 @@ TLDeserialization.prototype.fetchObject = function (type, field) {
if (this.override[overrideKey]) {
this.override[overrideKey].apply(this, [result, field + '[' + predicate + ']']);
} else {
var i, param, type, condType, fieldBit;
var i, param, type, isCond, condType, fieldBit, value;
var len = constructorData.params.length;
for (i = 0; i < len; i++) {
param = constructorData.params[i];
type = param.type;
if (type.indexOf('?') !== -1) {
if (type == '#' && result.pFlags === undefined) {
result.pFlags = {};
}
if (isCond = (type.indexOf('?') !== -1)) {
condType = type.split('?');
fieldBit = condType[0].split('.');
if (!(result[fieldBit[0]] & (1 << fieldBit[1]))) {
@ -627,7 +642,13 @@ TLDeserialization.prototype.fetchObject = function (type, field) { @@ -627,7 +642,13 @@ TLDeserialization.prototype.fetchObject = function (type, field) {
type = condType[1];
}
result[param.name] = self.fetchObject(type, field + '[' + predicate + '][' + param.name + ']');
value = self.fetchObject(type, field + '[' + predicate + '][' + param.name + ']');
if (isCond && type === 'true') {
result.pFlags[param.name] = value;
} else {
result[param.name] = value;
}
}
}

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

@ -283,11 +283,13 @@ @@ -283,11 +283,13 @@
"conversation_group_photo_removed": "removed group photo",
"conversation_returned_to_group": "returned to group",
"conversation_invited_user": "invited {user}",
"conversation_invited_users": "{'one': 'invited {} user', 'other': 'invited {} users'}",
"conversation_left_group": "left group",
"conversation_kicked_user": "removed {user}",
"conversation_invited_user_message": "invited user",
"conversation_kicked_user_message": "removed user",
"conversation_joined_by_link": "joined group",
"conversation_converted_to_supergroup": "upgraded to a supergroup",
"conversation_created_channel": "Channel created",
"conversation_changed_channel_name": "Channel renamed",
"conversation_changed_channel_photo": "Channel photo updated",
@ -304,12 +306,14 @@ @@ -304,12 +306,14 @@
"message_service_changed_group_photo": "changed group photo",
"message_service_removed_group_photo": "removed group photo",
"message_service_invited_user": "invited {user}",
"message_service_invited_users": "invited {user} and {num-more} more",
"message_service_returned_to_group": "returned to group",
"message_service_kicked_user": "removed {user}",
"message_service_left_group": "left group",
"message_service_joined_by_link": "joined group via invite link",
"message_service_unsupported_action": "unsupported action {action}",
"message_service_bot_intro_header": "What can this bot do?",
"message_service_converted_to_supergroup": "upgraded the group to a supergroup",
"message_service_created_channel": "Channel created",
"message_service_changed_channel_name": "Channel renamed to {channel-name}",
"message_service_changed_channel_photo": "Channel photo updated",

531
app/js/messages_manager.js

File diff suppressed because it is too large Load Diff

82
app/js/services.js

@ -113,16 +113,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -113,16 +113,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
usernames[searchUsername] = userID;
}
apiUser.pFlags = {
self: (apiUser.flags & (1 << 10)) > 0,
contact: (apiUser.flags & (1 << 11)) > 0,
mutual: (apiUser.flags & (1 << 12)) > 0,
deleted: (apiUser.flags & (1 << 13)) > 0,
bot: (apiUser.flags & (1 << 14)) > 0,
botNoPrivacy: (apiUser.flags & (1 << 15)) > 0,
botNoGroups: (apiUser.flags & (1 << 16)) > 0,
verified: (apiUser.flags & (1 << 17)) > 0
};
if (apiUser.pFlags === undefined) {
apiUser.pFlags = {};
}
apiUser.sortName = apiUser.pFlags.deleted ? '' : SearchIndexManager.cleanSearchText(apiUser.first_name + ' ' + (apiUser.last_name || ''));
@ -449,6 +442,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -449,6 +442,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
setInterval(updateUsersStatuses, 60000);
$rootScope.$on('stateSynchronized', updateUsersStatuses);
return {
getContacts: getContacts,
@ -563,6 +557,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -563,6 +557,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var chats = {},
usernames = {},
channelAccess = {},
megagroups = {},
cachedPhotoLocations = {};
function saveApiChats (apiChats) {
@ -575,23 +570,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -575,23 +570,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
}
apiChat.rTitle = RichTextProcessor.wrapRichText(apiChat.title, {noLinks: true, noLinebreaks: true}) || _('chat_title_deleted');
var flags = apiChat.flags;
apiChat.pFlags = {
creator: (flags & (1 << 0)) > 0,
kicked: (flags & (1 << 1)) > 0,
left: (flags & (1 << 2)) > 0
};
if (apiChat._ == 'channel') {
angular.extend(apiChat.pFlags, {
editor: (apiChat.flags & (1 << 3)) > 0,
moderator: (apiChat.flags & (1 << 4)) > 0,
broadcast: (apiChat.flags & (1 << 5)) > 0,
username: (apiChat.flags & (1 << 6)) > 0,
verified: (apiChat.flags & (1 << 7)) > 0
});
};
var titleWords = SearchIndexManager.cleanSearchText(apiChat.title || '').split(' ');
var firstWord = titleWords.shift();
var lastWord = titleWords.pop();
@ -599,6 +577,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -599,6 +577,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
apiChat.num = (Math.abs(apiChat.id >> 1) % 8) + 1;
if (apiChat.pFlags === undefined) {
apiChat.pFlags = {};
}
if (apiChat.username) {
var searchUsername = SearchIndexManager.cleanUsername(apiChat.username);
usernames[searchUsername] = apiChat.id;
@ -617,7 +599,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -617,7 +599,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
};
function getChat (id) {
return chats[id] || {id: id, deleted: true};
return chats[id] || {id: id, deleted: true, access_hash: channelAccess[id]};
}
function hasRights (id, action) {
@ -632,7 +614,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -632,7 +614,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
return false;
}
if (isChannel(id) && action == 'send') {
if (!chat.pFlags.creator && !chat.pFlags.editor) {
if (!chat.pFlags.megagroup &&
!chat.pFlags.creator &&
!chat.pFlags.editor) {
return false;
}
}
@ -647,6 +631,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -647,6 +631,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
channelAccess[id] = accessHash;
}
function saveIsMegagroup (id) {
megagroups[id] = true;
}
function isChannel (id) {
var chat = chats[id];
if (chat && (chat._ == 'channel' || chat._ == 'channelForbidden') ||
@ -656,6 +644,17 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -656,6 +644,17 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
return false;
}
function isMegagroup (id) {
if (megagroups[id]) {
return true;
}
var chat = chats[id];
if (chat && chat._ == 'channel' && chat.pFlags.megagroup) {
return true;
}
return false;
}
function getChatInput (id) {
return id || 0;
}
@ -691,7 +690,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -691,7 +690,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
function getChatString (id) {
var chat = getChat(id);
if (isChannel(id)) {
return 'c' + id + '_' + chat.access_hash;
return (isMegagroup(id) ? 's' : 'c') + id + '_' + chat.access_hash;
}
return 'g' + id;
}
@ -702,10 +701,13 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -702,10 +701,13 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
if (chatFull.participants && chatFull.participants._ == 'chatParticipants') {
MtpApiManager.getUserID().then(function (myID) {
chatFull.isAdmin = (myID == chatFull.participants.admin_id);
var isAdmin = chat.pFlags.creator || chat.pFlags.admins_enabled && chat.pFlags.admin;
angular.forEach(chatFull.participants.participants, function(participant){
participant.canLeave = myID == participant.user_id;
participant.canKick = !participant.canLeave && (chatFull.isAdmin || myID == participant.inviter_id);
participant.canKick = !participant.canLeave && (
chat.pFlags.creator ||
participant._ == 'chatParticipant' && (isAdmin || myID == participant.inviter_id)
);
// just for order by last seen
participant.user = AppUsersManager.getUser(participant.user_id);
@ -769,8 +771,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -769,8 +771,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
saveApiChat: saveApiChat,
getChat: getChat,
isChannel: isChannel,
isMegagroup: isMegagroup,
hasRights: hasRights,
saveChannelAccess: saveChannelAccess,
saveIsMegagroup: saveIsMegagroup,
getChatInput: getChatInput,
getChannelInput: getChannelInput,
getChatPhoto: getChatPhoto,
@ -795,8 +799,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -795,8 +799,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
access_hash: peerParams[1]
};
}
else if (firstChar == 'c') {
else if (firstChar == 'c' || firstChar == 's') {
AppChatsManager.saveChannelAccess(peerParams[0], peerParams[1]);
if (firstChar == 's') {
AppChatsManager.saveIsMegagroup(peerParams[0]);
}
return {
_: 'inputPeerChannel',
channel_id: peerParams[0],
@ -917,6 +924,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -917,6 +924,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
return (peerID < 0) && AppChatsManager.isChannel(-peerID);
}
function isMegagroup (peerID) {
return (peerID < 0) && AppChatsManager.isMegagroup(-peerID);
}
function isBot (peerID) {
return (peerID > 0) && AppUsersManager.isBot(peerID);
}
@ -932,6 +943,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -932,6 +943,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
getPeerPhoto: getPeerPhoto,
resolveUsername: resolveUsername,
isChannel: isChannel,
isMegagroup: isMegagroup,
isBot: isBot
}
})
@ -2526,6 +2538,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2526,6 +2538,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
message: {
_: 'message',
flags: updateMessage.flags,
pFlags: updateMessage.pFlags,
id: updateMessage.id,
from_id: fromID,
to_id: AppPeersManager.getOutputPeer(toID),
@ -2672,7 +2685,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2672,7 +2685,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
console.log(dT(), 'apply channel diff', channelState.pts);
if (differenceResult._ == 'updates.channelDifference' && !(differenceResult.flags & 1)) {
if (differenceResult._ == 'updates.channelDifference' &&
!differenceResult.pFlags['final']) {
getChannelDifference(channelID);
} else {
console.log(dT(), 'finished channel get diff');

2
app/less/app.less

@ -43,6 +43,7 @@ pre { @@ -43,6 +43,7 @@ pre {
overflow: auto;
padding: 3px;
border: 1px solid #dedede;
font-size: inherit;
}
a {
@ -3011,6 +3012,7 @@ _:-ms-lang(x), .composer_rich_textarea:empty:focus:before { @@ -3011,6 +3012,7 @@ _:-ms-lang(x), .composer_rich_textarea:empty:focus:before {
padding: 20px 0;
font-size: 14px;
line-height: 160%;
word-break: break-all;
}
.confirm_phone_number {
font-weight: bold;

2
app/partials/desktop/audio_player.html

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
<span ng-switch-when="1" ng-bind="::audio.file_name"></span>
<span ng-switch-default my-i18n="message_attach_audio_message"></span>
</a>
<i ng-if="::message.media_unread || false" ng-show="message.media_unread" class="icon icon-audio-unread"></i>
<i ng-if="::message.pFlags.media_unread || false" ng-show="message.pFlags.media_unread" class="icon icon-audio-unread"></i>
<div class="audio_player_meta" ng-if="!audio.downloaded || !(mediaPlayer.player.duration || audio.duration)" ng-switch="audio.progress.enabled">
<span ng-switch-when="true" class="audio_player_size" ng-bind="audio.progress | formatSizeProgress"></span>
<span ng-switch-default class="audio_player_size" ng-bind="audio.size | formatSize"></span>

2
app/partials/desktop/chat_modal.html

@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
</div>
<div class="md_modal_iconed_section_wrap md_modal_iconed_section_link" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.pFlags.left && chatFull.isAdmin">
<div class="md_modal_iconed_section_wrap md_modal_iconed_section_link" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.pFlags.left && chatFull.chat.pFlags.creator">
<!-- <i class="md_modal_section_icon md_modal_section_icon_more"></i> -->
<div class="md_modal_section_link_wrap">

8
app/partials/desktop/dialog.html

@ -4,12 +4,12 @@ @@ -4,12 +4,12 @@
<div class="im_dialog_date" ng-bind="dialogMessage.dateText"></div>
<span
class="im_dialog_badge badge"
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.out"
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out"
ng-bind="dialogMessage.unreadCount"
></span>
<i
class="im_dialog_unread"
ng-show="dialogMessage.out && dialogMessage.unread"
ng-show="dialogMessage.pFlags.out && dialogMessage.pFlags.unread"
></i>
</div>
@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
<div ng-switch-default class="im_dialog_message">
<span ng-switch="dialogMessage.peerID > 0 || dialogMessage.fromID < 0">
<span ng-switch-when="true">
<span class="im_dialog_chat_from_wrap" ng-if="dialogMessage.out">
<span class="im_dialog_chat_from_wrap" ng-if="dialogMessage.pFlags.out">
<span
class="im_dialog_chat_from"
my-i18n="conversation_you"
@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
</span>
</span>
<span ng-switch-default>
<span class="im_dialog_chat_from_wrap" ng-switch="dialogMessage.out && dialogMessage._ != 'messageService'">
<span class="im_dialog_chat_from_wrap" ng-switch="dialogMessage.pFlags.out && dialogMessage._ != 'messageService'">
<span
ng-switch-when="false"
class="im_dialog_chat_from"

24
app/partials/desktop/dialog_service.html

@ -3,20 +3,22 @@ @@ -3,20 +3,22 @@
<span ng-switch-when="messageActionChatEditTitle" my-i18n="conversation_group_renamed"></span>
<span ng-switch-when="messageActionChatEditPhoto" my-i18n="conversation_group_photo_updated"></span>
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="conversation_group_photo_removed"></span>
<span ng-switch-when="messageActionChatAddUser" ng-switch="::message.fromID != message.action.user_id">
<span ng-switch-when="true" my-i18n="conversation_invited_user">
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="conversation_joined_by_link"></span>
<span ng-switch-when="messageActionChatReturn" my-i18n="conversation_returned_to_group"></span>
<span ng-switch-when="messageActionChatAddUser" my-i18n="conversation_invited_user">
<my-i18n-param name="user"><span my-peer-link="message.action.user_id"></span></my-i18n-param>
</span>
<span ng-switch-default my-i18n="conversation_returned_to_group"></span>
</span>
<span ng-switch-when="messageActionChatDeleteUser" ng-switch="::message.fromID != message.action.user_id">
<span ng-switch-when="true" my-i18n="conversation_kicked_user">
<my-i18n-param name="user"><span my-peer-link="message.action.user_id"></span></my-i18n-param>
</span>
<span ng-switch-default my-i18n="conversation_left_group"></span>
<span ng-switch-when="messageActionChatAddUsers" my-i18n="">
<ng-pluralize count="message.action.users.length"
when="conversation_invited_users">
</ng-pluralize>
</span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="conversation_joined_by_link"></span>
<span ng-switch-when="messageActionChatLeave" my-i18n="conversation_left_group"></span>
<span ng-switch-when="messageActionChatDeleteUser" my-i18n="conversation_kicked_user">
<my-i18n-param name="user"><span my-peer-link="message.action.user_id"></span></my-i18n-param>
</span>
<span ng-switch-when="messageActionChatMigrateTo" my-i18n="conversation_converted_to_supergroup"></span>
<span ng-switch-when="messageActionChannelMigrateFrom" my-i18n="conversation_converted_to_supergroup"></span>
<span ng-switch-when="messageActionChannelCreate" my-i18n="conversation_created_channel"></span>
<span ng-switch-when="messageActionChannelEditTitle" my-i18n="conversation_changed_channel_name"></span>
<span ng-switch-when="messageActionChannelEditPhoto" my-i18n="conversation_changed_channel_photo"></span>

4
app/partials/desktop/message.html

@ -23,13 +23,13 @@ @@ -23,13 +23,13 @@
</div>
<div ng-switch-default class="im_content_message_wrap" ng-class="::[historyMessage.out ? 'im_message_out' : 'im_message_in', historyMessage.fwdFromID ? 'im_message_fwd' : '']">
<div ng-switch-default class="im_content_message_wrap" ng-class="::[historyMessage.pFlags.out ? 'im_message_out' : 'im_message_in', historyMessage.fwdFromID ? 'im_message_fwd' : '']">
<i class="icon icon-select-tick"></i>
<a class="im_message_error_btn" ng-if="::historyMessage.pending || historyMessage.error || false" ng-click="historyMessage.send()">
<i class="icon-message-status" tooltip="Try again"></i>
</a>
<i ng-if="::historyMessage.unread &amp;&amp; historyMessage.out || historyMessage.pending || false" class="icon-message-status" ng-show="!historyMessage.error"></i>
<i ng-if="::historyMessage.pFlags.unread &amp;&amp; historyMessage.pFlags.out || historyMessage.pending || false" class="icon-message-status" ng-show="!historyMessage.error"></i>
<a class="im_message_from_photo pull-left" my-peer-photolink="::historyMessage.fromID" img-class="im_message_from_photo"></a>

24
app/partials/desktop/message_service.html

@ -6,20 +6,22 @@ @@ -6,20 +6,22 @@
</my-i18n>
<span ng-switch-when="messageActionChatEditPhoto" my-i18n="message_service_changed_group_photo"></span>
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span>
<span ng-switch-when="messageActionChatAddUser" ng-switch="::historyMessage.fromID != historyMessage.action.user_id">
<span ng-switch-when="true" my-i18n="message_service_invited_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-default my-i18n="message_service_returned_to_group"></span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="message_service_joined_by_link"></span>
<span ng-switch-when="messageActionChatReturn" my-i18n="message_service_returned_to_group"></span>
<span ng-switch-when="messageActionChatAddUser" my-i18n="message_service_invited_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-when="messageActionChatDeleteUser" ng-switch="::historyMessage.fromID != historyMessage.action.user_id">
<span ng-switch-when="true" my-i18n="message_service_kicked_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-default my-i18n="message_service_left_group"></span>
<span ng-switch-when="messageActionChatAddUsers" my-i18n="message_service_invited_users">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
<my-i18n-param name="num-more"><span ng-bind="historyMessage.action.users.length - 1"></span></my-i18n-param>
</span>
<span ng-switch-when="messageActionChatLeave" my-i18n="message_service_left_group"></span>
<span ng-switch-when="messageActionChatDeleteUser" my-i18n="message_service_kicked_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="message_service_joined_by_link"></span>
<span ng-switch-when="messageActionChatMigrateTo" my-i18n="message_service_converted_to_supergroup"></span>
<span ng-switch-when="messageActionChannelMigrateFrom" my-i18n="message_service_converted_to_supergroup"></span>
<span ng-switch-when="messageActionChannelCreate" my-i18n="message_service_created_channel"></span>
<span ng-switch-when="messageActionChannelEditTitle" my-i18n="message_service_changed_channel_name">
<my-i18n-param name="channel-name">&laquo;<strong ng-bind-html="::historyMessage.action.rTitle"></strong>&raquo;</my-i18n-param>

2
app/partials/desktop/user_modal.html

@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
<div class="md_modal_iconed_section_wrap md_modal_iconed_section_link" ng-init="f.showMoreActions = !user.phone.length">
<i class="md_modal_section_icon md_modal_section_icon_more"></i>
<div class="md_modal_section_link_wrap" ng-if="user.pFlags.bot &amp;&amp; !user.pFlags.botNoGroups">
<div class="md_modal_section_link_wrap" ng-if="user.pFlags.bot &amp;&amp; !user.pFlags.bot_nochats">
<a class="md_modal_section_link" ng-click="inviteToGroup()" my-i18n="user_modal_add_to_group"></a>
</div>

2
app/partials/mobile/audio_player.html

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
<span ng-switch-when="1" ng-bind="::audio.file_name"></span>
<span ng-switch-default my-i18n="message_attach_audio_message"></span>
</a>
<i ng-if="::message.media_unread || false" ng-show="message.media_unread" class="icon icon-audio-unread"></i>
<i ng-if="::message.pFlags.media_unread || false" ng-show="message.pFlags.media_unread" class="icon icon-audio-unread"></i>
<div class="audio_player_meta" ng-if="!audio.downloaded || !(mediaPlayer.player.duration || audio.duration)" ng-switch="audio.progress.enabled">
<span ng-switch-when="true" class="audio_player_size" ng-bind="audio.progress | formatSizeProgress"></span>
<span ng-switch-default class="audio_player_size" ng-bind="audio.size | formatSize"></span>

2
app/partials/mobile/chat_modal.html

@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
<div class="mobile_modal_action_wrap" ng-if="!chatFull.chat.pFlags.left &amp;&amp; chatFull.participants.participants.length">
<a class="mobile_modal_action" ng-click="inviteToGroup()" my-i18n="group_modal_add_member"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.pFlags.left && chatFull.isAdmin">
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.pFlags.left && chatFull.chat.pFlags.creator">
<a class="mobile_modal_action" ng-click="inviteViaLink()" my-i18n="group_modal_menu_share_link"></a>
</div>

8
app/partials/mobile/dialog.html

@ -4,12 +4,12 @@ @@ -4,12 +4,12 @@
<div class="im_dialog_date" ng-bind="dialogMessage.dateText"></div>
<span
class="im_dialog_badge badge"
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.out"
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out"
ng-bind="dialogMessage.unreadCount"
></span>
<i
class="im_dialog_unread"
ng-show="dialogMessage.out && dialogMessage.unread"
ng-show="dialogMessage.pFlags.out && dialogMessage.pFlags.unread"
></i>
</div>
@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
<div ng-switch-default class="im_dialog_message">
<span ng-switch="dialogMessage.peerID > 0 || dialogMessage.fromID < 0">
<span ng-switch-when="true">
<span class="im_dialog_chat_from_wrap" ng-if="dialogMessage.out">
<span class="im_dialog_chat_from_wrap" ng-if="dialogMessage.pFlags.out">
<span
class="im_dialog_chat_from"
my-i18n="conversation_you"
@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
</span>
</span>
<span ng-switch-default>
<span class="im_dialog_chat_from_wrap" ng-switch="dialogMessage.out && dialogMessage._ != 'messageService'">
<span class="im_dialog_chat_from_wrap" ng-switch="dialogMessage.pFlags.out && dialogMessage._ != 'messageService'">
<span
ng-switch-when="false"
class="im_dialog_chat_from"

4
app/partials/mobile/message.html

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
</div>
<div ng-switch-default class="im_content_message_wrap" ng-class="::[historyMessage.out ? 'im_message_out' : 'im_message_in', historyMessage.fwdFromID ? 'im_message_fwd' : '']">
<div ng-switch-default class="im_content_message_wrap" ng-class="::[historyMessage.pFlags.out ? 'im_message_out' : 'im_message_in', historyMessage.fwdFromID ? 'im_message_fwd' : '']">
<a class="im_message_from_photo pull-left" my-peer-photolink="::historyMessage.fromID" img-class="im_message_from_photo"></a>
@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
<a class="im_message_error_btn" ng-if="::historyMessage.pending || historyMessage.error || false" ng-click="historyMessage.send()">
<i class="icon-message-status" tooltip="Try again"></i>
</a>
<i ng-if="::historyMessage.unread &amp;&amp; historyMessage.out || historyMessage.pending || false" class="icon-message-status" ng-show="!historyMessage.error"></i>
<i ng-if="::historyMessage.pFlags.unread &amp;&amp; historyMessage.pFlags.out || historyMessage.pending || false" class="icon-message-status" ng-show="!historyMessage.error"></i>
<span class="im_message_date" ng-bind="::historyMessage.date | time"></span>
</div>

24
app/partials/mobile/message_service.html

@ -6,20 +6,22 @@ @@ -6,20 +6,22 @@
</my-i18n>
<span ng-switch-when="messageActionChatEditPhoto" my-i18n="message_service_changed_group_photo"></span>
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span>
<span ng-switch-when="messageActionChatAddUser" ng-switch="::historyMessage.fromID != historyMessage.action.user_id">
<span ng-switch-when="true" my-i18n="message_service_invited_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-default my-i18n="message_service_returned_to_group"></span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="message_service_joined_by_link"></span>
<span ng-switch-when="messageActionChatReturn" my-i18n="message_service_returned_to_group"></span>
<span ng-switch-when="messageActionChatAddUser" my-i18n="message_service_invited_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-when="messageActionChatDeleteUser" ng-switch="::historyMessage.fromID != historyMessage.action.user_id">
<span ng-switch-when="true" my-i18n="message_service_kicked_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-default my-i18n="message_service_left_group"></span>
<span ng-switch-when="messageActionChatAddUsers" my-i18n="message_service_invited_users">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
<my-i18n-param name="num-more"><span ng-bind="historyMessage.action.users.length - 1"></span></my-i18n-param>
</span>
<span ng-switch-when="messageActionChatLeave" my-i18n="message_service_left_group"></span>
<span ng-switch-when="messageActionChatDeleteUser" my-i18n="message_service_kicked_user">
<my-i18n-param name="user"><a my-peer-link="historyMessage.action.user_id" color="true"></a></my-i18n-param>
</span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="message_service_joined_by_link"></span>
<span ng-switch-when="messageActionChatMigrateTo" my-i18n="message_service_converted_to_supergroup"></span>
<span ng-switch-when="messageActionChannelMigrateFrom" my-i18n="message_service_converted_to_supergroup"></span>
<span ng-switch-when="messageActionChannelCreate" my-i18n="message_service_created_channel"></span>
<span ng-switch-when="messageActionChannelEditTitle" my-i18n="message_service_changed_channel_name">
<my-i18n-param name="channel-name">&laquo;<strong ng-bind-html="::historyMessage.action.rTitle"></strong>&raquo;</my-i18n-param>

2
app/partials/mobile/user_modal.html

@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
<a class="mobile_modal_action" ng-click="shareContact()" my-i18n="user_modal_share_contact"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="user.pFlags.bot &amp;&amp; !user.pFlags.botNoGroups">
<div class="mobile_modal_action_wrap" ng-if="user.pFlags.bot &amp;&amp; !user.pFlags.bot_nochats">
<a class="mobile_modal_action" ng-click="inviteToGroup()" my-i18n="user_modal_add_to_group"></a>
</div>

Loading…
Cancel
Save