Browse Source

Improved gifs

master
Igor Zhukov 9 years ago
parent
commit
d4d815efa0
  1. 24
      app/js/directives.js
  2. 4
      app/js/lib/config.js
  3. 50
      app/js/lib/schema.tl.txt
  4. 3
      app/js/locales/en-us.json
  5. 86
      app/js/messages_manager.js
  6. 39
      app/js/services.js
  7. 9
      app/less/app.less
  8. 10
      app/less/desktop.less
  9. 17
      app/less/mobile.less
  10. 9
      app/partials/desktop/dialog.html
  11. 6
      app/partials/desktop/message.html
  12. 33
      app/partials/desktop/message_attach_document.html
  13. 4
      app/partials/desktop/message_attach_webpage.html
  14. 9
      app/partials/desktop/reply_message.html
  15. 9
      app/partials/mobile/dialog.html
  16. 12
      app/partials/mobile/message.html
  17. 33
      app/partials/mobile/message_attach_document.html

24
app/js/directives.js

@ -598,20 +598,20 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -598,20 +598,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);
};
}
};
@ -1998,7 +1998,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -1998,7 +1998,7 @@ angular.module('myApp.directives', ['myApp.filters'])
$scope.isActive = false;
$scope.toggle = function (e) {
if (checkClick(e, true)) {
if (e && checkClick(e, true)) {
AppDocsManager.saveDocFile($scope.document.id);
return false;
}
@ -2024,6 +2024,13 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2024,6 +2024,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();
// }
}
})
@ -2709,6 +2716,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2709,6 +2716,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 () {
@ -2717,9 +2725,11 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2717,9 +2725,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

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

@ -34,9 +34,9 @@ inputMediaUploadedThumbVideo#7780ddf9 file:InputFile thumb:InputFile duration:in @@ -34,9 +34,9 @@ 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;
@ -83,7 +83,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL @@ -83,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#3289b590 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 restiction_reason:flags.18?string = 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;
@ -98,7 +98,7 @@ userStatusLastMonth#77ebc742 = UserStatus; @@ -98,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#e834ce68 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 restiction_reason:flags.9?string = 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;
@ -115,7 +115,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto; @@ -115,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;
@ -124,7 +124,7 @@ messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia; @@ -124,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;
@ -236,6 +236,7 @@ inputMessagesFilterDocument#9eddf188 = MessagesFilter; @@ -236,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;
@ -277,6 +278,9 @@ updateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool versio @@ -277,6 +278,9 @@ updateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool versio
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;
@ -285,8 +289,8 @@ updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Ve @@ -285,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;
@ -301,7 +305,7 @@ upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File; @@ -301,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;
@ -418,7 +422,6 @@ contactLinkContact#d502c2d0 = ContactLink; @@ -418,7 +422,6 @@ contactLinkContact#d502c2d0 = ContactLink;
webPageEmpty#eb1477e8 id:long = WebPage;
webPagePending#c586da1c id:long date:int = WebPage;
webPage#ca820ed7 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document = WebPage;
webPageExternal#cf73f207 flags:# url:string display_url:string type:flags.0?string title:flags.1?string description:flags.2?string thumb_url:flags.3?string content_url:flags.4?string w:flags.5?int h:flags.5?int duration:flags.6?int = WebPage;
authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
@ -516,10 +519,28 @@ channels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector @@ -516,10 +519,28 @@ channels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector
help.termsOfService#f1ee3e90 text:string = help.TermsOfService;
foundGif#d579cccb webpage:WebPage = FoundGif;
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;
@ -638,6 +659,11 @@ messages.searchGlobal#9e3cacb0 q:string offset_date:int offset_peer:InputPeer of @@ -638,6 +659,11 @@ messages.searchGlobal#9e3cacb0 q:string offset_date:int offset_peer:InputPeer of
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;

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}
]};
}
@ -2289,14 +2292,18 @@ angular.module('myApp.services') @@ -2289,14 +2292,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';
@ -2399,9 +2406,32 @@ angular.module('myApp.services') @@ -2399,9 +2406,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;
@ -2412,43 +2442,61 @@ angular.module('myApp.services') @@ -2412,43 +2442,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;
}
}

39
app/js/services.js

@ -1936,9 +1936,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1936,9 +1936,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
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});
}
@ -1967,6 +1966,18 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1967,6 +1966,18 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
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) {
@ -1983,8 +1994,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1983,8 +1994,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
}
var doc = angular.copy(docs[docID]),
isGif = doc.mime_type == 'image/gif' || doc.animated && doc.mime_type == 'video/mp4',
isSticker = doc.mime_type == 'image/webp' && doc.sticker,
isGif = doc.isSpecial == 'gif',
isSticker = doc.isSpecial == 'sticker',
thumbPhotoSize = doc.thumb,
width, height, thumb, dim;
@ -2027,16 +2038,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2027,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;
}
@ -3994,6 +3995,16 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -3994,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=(.+))?$/))) {

9
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%;

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>

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