Browse Source

Upgrade to layer 66

Supported Telescope videos
Closes #1416
Fixed bug with frozen sent messages
master
Igor Zhukov 8 years ago
parent
commit
fb9bd8f1ec
  1. 94
      app/js/directives.js
  2. 4
      app/js/lib/config.js
  3. 8
      app/js/lib/ng_utils.js
  4. 131
      app/js/lib/schema.tl.txt
  5. 3
      app/js/locales/en-us.json
  6. 33
      app/js/messages_manager.js
  7. 13
      app/js/services.js
  8. 75
      app/less/app.less
  9. 27
      app/partials/desktop/full_round.html
  10. 2
      app/partials/desktop/message_attach_document.html
  11. 1
      app/partials/desktop/message_service.html
  12. 3
      app/partials/desktop/short_message.html
  13. 2
      app/partials/mobile/message_attach_document.html
  14. 2
      app/partials/mobile/message_service.html

94
app/js/directives.js

@ -2195,13 +2195,95 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2195,13 +2195,95 @@ angular.module('myApp.directives', ['myApp.filters'])
}, 200)
})
}
}
})
.directive('myLoadRound', function (AppDocsManager, $timeout) {
var currentPlayer = false
var currentPlayerScope = false
return {
link: link,
templateUrl: templateUrl('full_round'),
scope: {
document: '='
}
}
function checkPlayer(newPlayer, newScope) {
if (currentPlayer === newPlayer) {
return false
}
if (currentPlayer) {
currentPlayer.pause()
currentPlayer.currentTime = 0
currentPlayerScope.isActive = false
}
currentPlayer = newPlayer
currentPlayerScope = newScope
}
function link ($scope, element, attrs) {
var imgWrap = $('.img_round_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 (e && checkClick(e, true)) {
AppDocsManager.saveDocFile($scope.document.id)
return false
}
if ($scope.document.url) {
$scope.isActive = !$scope.isActive
onContentLoaded(function () {
$scope.$emit('ui_height')
var video = $('video', element)[0]
if (video) {
if (!$scope.isActive) {
video.pause()
video.currentTime = 0
} else {
checkPlayer(video, $scope)
video.play()
}
}
})
return
}
if (downloadPromise) {
downloadPromise.cancel()
downloadPromise = false
return
}
downloadPromise = AppDocsManager.downloadDoc($scope.document.id)
downloadPromise.then(function () {
$timeout(function () {
var video = $('video', element)[0]
checkPlayer(video, $scope)
$(video).on('ended', function () {
if ($scope.isActive) {
$scope.toggle()
}
})
$scope.isActive = true
}, 200)
})
}
// Autoplay small GIFs
// if (!Config.Mobile &&
// $scope.document.size &&
// $scope.document.size < 1024 * 1024) {
// $scope.toggle()
// }
$scope.$on('ui_history_change', function () {
if ($scope.isActive) {
$scope.toggle()
}
})
}
})

4
app/js/lib/config.js

File diff suppressed because one or more lines are too long

8
app/js/lib/ng_utils.js

