Browse Source

Merge branch 'gif-improvements'

master
Igor Zhukov 9 years ago
parent
commit
6343e22a31
  1. 7
      app/js/controllers.js
  2. 27
      app/js/directives.js
  3. 4
      app/js/lib/config.js
  4. 2
      app/js/lib/ng_utils.js
  5. 71
      app/js/lib/schema.tl.txt
  6. 3
      app/js/locales/en-us.json
  7. 86
      app/js/messages_manager.js
  8. 56
      app/js/services.js
  9. 12
      app/less/app.less
  10. 10
      app/less/desktop.less
  11. 17
      app/less/mobile.less
  12. 9
      app/partials/desktop/dialog.html
  13. 7
      app/partials/desktop/full_gif.html
  14. 6
      app/partials/desktop/message.html
  15. 33
      app/partials/desktop/message_attach_document.html
  16. 4
      app/partials/desktop/message_attach_webpage.html
  17. 9
      app/partials/desktop/reply_message.html
  18. 9
      app/partials/mobile/dialog.html
  19. 12
      app/partials/mobile/message.html
  20. 33
      app/partials/mobile/message_attach_document.html

7
app/js/controllers.js

@ -804,6 +804,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -804,6 +804,13 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.$on('ui_dialogs_search_clear', $scope.searchClear);
if (!$scope.noMessages) {
$scope.$on('dialogs_search', function (e, data) {
$scope.search.query = data.query || '';
$scope.toggleSearch();
});
}
var searchTimeoutPromise;
function getDialogs(force) {
var curJump = ++jump;

27
app/js/directives.js

@ -600,20 +600,20 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -600,20 +600,20 @@ angular.module('myApp.directives', ['myApp.filters'])
.directive('myMessageDocument', function(AppDocsManager) {
return {
scope: {
'document': '=myMessageDocument',
'media': '=myMessageDocument',
'messageId': '=messageId'
},
templateUrl: templateUrl('message_attach_document'),
link: function ($scope, element, attrs) {
AppDocsManager.updateDocDownloaded($scope.document.id);
AppDocsManager.updateDocDownloaded($scope.media.document.id);
$scope.docSave = function () {
AppDocsManager.saveDocFile($scope.document.id);
AppDocsManager.saveDocFile($scope.media.document.id);
};
$scope.docOpen = function () {
if (!$scope.document.withPreview) {
if (!$scope.media.document.withPreview) {
return $scope.docSave();
}
AppDocsManager.openDoc($scope.document.id, $scope.messageId);
AppDocsManager.openDoc($scope.media.document.id, $scope.messageId);
};
}
};
@ -1991,12 +1991,15 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -1991,12 +1991,15 @@ angular.module('myApp.directives', ['myApp.filters'])
function link ($scope, element, attrs) {
var imgWrap = $('.img_gif_image_wrap', element);
imgWrap.css({width: $scope.document.thumb.width, height: $scope.document.thumb.height});
var downloadPromise = false;
$scope.isActive = false;
$scope.toggle = function (e) {
if (checkClick(e, true)) {
if (e && checkClick(e, true)) {
AppDocsManager.saveDocFile($scope.document.id);
return false;
}
@ -2022,6 +2025,13 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2022,6 +2025,13 @@ angular.module('myApp.directives', ['myApp.filters'])
$scope.$emit('ui_height');
})
}
// Autoplay small GIFs
// if (!Config.Mobile &&
// $scope.document.size &&
// $scope.document.size < 1024 * 1024) {
// $scope.toggle();
// }
}
})
@ -2707,6 +2717,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2707,6 +2717,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var override = attrs.userOverride && $scope.$eval(attrs.userOverride) || {};
var short = attrs.short && $scope.$eval(attrs.short);
var username = attrs.username && $scope.$eval(attrs.username);
var peerID;
var update = function () {
@ -2715,9 +2726,11 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2715,9 +2726,11 @@ angular.module('myApp.directives', ['myApp.filters'])
}
if (peerID > 0) {
var user = AppUsersManager.getUser(peerID);
var key = short ? 'rFirstName' : 'rFullName';
var prefix = username ? '@' : '';
var key = username ? 'username' : (short ? 'rFirstName' : 'rFullName');
element.html(
prefix +
(override[key] || user[key] || '').valueOf() +
(attrs.verified && user.pFlags && user.pFlags.verified ? ' <i class="icon-verified"></i>' : '')
);

4
app/js/lib/config.js

File diff suppressed because one or more lines are too long

2
app/js/lib/ng_utils.js

@ -1181,7 +1181,7 @@ angular.module('izhukov.utils', []) @@ -1181,7 +1181,7 @@ angular.module('izhukov.utils', [])
var markdownRegExp = /(^|\s)(````?)([\s\S]+?)(````?)([\s\n\.,:?!;]|$)|(^|\s)`([^\n]+?)`([\s\.,:?!;]|$)/;
var siteHashtags = {
Telegram: '#/im?q=%23{1}',
Telegram: 'tg://search_hashtag?hashtag={1}',
Twitter: 'https://twitter.com/hashtag/{1}',
Instagram: 'https://instagram.com/explore/tags/{1}/',
'Google Plus': 'https://plus.google.com/explore/{1}'

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

@ -34,10 +34,11 @@ inputMediaUploadedThumbVideo#7780ddf9 file:InputFile thumb:InputFile duration:in @@ -34,10 +34,11 @@ inputMediaUploadedThumbVideo#7780ddf9 file:InputFile thumb:InputFile duration:in
inputMediaVideo#936a4ebd id:InputVideo caption:string = InputMedia;
inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia;
inputMediaAudio#89938781 id:InputAudio = InputMedia;
inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> = InputMedia;
inputMediaDocument#d184e841 id:InputDocument = InputMedia;
inputMediaUploadedDocument#1d89306d file:InputFile mime_type:string attributes:Vector<DocumentAttribute> caption:string = InputMedia;
inputMediaUploadedThumbDocument#ad613491 file:InputFile thumb:InputFile mime_type:string attributes:Vector<DocumentAttribute> caption:string = InputMedia;
inputMediaDocument#1a77f29c id:InputDocument caption:string = InputMedia;
inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia;
inputMediaGifExternal#4843b0fd url:string q:string = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto;
@ -82,7 +83,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL @@ -82,7 +83,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:# 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;
user#d10d979a 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 restricted:flags.18?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 restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
@ -97,7 +98,7 @@ userStatusLastMonth#77ebc742 = UserStatus; @@ -97,7 +98,7 @@ userStatusLastMonth#77ebc742 = UserStatus;
chatEmpty#9ba2d800 id: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:# 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;
channel#4b1b7506 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 restricted:flags.9?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = 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;
@ -114,7 +115,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto; @@ -114,7 +115,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto;
chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
messageEmpty#83e5de54 id:int = 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;
message#c992e15c 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 via_bot_id:flags.11?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;
@ -123,7 +124,7 @@ messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia; @@ -123,7 +124,7 @@ messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia;
messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia;
messageMediaUnsupported#9f84f49e = MessageMedia;
messageMediaDocument#2fda2204 document:Document = MessageMedia;
messageMediaDocument#f3e02ea8 document:Document caption:string = MessageMedia;
messageMediaAudio#c6b68300 audio:Audio = MessageMedia;
messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia;
@ -184,6 +185,11 @@ peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool event @@ -184,6 +185,11 @@ peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool event
wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper;
inputReportReasonSpam#58dbcab8 = ReportReason;
inputReportReasonViolence#1e22c78d = ReportReason;
inputReportReasonPornography#2e59d922 = ReportReason;
inputReportReasonOther#e1746d0a text:string = ReportReason;
userFull#5a89ac5b user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool bot_info:BotInfo = UserFull;
contact#f911c994 user_id:int mutual:Bool = Contact;
@ -230,6 +236,7 @@ inputMessagesFilterDocument#9eddf188 = MessagesFilter; @@ -230,6 +236,7 @@ inputMessagesFilterDocument#9eddf188 = MessagesFilter;
inputMessagesFilterAudio#cfc87522 = MessagesFilter;
inputMessagesFilterAudioDocuments#5afbf764 = MessagesFilter;
inputMessagesFilterUrl#7ef0dd87 = MessagesFilter;
inputMessagesFilterGif#ffc86587 = MessagesFilter;
updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
updateMessageID#4e90bfd6 id:int random_id:long = Update;
@ -268,6 +275,12 @@ updateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector<int> pts:int @@ -268,6 +275,12 @@ updateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector<int> pts:int
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;
updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;
updateStickerSetsOrder#f0dfb451 order:Vector<long> = Update;
updateStickerSets#43ae3dec = Update;
updateSavedGifs#9375341e = Update;
updateBotInlineQuery#c01eea08 query_id:long user_id:int query:string offset:string = Update;
updateBotInlineSend#f69e113 user_id:int query:string id:string = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -276,8 +289,8 @@ updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Ve @@ -276,8 +289,8 @@ 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:# 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;
updateShortMessage#13e4deaa 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 via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
updateShortChatMessage#248afa62 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 via_bot_id:flags.11?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;
@ -292,7 +305,7 @@ upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File; @@ -292,7 +305,7 @@ upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true id:int ip_address:string port:int = DcOption;
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;
config#6bbc5f8 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 saved_gifs_limit:int disabled_features:Vector<DisabledFeature> = Config;
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
@ -395,7 +408,7 @@ messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stic @@ -395,7 +408,7 @@ messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stic
stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
messages.allStickersNotModified#e86602c3 = messages.AllStickers;
messages.allStickers#d51dafdb hash:string sets:Vector<StickerSet> = messages.AllStickers;
messages.allStickers#edfd405f hash:int sets:Vector<StickerSet> = messages.AllStickers;
disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
@ -504,6 +517,30 @@ channels.channelParticipants#f56ee2a8 count:int participants:Vector<ChannelParti @@ -504,6 +517,30 @@ channels.channelParticipants#f56ee2a8 count:int participants:Vector<ChannelParti
channels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector<User> = channels.ChannelParticipant;
help.termsOfService#f1ee3e90 text:string = help.TermsOfService;
foundGif#162ecc1f url:string thumb_url:string content_url:string content_type:string w:int h:int = FoundGif;
foundGifCached#9c750409 url:string photo:Photo document:Document = FoundGif;
messages.foundGifs#450a1c0a next_offset:int results:Vector<FoundGif> = messages.FoundGifs;
messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;
messages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = messages.SavedGifs;
inputBotInlineMessageMediaAuto#2e43e587 caption:string = InputBotInlineMessage;
inputBotInlineMessageText#adf0df71 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> = InputBotInlineMessage;
inputBotInlineResult#2cbbe15a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:InputBotInlineMessage = InputBotInlineResult;
botInlineMessageMediaAuto#fc56e87d caption:string = BotInlineMessage;
botInlineMessageText#a56197a9 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> = BotInlineMessage;
botInlineMediaResultDocument#f897d33e id:string type:string document:Document send_message:BotInlineMessage = BotInlineResult;
botInlineMediaResultPhoto#c5528587 id:string type:string photo:Photo send_message:BotInlineMessage = BotInlineResult;
botInlineResult#9bebaeb9 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:BotInlineMessage = BotInlineResult;
messages.botResults#1170b0a3 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string results:Vector<BotInlineResult> = messages.BotResults;
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@ -537,6 +574,7 @@ account.resetNotifySettings#db7e1747 = Bool; @@ -537,6 +574,7 @@ account.resetNotifySettings#db7e1747 = Bool;
account.updateProfile#f0888d68 first_name:string last_name:string = User;
account.updateStatus#6628562c offline:Bool = Bool;
account.getWallPapers#c04cfac2 = Vector<WallPaper>;
account.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool;
account.checkUsername#2714d86c username:string = Bool;
account.updateUsername#3e0bdd7c username:string = User;
account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
@ -604,7 +642,7 @@ messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long da @@ -604,7 +642,7 @@ messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long da
messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers;
messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;
messages.getWebPagePreview#25223e24 message:string = MessageMedia;
messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;
messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
@ -618,6 +656,14 @@ messages.toggleChatAdmins#ec8bd9e1 chat_id:int enabled:Bool = Updates; @@ -618,6 +656,14 @@ 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;
messages.reorderStickerSets#9fcfbc30 order:Vector<long> = Bool;
messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;
messages.searchGifs#bf9a776b q:string offset:int = messages.FoundGifs;
messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;
messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;
messages.getInlineBotResults#9324600d bot:InputUser query:string offset:string = messages.BotResults;
messages.setInlineBotResults#3f23ec12 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string = Bool;
messages.sendInlineBotResult#b16e06fe flags:# broadcast:flags.4?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates;
updates.getState#edd4882a = updates.State;
updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
@ -639,6 +685,7 @@ help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool; @@ -639,6 +685,7 @@ help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
help.getInviteText#a4a95186 lang_code:string = help.InviteText;
help.getSupport#9cdf08cd = help.Support;
help.getAppChangelog#5bab7fb2 device_model:string system_version:string app_version:string lang_code:string = help.AppChangelog;
help.getTermsOfService#37d78f83 lang_code:string = help.TermsOfService;
channels.getDialogs#a9d3d249 offset:int limit:int = messages.Dialogs;
channels.getImportantHistory#ddb929cb channel:InputChannel offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;

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

@ -284,6 +284,7 @@ @@ -284,6 +284,7 @@
"conversation_media_video": "Video",
"conversation_media_document": "File",
"conversation_media_sticker": "Sticker",
"conversation_media_gif": "GIF",
"conversation_media_audio": "Audio",
"conversation_media_location": "Location",
"conversation_media_contact": "Contact",
@ -521,7 +522,9 @@ @@ -521,7 +522,9 @@
"login_controller_unknown_country": "Unknown",
"message_forwarded_message": "Forwarded message",
"message_via_bot": "via {bot}",
"message_forwarded_message_mobile": "Forwarded from {from}, {date}",
"message_forwarded_via_message_mobile": "Forwarded from {from} via {bot}, {date}",
"message_attach_audio_message": "Voice message",
"message_attach_audio_play": "Play",

86
app/js/messages_manager.js

@ -1179,6 +1179,9 @@ angular.module('myApp.services') @@ -1179,6 +1179,9 @@ angular.module('myApp.services')
if (apiMessage.fwd_from_id) {
apiMessage.fwdFromID = AppPeersManager.getPeerID(apiMessage.fwd_from_id);
}
if (apiMessage.via_bot_id > 0) {
apiMessage.viaBotID = apiMessage.via_bot_id;
}
var mediaContext = {
user_id: apiMessage.fromID,
@ -1543,7 +1546,7 @@ angular.module('myApp.services') @@ -1543,7 +1546,7 @@ angular.module('myApp.services')
case 'document':
default:
inputMedia = {_: 'inputMediaUploadedDocument', file: inputFile, mime_type: file.type, attributes: [
inputMedia = {_: 'inputMediaUploadedDocument', file: inputFile, mime_type: file.type, caption: '', attributes: [
{_: 'documentAttributeFilename', file_name: file.name}
]};
}
@ -2290,14 +2293,18 @@ angular.module('myApp.services') @@ -2290,14 +2293,18 @@ angular.module('myApp.services')
if (prevMessage &&
// !curMessage.views &&
curMessage.fromID == prevMessage.fromID &&
prevMessage.fromID == curMessage.fromID &&
!prevMessage.fwdFromID == !curMessage.fwdFromID &&
prevMessage.viaBotID == curMessage.viaBotID &&
!prevMessage.action &&
!curMessage.action &&
curMessage.date < prevMessage.date + 900) {
var singleLine = curMessage.message && curMessage.message.length < 70 && curMessage.message.indexOf("\n") == -1 && !curMessage.reply_to_mid;
if (groupFwd && curMessage.fwdFromID && curMessage.fwdFromID == prevMessage.fwdFromID) {
if (groupFwd &&
curMessage.fwdFromID &&
curMessage.fwdFromID == prevMessage.fwdFromID &&
curMessage.viaBotID == prevMessage.viaBotID) {
curMessage.grouped = singleLine ? 'im_grouped_fwd_short' : 'im_grouped_fwd';
} else {
curMessage.grouped = !curMessage.fwdFromID && singleLine ? 'im_grouped_short' : 'im_grouped';
@ -2400,9 +2407,32 @@ angular.module('myApp.services') @@ -2400,9 +2407,32 @@ angular.module('myApp.services')
}
} else if (message.media) {
switch (message.media._) {
case 'messageMediaPhoto': notificationMessage = _('conversation_media_photo_raw'); break;
case 'messageMediaVideo': notificationMessage = _('conversation_media_video_raw'); break;
case 'messageMediaPhoto':
notificationMessage = _('conversation_media_photo_raw');
break;
case 'messageMediaVideo':
notificationMessage = _('conversation_media_video_raw');
break;
case 'messageMediaDocument':
switch (message.media.document.isSpecial) {
case 'gif':
notificationMessage = _('conversation_media_gif_raw');
break;
case 'sticker':
notificationMessage = _('conversation_media_sticker');
var stickerEmoji = message.media.document.stickerEmojiRaw;
if (stickerEmoji !== undefined) {
notificationMessage = RichTextProcessor.wrapPlainText(stickerEmoji) + ' ' + notificationMessage;
}
break;
case 'audio':
notificationMessage = _('conversation_media_audio_raw');
break;
default:
notificationMessage = message.media.document.file_name || _('conversation_media_attachment_raw');
break;
}
if (message.media.document.sticker) {
notificationMessage = _('conversation_media_sticker');
var stickerEmoji = message.media.document.stickerEmojiRaw;
@ -2413,43 +2443,61 @@ angular.module('myApp.services') @@ -2413,43 +2443,61 @@ angular.module('myApp.services')
notificationMessage = message.media.document.file_name || _('conversation_media_document_raw');
}
break;
case 'messageMediaAudio': notificationMessage = _('conversation_media_audio_raw'); break;
case 'messageMediaAudio':
notificationMessage = _('conversation_media_audio_raw');
break;
case 'messageMediaGeo':
case 'messageMediaVenue': notificationMessage = _('conversation_media_location_raw'); break;
case 'messageMediaContact': notificationMessage = _('conversation_media_contact_raw'); break;
default: notificationMessage = _('conversation_media_attachment_raw'); break;
case 'messageMediaVenue':
notificationMessage = _('conversation_media_location_raw');
break;
case 'messageMediaContact':
notificationMessage = _('conversation_media_contact_raw');
break;
default:
notificationMessage = _('conversation_media_attachment_raw');
break;
}
} else if (message._ == 'messageService') {
switch (message.action._) {
case 'messageActionChatCreate':
notificationMessage = _('conversation_group_created_raw');
break;
case 'messageActionChatEditTitle': notificationMessage = _('conversation_group_renamed_raw');
case 'messageActionChatEditTitle':
notificationMessage = _('conversation_group_renamed_raw');
break;
case 'messageActionChatEditPhoto': notificationMessage = _('conversation_group_photo_updated_raw');
case 'messageActionChatEditPhoto':
notificationMessage = _('conversation_group_photo_updated_raw');
break;
case 'messageActionChatDeletePhoto': notificationMessage = _('conversation_group_photo_removed_raw');
case 'messageActionChatDeletePhoto':
notificationMessage = _('conversation_group_photo_removed_raw');
break;
case 'messageActionChatAddUser':
notificationMessage = message.action.user_id == message.from_id ? _('conversation_returned_to_group') : _('conversation_invited_user_message_raw');
case 'messageActionChatAddUsers':
notificationMessage = _('conversation_invited_user_message_raw_raw');
break;
case 'messageActionChatReturn':
notificationMessage = _('conversation_returned_to_group_raw');
break;
case 'messageActionChatDeleteUser':
notificationMessage = message.action.user_id == message.from_id ? _('conversation_left_group') : _('conversation_kicked_user_message_raw');
notificationMessage = _('conversation_kicked_user_message_raw');
break;
case 'messageActionChatLeave':
notificationMessage = _('conversation_left_group_raw');
break;
case 'messageActionChatJoinedByLink':
notificationMessage = _('conversation_joined_by_link');
notificationMessage = _('conversation_joined_by_link_raw');
break;
case 'messageActionChannelCreate':
notificationMessage = _('conversation_created_channel');
notificationMessage = _('conversation_created_channel_raw');
break;
case 'messageActionChannelEditTitle':
notificationMessage = _('conversation_changed_channel_name');
notificationMessage = _('conversation_changed_channel_name_raw');
break;
case 'messageActionChannelEditPhoto':
notificationMessage = _('conversation_changed_channel_photo');
notificationMessage = _('conversation_changed_channel_photo_raw');
break;
case 'messageActionChannelDeletePhoto':
notificationMessage = _('conversation_removed_channel_photo');
notificationMessage = _('conversation_removed_channel_photo_raw');
break;
}
}

56
app/js/services.js

@ -1932,11 +1932,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1932,11 +1932,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
break;
case 'documentAttributeVideo':
apiDoc.duration = attribute.duration;
apiDoc.w = attribute.w;
apiDoc.h = attribute.h;
break;
case 'documentAttributeSticker':
apiDoc.sticker = 1;
apiDoc.sticker = true;
if (attribute.alt !== undefined) {
apiDoc.sticker = 2;
apiDoc.stickerEmojiRaw = attribute.alt;
apiDoc.stickerEmoji = RichTextProcessor.wrapRichText(apiDoc.stickerEmojiRaw, {noLinks: true, noLinebreaks: true});
}
@ -1953,9 +1954,30 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1953,9 +1954,30 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
apiDoc.w = attribute.w;
apiDoc.h = attribute.h;
break;
case 'documentAttributeAnimated':
apiDoc.animated = true;
break;
}
});
apiDoc.file_name = apiDoc.file_name || '';
apiDoc.mime_type = apiDoc.mime_type || '';
apiDoc.file_name = apiDoc.file_name || 'file';
if (apiDoc._ == 'documentEmpty') {
apiDoc.file_name = 'DELETED';
apiDoc.size = 0;
}
if ((apiDoc.mime_type == 'image/gif' || apiDoc.animated && apiDoc.mime_type == 'video/mp4') && apiDoc.thumb && apiDoc.thumb._ == 'photoSize') {
apiDoc.isSpecial = 'gif';
}
else if (apiDoc.mime_type == 'image/webp' && apiDoc.sticker) {
apiDoc.isSpecial = 'sticker';
}
else if (apiDoc.mime_type.substr(0, 6) == 'audio/') {
apiDoc.isSpecial = 'audio';
}
};
function getDoc (docID) {
@ -1972,8 +1994,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1972,8 +1994,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
}
var doc = angular.copy(docs[docID]),
isGif = doc.mime_type == 'image/gif',
isSticker = doc.mime_type == 'image/webp' && doc.sticker,
isGif = doc.isSpecial == 'gif',
isSticker = doc.isSpecial == 'sticker',
thumbPhotoSize = doc.thumb,
width, height, thumb, dim;
@ -2016,16 +2038,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2016,16 +2038,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
doc.withPreview = !Config.Mobile && doc.mime_type.match(/^image\/(gif|png|jpeg|jpg|bmp|tiff)/) ? 1 : 0;
if (isGif && doc.thumb) {
doc.isSpecial = 'gif';
}
else if (isSticker) {
doc.isSpecial = 'sticker';
}
else if (doc.mime_type.substr(0, 6) == 'audio/') {
doc.isSpecial = 'audio';
}
return docsForHistory[docID] = doc;
}
@ -2058,6 +2070,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2058,6 +2070,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
file_name: doc.file_name
};
if (doc._ == 'documentEmpty') {
return $q.reject();
}
if (historyDoc.downloaded && !toFileEntry) {
var cachedBlob = MtpApiFileManager.getCachedFile(inputFileLocation);
if (cachedBlob) {
@ -3979,6 +3995,16 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -3979,6 +3995,16 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
return true;
}
if (matches = url.match(/^search_hashtag\?hashtag=(.+?)$/)) {
$rootScope.$broadcast('dialogs_search', {query: '#' + decodeURIComponent(matches[1])});
if (Config.Mobile) {
$rootScope.$broadcast('history_focus', {
peerString: ''
});
}
return true;
}
if (inner &&
(matches = url.match(/^bot_command\?command=(.+?)(?:&bot=(.+))?$/))) {

12
app/less/app.less

@ -1355,6 +1355,12 @@ a.im_dialog_selected { @@ -1355,6 +1355,12 @@ a.im_dialog_selected {
.non_osx .im_message_fwd_author {
font-size: 12px;
}
.im_message_author_via {
margin-left: 5px;
}
.im_message_fwd_via {
margin-left: 0;
}
.im_message_from_photo,
.im_message_contact_photo,
@ -2092,7 +2098,8 @@ a.im_message_fwd_photo { @@ -2092,7 +2098,8 @@ a.im_message_fwd_photo {
line-height: 150%;
}
.im_message_photo_caption,
.im_message_video_caption {
.im_message_video_caption,
.im_message_document_caption {
clear: both;
word-wrap: break-word;
line-height: 150%;
@ -2574,7 +2581,8 @@ img.img_fullsize { @@ -2574,7 +2581,8 @@ img.img_fullsize {
}
.composer_emoji_tooltip_tabs_contents {
position: absolute;
width: 200%;
// width: 200%;
width: 568px;
.transform(translate3d(0,0,0));
transition: transform ease-in-out 0.2s;

10
app/less/desktop.less

@ -1793,14 +1793,18 @@ a.im_panel_peer_photo .peer_initials { @@ -1793,14 +1793,18 @@ a.im_panel_peer_photo .peer_initials {
margin-top: 4px;
margin-bottom: 4px;
}
.im_grouped_short .im_message_author_via,
.im_grouped_short .im_message_from_photo,
.im_grouped_short .im_message_author,
.im_grouped .im_message_author_via,
.im_grouped .im_message_from_photo,
.im_grouped .im_message_author,
.im_grouped_fwd .im_message_author,
.im_grouped_fwd .im_message_author_via,
.im_grouped_fwd .im_message_from_photo,
.im_grouped_fwd_short .im_message_author,
.im_grouped_fwd_short .im_message_from_photo {
.im_grouped_fwd .im_message_author,
.im_grouped_fwd_short .im_message_author_via,
.im_grouped_fwd_short .im_message_from_photo,
.im_grouped_fwd_short .im_message_author {
display: none;
}

17
app/less/mobile.less

@ -886,12 +886,14 @@ a.im_message_from_photo { @@ -886,12 +886,14 @@ a.im_message_from_photo {
}
}
.im_message_author {
.im_message_author,
.im_message_author_via {
display: none;
}
.im_history_messages_group {
a.im_message_author {
a.im_message_author,
.im_message_author_via {
display: inline;
font-size: 13px;
font-weight: normal;
@ -900,14 +902,19 @@ a.im_message_from_photo { @@ -900,14 +902,19 @@ a.im_message_from_photo {
.im_grouped_short a.im_message_from_photo,
.im_grouped_short a.im_message_author,
.im_grouped_short a.im_message_author_via,
.im_grouped a.im_message_from_photo,
.im_grouped a.im_message_author,
.im_grouped_fwd a.im_message_author,
.im_grouped a.im_message_author_via,
.im_grouped_fwd a.im_message_from_photo,
.im_grouped_fwd_short a.im_message_author,
.im_grouped_fwd a.im_message_author,
.im_grouped_fwd a.im_message_author_via,
.im_grouped_fwd_short a.im_message_from_photo,
.im_message_out a.im_message_author,
.im_grouped_fwd_short a.im_message_author,
.im_grouped_fwd_short a.im_message_author_via,
.im_message_out a.im_message_from_photo,
.im_message_out a.im_message_author,
.im_message_out a.im_message_author_via,
.im_message_body_media a.im_message_author {
display: none;
}

9
app/partials/desktop/dialog.html

@ -60,12 +60,13 @@ @@ -60,12 +60,13 @@
<span class="im_dialog_message_media" ng-if="dialogMessage.media" ng-switch="dialogMessage.media._">
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
<span ng-switch-when="messageMediaDocument" ng-switch="dialogMessage.media.document.sticker || false">
<span ng-switch-when="1" my-i18n="conversation_media_sticker"></span>
<span ng-switch-when="2">
<span ng-switch-when="messageMediaDocument" ng-switch="dialogMessage.media.document.isSpecial || false">
<span ng-switch-when="sticker">
<span ng-bind-html="dialogMessage.media.document.stickerEmoji"></span>
(<my-i18n msgid="conversation_media_sticker"></my-i18n>)
<my-i18n msgid="conversation_media_sticker"></my-i18n>
</span>
<span ng-switch-when="gif" my-i18n="conversation_media_gif"></span>
<span ng-switch-when="audio" my-i18n="conversation_media_audio"></span>
<span ng-switch-default ng-bind="dialogMessage.media.document.file_name"></span>
</span>
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>

7
app/partials/desktop/full_gif.html

@ -2,7 +2,12 @@ @@ -2,7 +2,12 @@
<div class="img_gif_image_wrap">
<img ng-if="document.url" ng-show="document.downloaded &amp;&amp; isActive" class="img_gif_image" ng-src="{{document.url}}" />
<div ng-if="document.url" ng-show="document.downloaded &amp;&amp; isActive" ng-switch="document.mime_type == 'video/mp4'">
<video ng-switch-when="true" width="{{document.thumb.width}}" height="{{document.thumb.height}}" loop autoplay class="img_gif_video">
<source ng-src="{{document.url}}" type="video/mp4">
</video>
<img ng-switch-default class="img_gif_image" ng-src="{{document.url}}" width="{{document.thumb.width}}" height="{{document.thumb.height}}" />
</div>
<img ng-hide="document.downloaded &amp;&amp; isActive" class="img_gif_thumb" my-load-thumb thumb="document.thumb" />
</div>

6
app/partials/desktop/message.html

@ -44,14 +44,14 @@ @@ -44,14 +44,14 @@
<div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media ? true : false}">
<a class="im_message_author" my-peer-link="historyMessage.fromID" short="historyMessage.toID > 0" color="historyMessage.toID < 0" no-watch="true"></a>
<a class="im_message_author" my-peer-link="historyMessage.fromID" short="historyMessage.toID > 0" color="historyMessage.toID < 0" no-watch="true"></a><span ng-if="::historyMessage.viaBotID && !historyMessage.fwdFromID" class="im_message_author_via" my-i18n="message_via_bot"><my-i18n-param name="bot"><a class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></a></my-i18n-param></span>
<a class="im_message_reply_wrap" my-reply-message="historyMessage.reply_to_msg" ng-if="::historyMessage.reply_to_mid"></a>
<div ng-if="::historyMessage.fwdFromID || false" class="im_message_fwd_from">
<a class="im_message_fwd_photo pull-left" my-peer-photolink="::historyMessage.fwdFromID" img-class="im_message_fwd_photo"></a>
<div class="im_message_fwd_author_wrap">
<a class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID"></a><span class="im_message_fwd_date" ng-bind="::historyMessage.fwd_date | dateOrTime"></span>
<a class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID"></a><span ng-if="::historyMessage.viaBotID" class="im_message_fwd_via" my-i18n="message_via_bot"><my-i18n-param name="bot"><a class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></a></my-i18n-param></span><span class="im_message_fwd_date" ng-bind="::historyMessage.fwd_date | dateOrTime"></span>
<span class="im_message_views_inline" ng-if="::historyMessage.views > 0">
<i class="icon-message-views"></i><span class="im_message_views_cnt" my-message-views="historyMessage.mid"></span>
</span>
@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
<div ng-switch-when="messageMediaPhoto" my-message-photo="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaVideo" my-message-video="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media.document" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaAudio" class="im_message_audio" my-audio-player audio="historyMessage.media.audio" message="historyMessage"></div>
<div ng-switch-when="messageMediaGeo" my-message-geo="historyMessage.media"></div>
<div ng-switch-when="messageMediaVenue" my-message-venue="historyMessage.media"></div>

33
app/partials/desktop/message_attach_document.html

@ -1,44 +1,44 @@ @@ -1,44 +1,44 @@
<div ng-switch="::document.isSpecial">
<div ng-switch="::media.document.isSpecial">
<div ng-switch-when="gif" my-load-gif document="document"></div>
<div ng-switch-when="gif" my-load-gif document="media.document"></div>
<div ng-switch-when="sticker" my-load-sticker document="document" open="true"></div>
<div ng-switch-when="sticker" my-load-sticker document="media.document" open="true"></div>
<div ng-switch-when="audio" class="im_message_audio">
<div my-audio-player audio="document"></div>
<div my-audio-player audio="media.document"></div>
</div>
<div ng-switch-default class="im_message_document clearfix" ng-class="{im_message_document_thumbed: !!document.thumb, im_message_document_progress: document.progress.enabled}">
<div ng-switch-default class="im_message_document clearfix" ng-class="{im_message_document_thumbed: !!media.document.thumb, im_message_document_progress: media.document.progress.enabled}">
<a ng-if="::!document.thumb" class="im_message_file_button" ng-click="docOpen()" ng-class="{im_message_file_button_dl_doc: document.downloaded}">
<a ng-if="::!media.document.thumb" class="im_message_file_button" ng-click="docOpen()" ng-class="{im_message_file_button_dl_doc: media.document.downloaded}">
<i class="im_message_file_button_icon"></i>
</a>
<a ng-if="::document.thumb" ng-click="docOpen()">
<a ng-if="::media.document.thumb" ng-click="docOpen()">
<div class="im_message_document_thumb_wrap">
<img
class="im_message_document_thumb"
my-load-thumb
thumb="document.thumb"
thumb="media.document.thumb"
/>
</div>
</a>
<div class="im_message_document_info">
<div class="im_message_document_name_wrap">
<a href="" ng-click="docOpen()" class="im_message_document_name" ng-bind="::document.file_name"></a>
<span class="im_message_document_size" ng-if="!document.progress.enabled" ng-bind="::document.size | formatSize"></span>
<span class="im_message_document_size" ng-if="document.progress.enabled" ng-bind="document.progress | formatSizeProgress"></span>
<a href="" ng-click="docOpen()" class="im_message_document_name" ng-bind="::media.document.file_name"></a>
<span class="im_message_document_size" ng-if="!media.document.progress.enabled" ng-bind="::media.document.size | formatSize"></span>
<span class="im_message_document_size" ng-if="media.document.progress.enabled" ng-bind="media.document.progress | formatSizeProgress"></span>
</div>
<div class="im_message_document_actions" ng-if="!document.progress.enabled" ng-switch="document.downloaded">
<div class="im_message_document_actions" ng-if="!media.document.progress.enabled" ng-switch="media.document.downloaded">
<a ng-switch-when="true" href="" ng-click="docSave()" my-i18n="message_attach_document_save"></a>
<a ng-switch-default href="" ng-click="docSave()" my-i18n="message_attach_document_download"></a>
<a ng-if="::document.withPreview" href="" ng-click="docOpen()" my-i18n="message_attach_document_open"></a>
<a ng-if="::media.document.withPreview" href="" ng-click="docOpen()" my-i18n="message_attach_document_open"></a>
</div>
<div class="clearfix im_message_cancelable_progress_wrap" ng-if="document.progress.enabled">
<a class="im_message_media_progress_cancel pull-right" ng-click="document.progress.cancel()" my-i18n="modal_cancel"></a>
<div class="clearfix im_message_cancelable_progress_wrap" ng-if="media.document.progress.enabled">
<a class="im_message_media_progress_cancel pull-right" ng-click="media.document.progress.cancel()" my-i18n="modal_cancel"></a>
<div class="im_message_download_progress_wrap">
<div class="progress tg_down_progress">
<div class="progress-bar progress-bar-success" ng-style="{width: document.progress.percent + '%'}"></div>
<div class="progress-bar progress-bar-success" ng-style="{width: media.document.progress.percent + '%'}"></div>
</div>
</div>
</div>
@ -46,3 +46,4 @@ @@ -46,3 +46,4 @@
</div>
</div>
<div ng-if="::media.rCaption" class="im_message_document_caption" ng-bind-html="::media.rCaption"></div>

4
app/partials/desktop/message_attach_webpage.html

@ -31,11 +31,11 @@ @@ -31,11 +31,11 @@
</div>
<div ng-switch-when="document" class="im_message_webpage_document">
<div my-message-document="webpage.document" message-id="messageId"></div>
<div my-message-document="webpage" message-id="messageId"></div>
</div>
<div ng-switch-when="gif" class="im_message_webpage_gif">
<div my-message-document="webpage.document" message-id="messageId"></div>
<div my-message-document="webpage" message-id="messageId"></div>
</div>
<div ng-switch-default class="im_message_webpage_article">

9
app/partials/desktop/reply_message.html

@ -18,12 +18,13 @@ @@ -18,12 +18,13 @@
<span class="im_reply_message_media" ng-if="replyMessage.media" ng-switch="replyMessage.media._">
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
<span ng-switch-when="messageMediaDocument" ng-switch="::replyMessage.media.document.sticker || false">
<span ng-switch-when="1" my-i18n="conversation_media_sticker"></span>
<span ng-switch-when="2">
<span ng-switch-when="messageMediaDocument" ng-switch="dialogMessage.media.document.isSpecial || false">
<span ng-switch-when="sticker">
<span ng-bind-html="replyMessage.media.document.stickerEmoji"></span>
(<my-i18n msgid="conversation_media_sticker"></my-i18n>)
<my-i18n msgid="conversation_media_sticker"></my-i18n>
</span>
<span ng-switch-when="gif" my-i18n="conversation_media_gif"></span>
<span ng-switch-when="audio" my-i18n="conversation_media_audio"></span>
<span ng-switch-default ng-bind="replyMessage.media.document.file_name"></span>
</span>
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>

9
app/partials/mobile/dialog.html

@ -60,12 +60,13 @@ @@ -60,12 +60,13 @@
<span class="im_dialog_message_media" ng-if="dialogMessage.media" ng-switch="dialogMessage.media._">
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
<span ng-switch-when="messageMediaDocument" ng-switch="dialogMessage.media.document.sticker || false">
<span ng-switch-when="1" my-i18n="conversation_media_sticker"></span>
<span ng-switch-when="2">
<span ng-switch-when="messageMediaDocument" ng-switch="dialogMessage.media.document.isSpecial || false">
<span ng-switch-when="sticker">
<span ng-bind-html="dialogMessage.media.document.stickerEmoji"></span>
(<my-i18n msgid="conversation_media_sticker"></my-i18n>)
<my-i18n msgid="conversation_media_sticker"></my-i18n>
</span>
<span ng-switch-when="gif" my-i18n="conversation_media_gif"></span>
<span ng-switch-when="audio" my-i18n="conversation_media_audio"></span>
<span ng-switch-default ng-bind="dialogMessage.media.document.file_name"></span>
</span>
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>

12
app/partials/mobile/message.html

@ -43,12 +43,16 @@ @@ -43,12 +43,16 @@
<div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media && historyMessage.media._ != 'messageMediaWebPage' && !historyMessage.media.rCaption ? true : false}">
<a class="im_message_author" my-peer-link="historyMessage.fromID" short="historyMessage.toID > 0" color="historyMessage.toID < 0" no-watch="true"></a>
<span ng-if="::historyMessage.viaBotID && !historyMessage.fwdFromID" class="im_message_author_via" my-i18n="message_via_bot"><my-i18n-param name="bot"><a class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></a></my-i18n-param></span>
<a class="im_message_reply_wrap" my-reply-message="historyMessage.reply_to_msg" ng-if="::historyMessage.reply_to_mid"></a>
<div ng-if="::!!historyMessage.fwdFromID &amp;&amp; !historyMessage.media" class="im_message_fwd_header" my-i18n="message_forwarded_message_mobile">
<a my-i18n-param="from" class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID" no-watch="true"></a>
<span my-i18n-param="date" class="im_message_fwd_date" ng-bind="::historyMessage.fwd_date | dateOrTime"></span>
<div ng-if="::!!historyMessage.fwdFromID &amp;&amp; !historyMessage.media" class="im_message_fwd_header">
<span ng-switch-when="true" my-i18n-format="message_forwarded_via_message_mobile"></span>
<span ng-switch-default my-i18n-format="message_forwarded_message_mobile"></span>
<my-i18n-param name="from"><a class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID" no-watch="true"></a></my-i18n-param>
<my-i18n-param name="date"><span class="im_message_fwd_date" ng-bind="::historyMessage.fwd_date | dateOrTime"></span></my-i18n-param>
<my-i18n-param name="bot"><a class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></a></my-i18n-param>
</div>
<div class="im_message_text" ng-if="::historyMessage.message.length || false" my-message-text="::historyMessage" dir="auto"></div>
@ -57,7 +61,7 @@ @@ -57,7 +61,7 @@
<div ng-switch-when="messageMediaPhoto" my-message-photo="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaVideo" my-message-video="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media.document" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaAudio" class="im_message_audio" my-audio-player audio="historyMessage.media.audio" message="historyMessage"></div>
<div ng-switch-when="messageMediaGeo" my-message-geo="historyMessage.media"></div>
<div ng-switch-when="messageMediaVenue" my-message-venue="historyMessage.media"></div>

33
app/partials/mobile/message_attach_document.html

@ -1,44 +1,44 @@ @@ -1,44 +1,44 @@
<div ng-switch="::document.isSpecial">
<div ng-switch="::media.document.isSpecial">
<div ng-switch-when="gif" my-load-gif document="document"></div>
<div ng-switch-when="gif" my-load-gif document="media.document"></div>
<div ng-switch-when="sticker" my-load-sticker document="document" open="true"></div>
<div ng-switch-when="sticker" my-load-sticker document="media.document" open="true"></div>
<div ng-switch-when="audio" class="im_message_audio">
<div my-audio-player audio="document"></div>
<div my-audio-player audio="media.document"></div>
</div>
<div ng-switch-default class="im_message_document clearfix" ng-class="{im_message_document_thumbed: !!document.thumb, im_message_document_progress: document.progress.enabled}">
<div ng-switch-default class="im_message_document clearfix" ng-class="{im_message_document_thumbed: !!media.document.thumb, im_message_document_progress: media.document.progress.enabled}">
<a ng-if="::!document.thumb" class="im_message_file_button" ng-click="docOpen()" ng-class="{im_message_file_button_dl_doc: document.downloaded}">
<a ng-if="::!media.document.thumb" class="im_message_file_button" ng-click="docOpen()" ng-class="{im_message_file_button_dl_doc: media.document.downloaded}">
<i class="im_message_file_button_icon"></i>
</a>
<a ng-if="::document.thumb" ng-click="docOpen()">
<a ng-if="::media.document.thumb" ng-click="docOpen()">
<div class="im_message_document_thumb_wrap">
<img
class="im_message_document_thumb"
my-load-thumb
thumb="document.thumb"
thumb="media.document.thumb"
/>
</div>
</a>
<div class="im_message_document_info">
<div class="im_message_document_name_wrap">
<a href="" ng-click="docOpen()" class="im_message_document_name" ng-bind="::document.file_name"></a>
<span class="im_message_document_size" ng-if="!document.progress.enabled" ng-bind="::document.size | formatSize"></span>
<span class="im_message_document_size" ng-if="document.progress.enabled" ng-bind="document.progress | formatSizeProgress"></span>
<a href="" ng-click="docOpen()" class="im_message_document_name" ng-bind="::media.document.file_name"></a>
<span class="im_message_document_size" ng-if="!media.document.progress.enabled" ng-bind="::media.document.size | formatSize"></span>
<span class="im_message_document_size" ng-if="media.document.progress.enabled" ng-bind="media.document.progress | formatSizeProgress"></span>
</div>
<div class="im_message_document_actions" ng-if="!document.progress.enabled" ng-switch="document.downloaded">
<div class="im_message_document_actions" ng-if="!media.document.progress.enabled" ng-switch="media.document.downloaded">
<a ng-switch-when="true" href="" ng-click="docSave()" my-i18n="message_attach_document_save"></a>
<a ng-switch-default href="" ng-click="docSave()" my-i18n="message_attach_document_download"></a>
<a ng-if="::document.withPreview" href="" ng-click="docOpen()" my-i18n="message_attach_document_open"></a>
<a ng-if="::media.document.withPreview" href="" ng-click="docOpen()" my-i18n="message_attach_document_open"></a>
</div>
<div class="clearfix im_message_cancelable_progress_wrap" ng-if="document.progress.enabled">
<a class="im_message_media_progress_cancel pull-right" ng-click="document.progress.cancel()" my-i18n="modal_cancel"></a>
<div class="clearfix im_message_cancelable_progress_wrap" ng-if="media.document.progress.enabled">
<a class="im_message_media_progress_cancel pull-right" ng-click="media.document.progress.cancel()" my-i18n="modal_cancel"></a>
<div class="im_message_download_progress_wrap">
<div class="progress tg_down_progress">
<div class="progress-bar progress-bar-success" ng-style="{width: document.progress.percent + '%'}"></div>
<div class="progress-bar progress-bar-success" ng-style="{width: media.document.progress.percent + '%'}"></div>
</div>
</div>
</div>
@ -46,3 +46,4 @@ @@ -46,3 +46,4 @@
</div>
</div>
<div ng-if="::media.rCaption" class="im_message_document_caption" ng-bind-html="::media.rCaption"></div>

Loading…
Cancel
Save