@ -1918,14 +1918,15 @@ angular.module('izhukov.utils', []) @@ -1918,14 +1918,15 @@ angular.module('izhukov.utils', [])
}
function wrapUrl (url, unsafe) {
if (!url.match(/^https?:\/\//i)) {
if (!url.match(/^(https?|tg):\/\//i)) {
url = 'http://' + url
}
var tgMeMatch
var telescoPeMatch
if (unsafe == 2) {
url = 'tg://unsafe_url?url=' + encodeURIComponent(url)
}
else if ( (tgMeMatch = url.match(/^https?:\/\/t(?:elegram)?\.me\/(.+)/))) {
else if ((tgMeMatch = url.match(/^https?:\/\/t(?:elegram)?\.me\/(.+)/))) {
var path = tgMeMatch[1].split('/')
switch (path[0]) {
case 'joinchat':
@ -1944,6 +1945,9 @@ angular.module('izhukov.utils', []) @@ -1944,6 +1945,9 @@ angular.module('izhukov.utils', [])
}
}
}
else if ((telescoPeMatch = url.match(/^https?:\/\/telesco\.pe\/([^/?]+)\/(\d+)/))) {
url = 'tg://resolve?domain=' + telescoPeMatch[1] + '&post=' + telescoPeMatch[2]
}
else if (unsafe) {
url = 'tg://unsafe_url?url=' + encodeURIComponent(url)
}

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

@ -37,6 +37,7 @@ inputMediaGifExternal#4843b0fd url:string q:string = InputMedia; @@ -37,6 +37,7 @@ inputMediaGifExternal#4843b0fd url:string q:string = InputMedia;
inputMediaPhotoExternal#b55f4f18 url:string caption:string = InputMedia;
inputMediaDocumentExternal#e5e9607c url:string caption:string = InputMedia;
inputMediaGame#d33f43f3 id:InputGame = InputMedia;
inputMediaInvoice#92153685 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string start_param:string = InputMedia;
inputChatPhotoEmpty#1ca48f57 = InputChatPhoto;
inputChatUploadedPhoto#927c55b4 file:InputFile = InputChatPhoto;
@ -59,13 +60,13 @@ peerChat#bad0e5bb chat_id:int = Peer; @@ -59,13 +60,13 @@ peerChat#bad0e5bb chat_id:int = Peer;
peerChannel#bddde532 channel_id:int = Peer;
storage.fileUnknown#aa963b05 = storage.FileType;
storage.filePartial#40bc6f52 = storage.FileType;
storage.fileJpeg#7efe0e = storage.FileType;
storage.fileGif#cae1aadf = storage.FileType;
storage.filePng#a4f63c0 = storage.FileType;
storage.filePdf#ae1e508d = storage.FileType;
storage.fileMp3#528a0677 = storage.FileType;
storage.fileMov#4b09ebbc = storage.FileType;
storage.filePartial#40bc6f52 = storage.FileType;
storage.fileMp4#b3cea0e4 = storage.FileType;
storage.fileWebp#1081464c = storage.FileType;
@ -73,7 +74,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL @@ -73,7 +74,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#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 min:flags.20?true bot_inline_geo:flags.21?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;
user#2e13f4c3 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 min:flags.20?true bot_inline_geo:flags.21?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 lang_code:flags.22?string = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
@ -117,6 +118,7 @@ messageMediaDocument#f3e02ea8 document:Document caption:string = MessageMedia; @@ -117,6 +118,7 @@ messageMediaDocument#f3e02ea8 document:Document caption:string = MessageMedia;
messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia;
messageMediaGame#fdb19008 game:Game = MessageMedia;
messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;
messageActionEmpty#b6aef7b0 = MessageAction;
messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
@ -132,6 +134,8 @@ messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageActio @@ -132,6 +134,8 @@ messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageActio
messageActionPinMessage#94bd38ed = MessageAction;
messageActionHistoryClear#9fbab604 = MessageAction;
messageActionGameScore#92a72876 game_id:long score:int = MessageAction;
messageActionPaymentSentMe#8f31b327 flags:# currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;
messageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;
messageActionPhoneCall#80e11a7f flags:# call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;
dialog#66ffba14 flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog;
@ -180,7 +184,7 @@ inputReportReasonViolence#1e22c78d = ReportReason; @@ -180,7 +184,7 @@ inputReportReasonViolence#1e22c78d = ReportReason;
inputReportReasonPornography#2e59d922 = ReportReason;
inputReportReasonOther#e1746d0a text:string = ReportReason;
userFull#f220f3f flags:# blocked:flags.0?true phone_calls_available:flags.4?true user:User about:flags.1?string link:contacts.Link profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo common_chats_count:int = UserFull;
userFull#f220f3f flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true user:User about:flags.1?string link:contacts.Link profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo common_chats_count:int = UserFull;
contact#f911c994 user_id:int mutual:Bool = Contact;
@ -226,6 +230,8 @@ inputMessagesFilterVoice#50f5c392 = MessagesFilter; @@ -226,6 +230,8 @@ inputMessagesFilterVoice#50f5c392 = MessagesFilter;
inputMessagesFilterMusic#3751b49e = MessagesFilter;
inputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;
inputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;
inputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;
inputMessagesFilterRoundVideo#b549da53 = MessagesFilter;
updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
updateMessageID#4e90bfd6 id:int random_id:long = Update;
@ -280,9 +286,13 @@ updateRecentStickers#9a422c20 = Update; @@ -280,9 +286,13 @@ updateRecentStickers#9a422c20 = Update;
updateConfig#a229dd06 = Update;
updatePtsChanged#3354678f = Update;
updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;
updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;
updateDialogPinned#d711a2cc flags:# pinned:flags.0?true peer:Peer = Update;
updatePinnedDialogs#d8caf68d flags:# order:flags.0?Vector<Peer> = Update;
updateBotWebhookJSON#8317c0c3 data:DataJSON = Update;
updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;
updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;
updateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;
updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -305,10 +315,11 @@ photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = @@ -305,10 +315,11 @@ photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> =
photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
upload.fileCdnRedirect#1508485a dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes = upload.File;
dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true id:int ip_address:string port:int = DcOption;
dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true id:int ip_address:string port:int = DcOption;
config#3af6fb5f flags:# phonecalls_enabled:flags.1?true 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 edit_time_limit:int rating_e_decay:int stickers_recent_limit:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int disabled_features:Vector<DisabledFeature> = Config;
config#cb601684 flags:# phonecalls_enabled:flags.1?true 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 edit_time_limit:int rating_e_decay:int stickers_recent_limit:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string disabled_features:Vector<DisabledFeature> = Config;
nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;
@ -366,6 +377,8 @@ sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction; @@ -366,6 +377,8 @@ sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;
sendMessageGeoLocationAction#176f8ba1 = SendMessageAction;
sendMessageChooseContactAction#628cbc6f = SendMessageAction;
sendMessageGamePlayAction#dd6a8f48 = SendMessageAction;
sendMessageRecordRoundAction#88f27fbc = SendMessageAction;
sendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;
contacts.found#1aa1f784 results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
@ -398,7 +411,7 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL; @@ -398,7 +411,7 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
documentAttributeAnimated#11b58939 = DocumentAttribute;
documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;
documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute;
documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
@ -465,6 +478,7 @@ keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton; @@ -465,6 +478,7 @@ keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;
keyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;
keyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;
keyboardButtonGame#50f41ccf text:string = KeyboardButton;
keyboardButtonBuy#afd93fbb text:string = KeyboardButton;
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
@ -473,9 +487,6 @@ replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags @@ -473,9 +487,6 @@ replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags
replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> = ReplyMarkup;
replyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;
help.appChangelogEmpty#af7e0394 = help.AppChangelog;
help.appChangelog#2a137e7c message:string media:MessageMedia entities:Vector<MessageEntity> = help.AppChangelog;
messageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;
messageEntityMention#fa04579d offset:int length:int = MessageEntity;
messageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;
@ -656,17 +667,66 @@ pageBlockEmbed#cde200d1 flags:# full_width:flags.0?true allow_scrolling:flags.3? @@ -656,17 +667,66 @@ pageBlockEmbed#cde200d1 flags:# full_width:flags.0?true allow_scrolling:flags.3?
pageBlockEmbedPost#292c7be9 url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector<PageBlock> caption:RichText = PageBlock;
pageBlockCollage#8b31c4f items:Vector<PageBlock> caption:RichText = PageBlock;
pageBlockSlideshow#130c8963 items:Vector<PageBlock> caption:RichText = PageBlock;
pageBlockChannel#ef1751b5 channel:Chat = PageBlock;
pagePart#8dee6c44 blocks:Vector<PageBlock> photos:Vector<Photo> videos:Vector<Document> = Page;
pageFull#d7a19d69 blocks:Vector<PageBlock> photos:Vector<Photo> videos:Vector<Document> = Page;
phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;
phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;
phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;
phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;
dataJSON#7d748d04 data:string = DataJSON;
labeledPrice#cb296bf8 label:string amount:long = LabeledPrice;
invoice#c30aa358 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true currency:string prices:Vector<LabeledPrice> = Invoice;
paymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;
postAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;
paymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;
paymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;
webDocument#c61acbd8 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> dc_id:int = WebDocument;
inputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;
inputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;
upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
payments.paymentForm#3f56aea3 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;
payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
payments.paymentVerficationNeeded#6b56b921 url:string = payments.PaymentResult;
payments.paymentReceipt#500911e1 flags:# date:int bot_id:int invoice:Invoice provider_id:int info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;
shippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;
inputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;
inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;
phoneCallEmpty#5366c915 id:long = PhoneCall;
phoneCallWaiting#1b8f4ad1 flags:# id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
phoneCallRequested#6c448ae8 id:long access_hash:long date:int admin_id:int participant_id:int g_a:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCallRequested#83761ce4 id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCallAccepted#6d003d3f id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCall#ffe6ab67 id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connection:PhoneConnection alternative_connections:Vector<PhoneConnection> start_date:int = PhoneCall;
phoneCallDiscarded#50ca4de1 flags:# id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;
@ -674,10 +734,12 @@ phoneCallProtocol#a2bb35cb flags:# udp_p2p:flags.0?true udp_reflector:flags.1?tr @@ -674,10 +734,12 @@ phoneCallProtocol#a2bb35cb flags:# udp_p2p:flags.0?true udp_reflector:flags.1?tr
phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;
phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;
phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;
phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;
phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;
upload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;
upload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;
cdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;
cdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;
---functions---
@ -731,6 +793,7 @@ account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.Passw @@ -731,6 +793,7 @@ account.getPasswordSettings#bc8d11bb current_password_hash:bytes = account.Passw
account.updatePasswordSettings#fa7c4b86 current_password_hash:bytes new_settings:account.PasswordInputSettings = Bool;
account.sendConfirmPhoneCode#1516d7bd flags:# allow_flashcall:flags.0?true hash:string current_number:flags.0?Bool = auth.SentCode;
account.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;
account.getTmpPassword#4a82327e password_hash:bytes period:int = account.TmpPassword;
users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
@ -747,7 +810,7 @@ contacts.exportCard#84e53737 = Vector<int>; @@ -747,7 +810,7 @@ contacts.exportCard#84e53737 = Vector<int>;
contacts.importCard#4fe196fe export_card:Vector<int> = User;
contacts.search#11f812d8 q:string limit:int = contacts.Found;
contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;
contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;
contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
@ -833,6 +896,9 @@ messages.getWebPage#32ca8f91 url:string hash:int = WebPage; @@ -833,6 +896,9 @@ messages.getWebPage#32ca8f91 url:string hash:int = WebPage;
messages.toggleDialogPin#3289be6a flags:# pinned:flags.0?true peer:InputPeer = Bool;
messages.reorderPinnedDialogs#959ff644 flags:# force:flags.0?true order:Vector<InputPeer> = Bool;
messages.getPinnedDialogs#e254d64e = messages.PeerDialogs;
messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = Bool;
messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool;
messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@ -846,6 +912,9 @@ photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int @@ -846,6 +912,9 @@ photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int
upload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;
upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
upload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;
upload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;
upload.getCdnFile#2000bcc3 file_token:bytes offset:int limit:int = upload.CdnFile;
upload.reuploadCdnFile#2e7a2020 file_token:bytes request_token:bytes = Bool;
help.getConfig#c4f9186b = Config;
help.getNearestDc#1fb33026 = NearestDc;
@ -853,9 +922,10 @@ help.getAppUpdate#ae2de196 = help.AppUpdate; @@ -853,9 +922,10 @@ help.getAppUpdate#ae2de196 = help.AppUpdate;
help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
help.getInviteText#4d392343 = help.InviteText;
help.getSupport#9cdf08cd = help.Support;
help.getAppChangelog#b921197a = help.AppChangelog;
help.getAppChangelog#9010ef6f prev_app_version:string = Updates;
help.getTermsOfService#350170f3 = help.TermsOfService;
help.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool;
help.getCdnConfig#52029342 = CdnConfig;
channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;
channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;
@ -885,7 +955,26 @@ channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; @@ -885,7 +955,26 @@ channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;
channels.updatePinnedMessage#a72ded52 flags:# silent:flags.0?true channel:InputChannel id:int = Updates;
channels.getAdminedPublicChannels#8d8d82d7 = messages.Chats;
phone.requestCall#a41aa5e4 user_id:InputUser random_id:int g_a:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
phone.acceptCall#220f0b20 peer:InputPhoneCall g_b:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;
phone.discardCall#5dfbcddc peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Bool;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
payments.getPaymentForm#99f09745 msg_id:int = payments.PaymentForm;
payments.getPaymentReceipt#a092a980 msg_id:int = payments.PaymentReceipt;
payments.validateRequestedInfo#770a8e74 flags:# save:flags.0?true msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
payments.sendPaymentForm#2b8879b3 flags:# msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials = payments.PaymentResult;
payments.getSavedInfo#227d824b = payments.SavedInfo;
payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;
stickers.createStickerSet#9bd86e6a flags:# masks:flags.0?true user_id:InputUser title:string short_name:string stickers:Vector<InputStickerSetItem> = messages.StickerSet;
stickers.removeStickerFromSet#4255934 sticker:InputDocument = Bool;
stickers.changeStickerPosition#4ed705ca sticker:InputDocument position:int = Bool;
stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet;
phone.getCallConfig#55451fa9 = DataJSON;
phone.requestCall#5b95b3d4 user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;
phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;
phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;
phone.discardCall#78d413a6 peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;
phone.setCallRating#1c536a34 peer:InputPhoneCall rating:int comment:string = Updates;
phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;

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

@ -311,6 +311,7 @@ @@ -311,6 +311,7 @@
"conversation_draft": "Draft:",
"conversation_media_photo": "Photo",
"conversation_media_video": "Video",
"conversation_media_round": "Video message",
"conversation_media_document": "File",
"conversation_media_sticker": "Sticker",
"conversation_media_gif": "GIF",
@ -318,6 +319,7 @@ @@ -318,6 +319,7 @@
"conversation_media_location": "Location",
"conversation_media_contact": "Contact",
"conversation_media_attachment": "Attachment",
"conversation_media_unsupported": "Unsupported attachment",
"conversation_search_peer": "Search in this chat",
@ -374,6 +376,7 @@ @@ -374,6 +376,7 @@
"message_service_changed_channel_photo": "Channel photo updated",
"message_service_removed_channel_photo": "Channel photo removed",
"message_service_scored_X": "{'one': 'scored {}', 'other': 'scored {}'}",
"message_service_payment_sent": "Payment sent",
"message_action_reply": "Reply",
"message_action_edit": "Edit",

33
app/js/messages_manager.js

@ -1323,6 +1323,9 @@ angular.module('myApp.services') @@ -1323,6 +1323,9 @@ angular.module('myApp.services')
AppGamesManager.saveGame(apiMessage.media.game, apiMessage.mid, mediaContext)
apiMessage.media.handleMessage = true
break
case 'messageMediaInvoice':
apiMessage.media = {_: 'messageMediaUnsupported'}
break
}
}
if (apiMessage.action) {
@ -2733,6 +2736,10 @@ angular.module('myApp.services') @@ -2733,6 +2736,10 @@ angular.module('myApp.services')
notificationMessage = _('conversation_media_video_raw')
captionEmoji = '📹'
break
case 'round':
notificationMessage = _('conversation_media_round_raw')
captionEmoji = '📹'
break
case 'voice':
case 'audio':
notificationMessage = _('conversation_media_audio_raw')
@ -2759,6 +2766,9 @@ angular.module('myApp.services') @@ -2759,6 +2766,9 @@ angular.module('myApp.services')
case 'messageMediaGame':
notificationMessage = RichTextProcessor.wrapPlainText('🎮 ' + message.media.game.title)
break
case 'messageMediaUnsupported':
notificationMessage = _('conversation_media_unsupported_raw')
break
default:
notificationMessage = _('conversation_media_attachment_raw')
break
@ -2900,6 +2910,7 @@ angular.module('myApp.services') @@ -2900,6 +2910,7 @@ angular.module('myApp.services')
var newDialogsToHandle = {}
var notificationsHandlePromise = false
var notificationsToHandle = {}
var newUpdatesAfterReloadToHandle = {}
function handleNewMessages () {
$timeout.cancel(newMessagesHandlePromise)
@ -2955,10 +2966,7 @@ angular.module('myApp.services') @@ -2955,10 +2966,7 @@ angular.module('myApp.services')
notificationsToHandle = {}
}
$rootScope.$on('apiUpdate', function (e, update) {
// if (update._ != 'updateUserStatus') {
// console.log('on apiUpdate', update)
// }
function handleUpdate(update) {
switch (update._) {
case 'updateMessageID':
var randomID = update.random_id
@ -2982,6 +2990,10 @@ angular.module('myApp.services') @@ -2982,6 +2990,10 @@ angular.module('myApp.services')
if (!newDialogsHandlePromise) {
newDialogsHandlePromise = $timeout(handleNewDialogs, 0)
}
if (newUpdatesAfterReloadToHandle[peerID] === undefined) {
newUpdatesAfterReloadToHandle[peerID] = []
}
newUpdatesAfterReloadToHandle[peerID].push(update)
break
}
@ -3455,6 +3467,13 @@ angular.module('myApp.services') @@ -3455,6 +3467,13 @@ angular.module('myApp.services')
}
break
}
}
$rootScope.$on('apiUpdate', function (e, update) {
// if (update._ != 'updateUserStatus') {
// console.log('on apiUpdate', update)
// }
handleUpdate(update)
})
function reloadConversation (peerID) {
@ -3491,6 +3510,12 @@ angular.module('myApp.services') @@ -3491,6 +3510,12 @@ angular.module('myApp.services')
$rootScope.$broadcast('dialog_drop', {peerID: peerID})
}
}
if (newUpdatesAfterReloadToHandle[peerID] !== undefined) {
angular.forEach(newUpdatesAfterReloadToHandle[peerID], function (update) {
handleUpdate(update)
})
delete newUpdatesAfterReloadToHandle[peerID]
}
})
if (hasUpdated) {
$rootScope.$broadcast('dialogs_multiupdate', updatedDialogs)

13
app/js/services.js

@ -1893,7 +1893,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1893,7 +1893,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
apiDoc.duration = attribute.duration
apiDoc.w = attribute.w
apiDoc.h = attribute.h
if (apiDoc.thumb) {
if (apiDoc.thumb &&
attribute.pFlags.round_message) {
apiDoc.type = 'round'
}
else if (apiDoc.thumb) {
apiDoc.type = 'video'
}
break
@ -1935,6 +1939,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1935,6 +1939,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
apiDoc.mime_type = 'video/mp4'
break
case 'video':
case 'round':
apiDoc.mime_type = 'video/mp4'
break
case 'sticker':
@ -2010,6 +2015,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2010,6 +2015,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
boxHeight = Math.min(windowH - 100, Config.Mobile ? 210 : 260)
break
case 'round':
inlineImage = true
boxWidth = Math.min(windowW - 80, 200)
boxHeight = Math.min(windowH - 100, 200)
break
default:
boxWidth = boxHeight = 100
}

75
app/less/app.less

@ -4113,6 +4113,81 @@ h5 { @@ -4113,6 +4113,81 @@ h5 {
opacity: 1;
}
/* Round documents */
.img_round_image_wrap {
position: relative;
overflow: hidden;
border-radius: 50%;
overflow: hidden;
}
.img_round_meta {
background: rgba(0,0,0,0.4);
width: 40px;
height: 40px;
line-height: 0;
position: absolute;
z-index: 2;
border-radius: 50%;
overflow: hidden;
margin: 0 auto;
top: 50%;
left: 50%;
margin-left: -20px;
margin-top: -20px;
pointer-events: none;
}
.icon-cancel {
position: absolute;
top: 50%;
left: 50%;
margin-left: -9px;
margin-top: -1px;
.icon-bar {
display: block;
width: 18px;
height: 2px;
background: #FFF;
transform-origin: 50% 50%;
&:first-child {
.transform(rotate(-45deg));
}
&:last-child {
.transform(translate3d(0,-2px,0) rotate(45deg));
}
}
}
.img_round_thumb {
-webkit-filter: blur(2px);
-moz-filter: blur(2px);
-o-filter: blur(2px);
-ms-filter: blur(2px);
filter: blur(2px);
filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius='3');
transform-origin: center center;
-webkit-transform-origin: center center;
-webkit-transform: scale(1.02, 1.02);
transform: scale(1.02, 1.02);
max-width: 100%;
height: auto;
}
.img_round_meta_contents {
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.2s;
}
.img_round_meta_contents.ng-leave.ng-leave-active,
.img_round_meta_contents.ng-enter {
opacity: 0;
}
.img_round_meta_contents.ng-leave,
.img_round_meta_contents.ng-enter.ng-enter-active {
opacity: 1;
}
.countries_modal_window {
.modal-dialog {
max-width: 392px;

27
app/partials/desktop/full_round.html

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<a class="img_round_with_progress_wrap" ng-click="toggle($event)">
<div class="img_round_image_wrap" ng-style="::{width: document.thumb.width + 'px'}">
<div class="img_round_meta" ng-show="!isActive" ng-switch="document.progress.enabled">
<div ng-switch-when="true" class="img_round_meta_contents">
<i class="icon icon-cancel">
<i class="icon icon-bar"></i>
<i class="icon icon-bar"></i>
</i>
<div my-arc-progress="document.progress.percent"></div>
</div>
<div ng-switch-default class="img_round_meta_contents"><i class="icon icon-videoplay"></i></div>
</div>
<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}}" autoplay class="img_round_video">
<source ng-src="{{document.url}}" type="video/mp4">
</video>
<img ng-switch-default class="img_round_image" ng-src="{{document.url}}" width="{{document.thumb.width}}" height="{{document.thumb.height}}" />
</div>
<img ng-hide="document.downloaded &amp;&amp; isActive" class="img_round_thumb" my-load-thumb thumb="document.thumb" />
</div>
</a>

2
app/partials/desktop/message_attach_document.html

@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
<div ng-switch-when="gif" my-load-gif document="media.document"></div>
<div ng-switch-when="round" my-load-round document="media.document"></div>
<div ng-switch-when="sticker" my-load-sticker document="media.document" open="true"></div>
<div ng-switch-when="voice" class="im_message_audio">

1
app/partials/desktop/message_service.html

@ -50,6 +50,7 @@ @@ -50,6 +50,7 @@
<span ng-if="historyMessage.action.duration > 0" ng-bind="historyMessage.action.duration | duration" class="im_service_message_phonecall_duration"></span>
</a>
<span ng-switch-when="messageActionPaymentSent" class="message_service_payment_sent"></span>
<span ng-switch-default my-i18n="message_service_unsupported_action">
<my-i18n-param name="action"><span ng-bind="historyMessage.action._"></span></my-i18n-param>

3
app/partials/desktop/short_message.html

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
<my-i18n msgid="conversation_media_sticker"></my-i18n>
</span>
<span ng-switch-when="gif" my-i18n="conversation_media_gif"></span>
<span ng-switch-when="round" my-i18n="conversation_media_round"></span>
<span ng-switch-when="audio" my-i18n="conversation_media_audio"></span>
<span ng-switch-when="voice" my-i18n="conversation_media_audio"></span>
<span ng-switch-when="video" my-i18n="conversation_media_video"></span>
@ -18,6 +19,7 @@ @@ -18,6 +19,7 @@
<span my-emoji-image="🎮"></span>
<span ng-bind-html="message.media.game.rTitle"></span>
</span>
<span ng-switch-when="messageMediaUnsupported" my-i18n="conversation_media_unsupported"></span>
</span><span class="im_short_message_service" ng-if="message._ == 'messageService'" ng-switch="message.action._">
<span ng-switch-when="messageActionChatCreate" my-i18n="conversation_group_created"></span>
<span ng-switch-when="messageActionChatEditTitle" my-i18n="conversation_group_renamed"></span>
@ -55,5 +57,6 @@ @@ -55,5 +57,6 @@
<span ng-switch-when="out_ok" my-i18n="message_service_phonecall_outgoing"></span>
<span ng-switch-when="in_ok" my-i18n="message_service_phonecall_incoming"></span>
</span>
<span ng-switch-when="messageActionPaymentSent" my-i18n="message_service_payment_sent"></span>
</span><span class="im_short_message_text" ng-if="message.message.length && (!message.media || message.media._ == 'messageMediaWebPage')" ng-bind-html="message.richMessage"></span>

2
app/partials/mobile/message_attach_document.html

@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
<div ng-switch-when="gif" my-load-gif document="media.document"></div>
<div ng-switch-when="round" my-load-round document="media.document"></div>
<div ng-switch-when="sticker" my-load-sticker document="media.document" open="true"></div>
<div ng-switch-when="voice" class="im_message_audio">

2
app/partials/mobile/message_service.html

@ -50,6 +50,8 @@ @@ -50,6 +50,8 @@
<span ng-if="historyMessage.action.duration > 0" ng-bind="historyMessage.action.duration | duration" class="im_service_message_phonecall_duration"></span>
</a>
<span ng-switch-when="messageActionPaymentSent" class="message_service_payment_sent"></span>
<span ng-switch-default my-i18n="message_service_unsupported_action">
<my-i18n-param name="action"><span ng-bind="historyMessage.action._"></span></my-i18n-param>
</span>

Loading…
Cancel
Save