diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..1152e419
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,172 @@
+### 0.5.7
+* Video messages and Telescope
+* Notifications about new logins
+* Changelog is now received as a message
+
+### 0.5.6
+* Edit the text of your messages after sending them. This works across all Telegram chats, including groups and one-on-one conversations. Select a message and click 'Edit' or just press the up arrow button to edit your last message.
+* Unsend Messages: retract any messages within 48 hours of sending them. Check out the [Telegram Blog](https://telegram.org/blog/unsend-and-usage) for more info.
+* Pinned chats. Check out the [Telegram Blog](https://telegram.org/blog/pin-and-ifttt) for more info.
+* Sticker suggestions by emoji.
+* Search for messages in specific chats.
+* Background notifications in Chrome and Firefox (can be disabled in Settings)
+
+### 0.5.5
+* Introducing Drafts: Seamless syncing for unsent messages on all your devices. Drafts are now visible in your chats list.
+* Mention people in groups by typing @ and selecting them from the list — even if they don't have a username.
+* Share links to specific posts in channels via quick forwarding menu (click on the date in a message to try this out).
+
+### 0.5.4
+* Introducing Bot API 2.0, the biggest update to our bot platform since June 2015.
+* New inline keyboards with callback, 'open URL' or 'switch to inline mode' buttons help create seamless interfaces.
+* Bots can now update existing messages on the fly as you interact with them.
+* Prepare for the rise of location-based bots: all bots can now ask users to share their location.
+* Inline bots can now send all attachments supported in Telegram (videos, music, stickers, files, etc.).
+* Try out these sample bots to see what's coming your way soon: @music, @sticker, @youtube, @foursquare
+* Check out the [Telegram Blog](https://telegram.org/blog/bots-2-0) for more info.
+* New quick forwarding in channels (click on the date in a message to try this out).
+* Improved performance.
+
+### 0.5.3
+* Inline bots: A new way to add bot content to any chat. Type a bot's username and your query in the text field to get instant results and send them to your chat partner. Try typing `@gif dog` in your next chat. Sample bots: @gif, @wiki, @bing, @vid, @bold.
+* Check out the [Telegram Blog](https://telegram.org/blog/inline-bots) for more info.
+* Improved GIFs: 20x faster sending and downloading, nice animated progress
+* Click on message date to reply (or to forward from channels).
+* Preview images before sending when pasting from clipboard.
+* Improved formatting for copy-pasted history fragments (date, time and sender names inserted automatically).
+
+### 0.5.2
+* Unread counters for muted chats now colored in gray.
+* Improved previews for sticker sets: Click on a sticker to view the whole set, click on stickers in a set to send right away, added a 'Share' button.
+* Improved performance.
+
+### 0.5.1
+* Groups that have reached their capacity of 200 users can be upgraded to supergroups of up to 1,000 members.
+* Check out the [Telegram Blog](https://telegram.org/blog/supergroups) for more info
+
+### 0.5.0
+* Removed annoying "multiple tabs open" error.
+* Improved message forwarding.
+* Added view counter to messages from channels.
+* Improved image loading in Safari and Firefox.
+
+### 0.4.9
+* New emoji and sticker menu, tabs for sticker packs.
+
+### 0.4.8
+* Introducing Channels – a great new way to broadcast your messages to unlimited audiences.
+* Check out the [Telegram Blog](https://telegram.org/blog/channels) for more info
+* Improved performance in Safari on OS X El Capitan.
+* Added formatting for fixed-width code, surround text with `single backticks` for inline text and ```triple backticks``` for blocks of pre-formatted text.
+
+### 0.4.7
+* New bot API, free for everyone. If you're an engineer, create your own bots for games, services or integrations.
+
+* Check out [Telegram Blog](https://telegram.org/blog/bot-revolution) for more info
+* Improved Stickers support: now stickers are loading much faster.
+* Click on any custom stickers in chats to view and add sticker sets.
+* [Mobile] Reply to a message easily: tap on any message and select "Reply".
+
+### 0.4.6
+* Install and share custom sticker sets like this one: telegram.me/addstickers/Animals
+* If you're an artist, create custom sticker sets using our @Stickers bot.
+* Check out [Telegram Blog](https://telegram.org/blog/stickers-revolution) for more info
+
+### 0.4.5
+* Invite links for group chats:
+ Check out [Telegram Blog](https://telegram.org/blog/invite-links) for more info
+* Smart notifications
+* 'Listened' status for voice messages
+* Places in locations (venues, landmarks)
+
+### 0.4.4
+* Link Previews:
+Get rich link summaries for tweets, YouTube videos, Instagram photos and other content.
+* Check out [Telegram Blog](https://telegram.org/blog/link-preview) for more info.
+
+### 0.4.3
+* Sessions List:
+View your active Telegram sessions (on desktop, tablet and mobile devices) and close specific sessions remotely.
+
+* Two-step verification:
+ Set up an additional password that will be required to log into your Telegram account.
+* Check out [Telegram Blog](https://telegram.org/blog/sessions-and-2-step-verification) for more info.
+
+### 0.4.2
+* Optimization for screens with smaller Y-resolutions.
+* Supported Spotify URL embeds.
+* Mentions of the current user in group chats are now highlighted.
+
+### 0.4.1
+* Reply to specific messages in groups.
+* Mention @usernames in groups to notify multiple users.
+* Revised notifications in groups: mentioned users and people you reply to will be notified (private chat notification settings apply in this case instead of group settings). Check out Telegram Blog for more info.
+* Setting to disable message preview
+
+### 0.4.0
+* Full stickers support
+* Multisearch box: instantly find chats, usernames and messages
+* Emoji autocomplete: e.g., type **:kiss<** in the message field to see the list. [Full cheat sheet](http://www.emoji-cheat-sheet.com/)
+* Added 'typing' notification in chats list
+* Online members counter in group headers
+
+### 0.3.9
+* [Desktop] Material design completed
+
+### 0.3.8
+* Telegram.me links open right in Telegram Web when authorized
+* @username mentions in messages are clickable and open a conversation with the user
+
+### 0.3.7
+* [Desktop] New material design for modal windows
+* [Desktop] Forward messages to multiple recipients
+
+### 0.3.6
+* New viewer for photos, videos, documents.
+* [FirefoxOS] Improved media downloads.
+
+### 0.3.5
+* Added embedded Soundcloud tracks and playlists.
+* Added global user search to contacts list.
+* Added switch to mobile version on window resize.
+* Migrate to HTTPS notification
+* Bugfixes.
+
+### 0.3.4
+* Added embedded Facebook posts and Vimeo videos.
+* Improved IE10+ support: downloading files and style fixes.
+* Added unsupported media playback warning.
+* Bugfixes.
+
+### 0.3.3
+* Added Native Client module: dramatically improved encryption speed; Download and upload speed is now as high as in native applications.
+* HTTPS. We recommend you to use https://web.telegram.org.
+* Added multiple open tabs warning. Please note, that only one tab with Telegram Web will work.
+* Added embedded Instagram, Twitter, Vine, YouTube links.
+* Jump to selected spot when playing back audio.
+* Bugfixes
+
+### 0.3.2
+* Usernames support.
+* Search can now find public users by username.
+* Most popular emoticons shown in 'recent' when empty
+* [ChromeApp] Added saving window position and size
+* Bugfixes
+
+### 0.3.1
+* New languages: Spanish, German and Italian are now available
+* New custom-made audio player
+* Bad browser page for IE 6-9
+* Perfomance improvements and bugfixes
+
+### 0.3.0
+* Log in codes may be received in other Telegram apps
+* Partner's online status updates automatically
+* Added support for non-english hashtags in messages
+* Fixed invalid scrollbar width bug
+* [Desktop] Added automatic country code detection
+* [FirefoxOS] Improved PUSH-notifications for <= 1.1
+* [FirefoxOS] Fixed emoji in notifications
+* [FirefoxOS] Fixed attachment bug for <= 1.1
+* [FirefoxOS] Added phonebook permissions handling
+* [FirefoxOS] Added ability to share Gallery photos in Telegram
diff --git a/app/img/icons/IconsetW.png b/app/img/icons/IconsetW.png
index dfbe1362..9e8d7ede 100644
Binary files a/app/img/icons/IconsetW.png and b/app/img/icons/IconsetW.png differ
diff --git a/app/img/icons/IconsetW_2x.png b/app/img/icons/IconsetW_2x.png
index 19e6472b..d8519014 100644
Binary files a/app/img/icons/IconsetW_2x.png and b/app/img/icons/IconsetW_2x.png differ
diff --git a/app/index.html b/app/index.html
index 0d92c41c..96b12467 100644
--- a/app/index.html
+++ b/app/index.html
@@ -37,6 +37,7 @@
+
@@ -72,6 +73,13 @@
+
+
+
+
+
+
+
diff --git a/app/js/app.js b/app/js/app.js
index e9ea0ed6..c5c88f38 100644
--- a/app/js/app.js
+++ b/app/js/app.js
@@ -1,5 +1,5 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
diff --git a/app/js/background.js b/app/js/background.js
index 732730e9..80317ffd 100644
--- a/app/js/background.js
+++ b/app/js/background.js
@@ -1,11 +1,12 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
chrome.app.runtime.onLaunched.addListener(function (launchData) {
+ var isWindows = typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.match(/windows/i) ? true : false
chrome.app.window.create('../index.html', {
id: 'webogram-chat',
innerBounds: {
@@ -14,6 +15,6 @@ chrome.app.runtime.onLaunched.addListener(function (launchData) {
},
minWidth: 320,
minHeight: 400,
- frame: { color: "#5682a3" }
+ frame: isWindows ? { color: '#5682a3' } : 'chrome'
})
})
diff --git a/app/js/controllers.js b/app/js/controllers.js
index 2057bb6e..7eb5b6a1 100644
--- a/app/js/controllers.js
+++ b/app/js/controllers.js
@@ -1,5 +1,5 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
@@ -31,7 +31,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
LayoutSwitchService.start()
})
- .controller('AppLoginController', function ($scope, $rootScope, $location, $timeout, $modal, $modalStack, MtpApiManager, ErrorService, NotificationsManager, PasswordManager, ChangelogNotifyService, IdleManager, LayoutSwitchService, TelegramMeWebService, _) {
+ .controller('AppLoginController', function ($scope, $rootScope, $location, $timeout, $modal, $modalStack, MtpApiManager, ErrorService, NotificationsManager, PasswordManager, ChangelogNotifyService, IdleManager, LayoutSwitchService, WebPushApiManager, TelegramMeWebService, _) {
$modalStack.dismissAll()
IdleManager.start()
@@ -47,6 +47,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
return
}
TelegramMeWebService.setAuthorized(false)
+ WebPushApiManager.forceUnsubscribe()
})
var options = {dcID: 2, createNetworker: true}
@@ -219,6 +220,10 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.error = {field: 'phone'}
error.handled = true
break
+
+ case 'PHONE_NUMBER_APP_SIGNUP_FORBIDDEN':
+ $scope.error = {field: 'phone'}
+ break
}
})['finally'](function () {
if ($rootScope.idle.isIDLE || tsNow() - authKeyStarted > 60000) {
@@ -1224,7 +1229,8 @@ angular.module('myApp.controllers', ['myApp.i18n'])
photos: 'inputMessagesFilterPhotos',
video: 'inputMessagesFilterVideo',
documents: 'inputMessagesFilterDocument',
- audio: 'inputMessagesFilterVoice'
+ audio: 'inputMessagesFilterVoice',
+ round: 'inputMessagesFilterRoundVideo',
}
var jump = 0
var moreJump = 0
@@ -2146,8 +2152,8 @@ angular.module('myApp.controllers', ['myApp.i18n'])
var lastIsRead = !historyMessage || !historyMessage.pFlags.unread
for (i = 0; i < len; i++) {
messageID = msgs[i]
- if (messageID < maxID ||
- history.ids.indexOf(messageID) !== -1) {
+ if (messageID > 0 && messageID < maxID ||
+ history.ids.indexOf(messageID) !== -1) {
continue
}
historyMessage = AppMessagesManager.wrapForHistory(messageID)
@@ -2315,6 +2321,8 @@ angular.module('myApp.controllers', ['myApp.i18n'])
send: submitMessage,
replyClear: replyClear,
fwdsClear: fwdsClear,
+ toggleSlash: toggleSlash,
+ replyKeyboardToggle: replyKeyboardToggle,
type: 'new'
}
$scope.mentions = {}
@@ -2341,9 +2349,6 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.$on('last_message_edit', setEditLastMessage)
- $scope.replyKeyboardToggle = replyKeyboardToggle
- $scope.toggleSlash = toggleSlash
-
$rootScope.$watch('idle.isIDLE', function (newVal) {
if ($rootScope.idle.initial) {
return
@@ -3537,7 +3542,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
$scope.$on('history_delete', function (e, historyUpdate) {
- if (historyUpdate.msgs[$scope.messageID]) {
+ if (historyUpdate && historyUpdate.msgs && historyUpdate.msgs[$scope.messageID]) {
$modalInstance.dismiss()
}
})
@@ -3571,7 +3576,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
$scope.$on('history_delete', function (e, historyUpdate) {
- if (historyUpdate.msgs[$scope.messageID]) {
+ if (historyUpdate && historyUpdate.msgs && historyUpdate.msgs[$scope.messageID]) {
$modalInstance.dismiss()
}
})
@@ -4455,9 +4460,11 @@ angular.module('myApp.controllers', ['myApp.i18n'])
AppUsersManager.saveApiUser(user)
$modalInstance.close()
}, function (error) {
- if (error.type == 'USERNAME_NOT_MODIFIED') {
- error.handled = true
- $modalInstance.close()
+ switch (error.type) {
+ case 'USERNAME_NOT_MODIFIED':
+ error.handled = true
+ $modalInstance.close()
+ break
}
})['finally'](function () {
delete $scope.profile.updating
@@ -4470,9 +4477,9 @@ angular.module('myApp.controllers', ['myApp.i18n'])
return
}
MtpApiManager.invokeApi('account.checkUsername', {
- username: newVal || ''
+ username: newVal
}).then(function (valid) {
- if ($scope.profile.username != newVal) {
+ if ($scope.profile.username !== newVal) {
return
}
if (valid) {
@@ -4481,7 +4488,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.checked = {error: true}
}
}, function (error) {
- if ($scope.profile.username != newVal) {
+ if ($scope.profile.username !== newVal) {
return
}
switch (error.type) {
diff --git a/app/js/directives.js b/app/js/directives.js
index d039e02a..3770c5b2 100755
--- a/app/js/directives.js
+++ b/app/js/directives.js
@@ -1,5 +1,5 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
@@ -1494,6 +1494,9 @@ angular.module('myApp.directives', ['myApp.filters'])
return
}
if ($(sendFormWrap).is(':visible')) {
+ if (!sendForm || !sendForm.offsetHeight) {
+ sendForm = $('.im_send_form', element)[0]
+ }
$(sendFormWrap).css({
height: $(sendForm).height()
})
@@ -1547,30 +1550,44 @@ angular.module('myApp.directives', ['myApp.filters'])
}
})
- .directive('mySendForm', function (_, $q, $timeout, $compile, $modalStack, $http, $interpolate, Storage, AppStickersManager, AppDocsManager, ErrorService, AppInlineBotsManager, FileManager, shouldFocusOnInteraction) {
+ .directive('mySendForm', function (_, $q, $timeout, $interval, $window, $compile, $modalStack, $http, $interpolate, Storage, AppStickersManager, AppDocsManager, ErrorService, AppInlineBotsManager, FileManager, shouldFocusOnInteraction) {
+
return {
link: link,
+ templateUrl: templateUrl('send_form'),
scope: {
draftMessage: '=',
+ replyKeyboard: '=',
mentions: '=',
commands: '='
}
}
function link ($scope, element, attrs) {
+ var messageFieldWrap = $('.im_send_field_wrap', element)[0]
var messageField = $('textarea', element)[0]
var emojiButton = $('.composer_emoji_insert_btn', element)[0]
var emojiPanel = $('.composer_emoji_panel', element)[0]
var fileSelects = $('input', element)
var dropbox = $('.im_send_dropbox_wrap', element)[0]
- var messageFieldWrap = $('.im_send_field_wrap', element)[0]
var dragStarted
var dragTimeout
var submitBtn = $('.im_submit', element)[0]
+ var voiceRecorderWrap = $('.im_voice_recorder_wrap', element)[0]
+ var voiceRecordBtn = $('.im_record', element)[0]
var stickerImageCompiled = $compile('')
var cachedStickerImages = {}
+ var voiceRecorder = null
+ var voiceRecordSupported = Recorder.isRecordingSupported()
+ var voiceRecordDurationInterval = null
+ if (voiceRecordSupported) {
+ element.addClass('im_record_supported')
+ }
+
+ $scope.voiceRecorder = {duration: 0, recording: false, processing: false}
+
var emojiTooltip = new EmojiTooltip(emojiButton, {
getStickers: function (callback) {
AppStickersManager.getStickers().then(callback)
@@ -1683,6 +1700,138 @@ angular.module('myApp.directives', ['myApp.filters'])
})
})
+ $(voiceRecordBtn).on('contextmenu', cancelEvent)
+
+ var voiceRecordTouch = Config.Navigator.touch ? true : false
+ var voiceRecordEvents = {
+ start: voiceRecordTouch ? 'touchstart' : 'mousedown',
+ move: voiceRecordTouch ? 'touchmove' : 'mousemove',
+ stop: voiceRecordTouch ? 'touchend blur' : 'mouseup blur'
+ }
+ var onRecordStart, onRecordStreamReady, onRecordStop
+
+ $(voiceRecordBtn).on(voiceRecordEvents.start, function(event) {
+ if ($scope.voiceRecorder.processing) {
+ return
+ }
+
+ voiceRecorder = new Recorder({
+ monitorGain: 0,
+ numberOfChannels: 1,
+ bitRate: 64000,
+ encoderSampleRate: 48000,
+ encoderPath: 'vendor/recorderjs/encoder_worker.js'
+ })
+
+ onRecordStart = function(e) {
+ var startTime = tsNow(true)
+
+ voiceRecordDurationInterval = $interval(function() {
+ $scope.voiceRecorder.duration = tsNow(true) - startTime
+ }, 1000)
+
+ $scope.$apply(function() {
+ $scope.voiceRecorder.recording = true
+ })
+ }
+ voiceRecorder.addEventListener('start', onRecordStart)
+
+ onRecordStreamReady = function(e) {
+ voiceRecorder.start()
+ }
+ voiceRecorder.addEventListener('streamReady', onRecordStreamReady)
+
+ voiceRecorder.initStream()
+
+ var curHover = false
+ var curBoundaries = {}
+
+ var updateVoiceHoverBoundaries = function () {
+ var boundElement = $('.im_bottom_panel_wrap')
+ var offset = boundElement.offset()
+ curBoundaries = {
+ top: offset.top,
+ left: offset.left,
+ width: boundElement.outerWidth(),
+ height: boundElement.outerHeight(),
+ }
+ }
+
+ var updateVoiceHoveredClass = function (event, returnHover) {
+ var originalEvent = event.originalEvent || event
+ var touch = voiceRecordTouch
+ ? originalEvent.changedTouches && originalEvent.changedTouches[0]
+ : originalEvent
+ var isHover = touch &&
+ touch.pageX >= curBoundaries.left &&
+ touch.pageX <= curBoundaries.left + curBoundaries.width &&
+ touch.pageY >= curBoundaries.top &&
+ touch.pageY <= curBoundaries.top + curBoundaries.height
+
+ if (curHover != isHover) {
+ element.toggleClass('im_send_form_hover', isHover)
+ curHover = isHover
+ }
+ return returnHover && isHover
+ }
+
+ updateVoiceHoverBoundaries()
+ updateVoiceHoveredClass(event)
+
+ onRecordStop = function(event) {
+ $($window).off(voiceRecordEvents.move, updateVoiceHoveredClass)
+ $($window).off(voiceRecordEvents.stop, onRecordStop)
+
+ var isHover = event == 'blur' ? false : updateVoiceHoveredClass(event, true)
+
+ if ($scope.voiceRecorder.duration > 0 && isHover) {
+ $scope.voiceRecorder.processing = true
+ voiceRecorder.addEventListener('dataAvailable', function(e) {
+ var blob = blobConstruct([e.detail], 'audio/ogg')
+ console.warn(dT(), 'got audio', blob)
+
+ $scope.$apply(function () {
+ if (blob.size !== undefined &&
+ blob.size > 1024) {
+ $scope.draftMessage.files = [blob]
+ $scope.draftMessage.isMedia = true
+ }
+
+ $scope.voiceRecorder.processing = false
+ })
+ })
+ }
+ cancelRecord()
+ }
+
+ if (!Config.Mobile) {
+ $(voiceRecorderWrap).css({
+ height: messageFieldWrap.offsetHeight,
+ width: messageFieldWrap.offsetWidth
+ })
+ }
+
+ $($window).on(voiceRecordEvents.move, updateVoiceHoveredClass)
+ $($window).one(voiceRecordEvents.stop, onRecordStop)
+ })
+
+ function cancelRecord() {
+ if (voiceRecorder) {
+ voiceRecorder.stop()
+ voiceRecorder.removeEventListener('streamReady', onRecordStreamReady)
+ voiceRecorder.removeEventListener('start', onRecordStart)
+ }
+
+ if ($scope.voiceRecorder.recording) {
+ $interval.cancel(voiceRecordDurationInterval)
+
+ $scope.$apply(function() {
+ $scope.voiceRecorder.recording = false
+ $scope.voiceRecorder.duration = 0
+ })
+ }
+ }
+
var sendOnEnter = true
function updateSendSettings () {
Storage.get('send_ctrlenter').then(function (sendOnCtrl) {
@@ -1867,12 +2016,11 @@ angular.module('myApp.directives', ['myApp.filters'])
if (e.type == 'dragenter' || e.type == 'dragover') {
if (dragStateChanged) {
- if (!Config.Mobile) {
- $(emojiButton).hide()
- }
- $(dropbox)
- .css({height: messageFieldWrap.offsetHeight + 2, width: messageFieldWrap.offsetWidth})
- .show()
+ $(dropbox).css({
+ height: messageFieldWrap.offsetHeight,
+ width: messageFieldWrap.offsetWidth
+ })
+ element.addClass('im_send_form_dragging')
}
} else {
if (e.type == 'drop') {
@@ -1882,10 +2030,7 @@ angular.module('myApp.directives', ['myApp.filters'])
})
}
dragTimeout = setTimeout(function () {
- $(dropbox).hide()
- if (!Config.Mobile) {
- $(emojiButton).show()
- }
+ element.removeClass('im_send_form_dragging')
dragStarted = false
dragTimeout = false
}, 300)
@@ -2195,13 +2340,95 @@ angular.module('myApp.directives', ['myApp.filters'])
}, 200)
})
}
+ }
+ })
+
+ .directive('myLoadRound', function (AppDocsManager, $timeout) {
- // Autoplay small GIFs
- // if (!Config.Mobile &&
- // $scope.document.size &&
- // $scope.document.size < 1024 * 1024) {
- // $scope.toggle()
- // }
+ 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)
+ })
+ }
+
+ $scope.$on('ui_history_change', function () {
+ if ($scope.isActive) {
+ $scope.toggle()
+ }
+ })
}
})
@@ -2411,18 +2638,23 @@ angular.module('myApp.directives', ['myApp.filters'])
function link ($scope, element, attrs) {
var width = element.attr('width') || 200
var height = element.attr('height') || 200
- var apiKey = Config.ExtCredentials.gmaps.api_key
var zoom = width > 200 ? 15 : 13
+ var useGoogle = false
+ var src
- element.attr('src', 'img/blank.gif')
-
- var src = 'https://maps.googleapis.com/maps/api/staticmap?sensor=false¢er=' + $scope.point['lat'] + ',' + $scope.point['long'] + '&zoom=' + zoom + '&size=' + width + 'x' + height + '&scale=2&markers=color:red|size:big|' + $scope.point['lat'] + ',' + $scope.point['long']
- var useApiKey = true
-
- if (useApiKey) {
- src += '&key=' + apiKey
+ if (useGoogle) {
+ var apiKey = Config.ExtCredentials.gmaps.api_key
+ var useApiKey = true
+ src = 'https://maps.googleapis.com/maps/api/staticmap?sensor=false¢er=' + $scope.point['lat'] + ',' + $scope.point['long'] + '&zoom=' + zoom + '&size=' + width + 'x' + height + '&scale=2&markers=color:red|size:big|' + $scope.point['lat'] + ',' + $scope.point['long']
+ if (useApiKey) {
+ src += '&key=' + apiKey
+ }
+ } else {
+ src = 'https://static-maps.yandex.ru/1.x/?l=map&ll=' + $scope.point['long'] + ',' + $scope.point['lat'] + '&z=' + zoom + '&size=' + width + ',' + height + '&scale=1&pt=' + $scope.point['long'] + ',' + $scope.point['lat'] + ',pm2rdm&lang=en_US'
}
+ element.attr('src', 'img/blank.gif')
+
ExternalResourcesManager.downloadByURL(src).then(function (url) {
element.attr('src', url.valueOf())
})
@@ -3033,8 +3265,31 @@ angular.module('myApp.directives', ['myApp.filters'])
}
})
+ .directive('myOgvPlayer', function ($compile) {
+ return {
+ link: function ($scope, $element, $attrs) {
+ var audio = $scope.audio
+ var playerEl
+ if (audio.mime_type == 'audio/ogg' &&
+ // false &&
+ OGVCompat.hasWebAudio() && // we don't want to use Flash
+ OGVCompat.supported('OGVPlayer')) {
+ playerEl = new OGVPlayer({debug: false, worker: false})
+ } else {
+ playerEl = document.createElement('audio')
+ }
+
+ $(playerEl).attr('media-player', $attrs.myOgvPlayer)
+ $(playerEl).attr('src', '{{::' + $attrs.src + '}}')
+
+ $compile(playerEl)($scope)
+ $($element).append(playerEl)
+ }
+ }
+ })
+
.directive('myAudioPlayer', function ($timeout, $q, Storage, AppDocsManager, AppMessagesManager, ErrorService) {
- var currentPlayer = false
+ var currentPlayerScope = false
var audioVolume = 0.5
Storage.get('audio_volume').then(function (newAudioVolume) {
@@ -3060,20 +3315,23 @@ angular.module('myApp.directives', ['myApp.filters'])
return {
link: link,
scope: {
- audio: '=',
- message: '='
+ audio: '='
},
templateUrl: templateUrl('audio_player')
}
- function checkPlayer (newPlayer) {
- if (newPlayer === currentPlayer) {
+ function checkAudioPlayer (newPlayerScope) {
+ if (newPlayerScope === currentPlayerScope) {
return false
}
- if (currentPlayer) {
- currentPlayer.pause()
+ if (currentPlayerScope) {
+ ;(function ($scope) {
+ setZeroTimeout(function () {
+ $scope.mediaPlayer.player.pause()
+ })
+ })(currentPlayerScope)
}
- currentPlayer = newPlayer
+ currentPlayerScope = newPlayerScope
}
function link ($scope, element, attrs) {
@@ -3081,20 +3339,34 @@ angular.module('myApp.directives', ['myApp.filters'])
$scope.volume = audioVolume
$scope.mediaPlayer = {}
+ if ($scope.$parent.messageId) {
+ $scope.message = AppMessagesManager.wrapForHistory($scope.$parent.messageId)
+ }
$scope.download = function () {
AppDocsManager.saveDocFile($scope.audio.id)
}
+ $scope.duration = function () {
+ if ($scope.mediaPlayer.player &&
+ $scope.mediaPlayer.player.duration > 0 &&
+ $scope.mediaPlayer.player.duration < Infinity) {
+ return $scope.mediaPlayer.player.duration
+ }
+ return $scope.audio && $scope.audio.duration || 0
+ }
+
$scope.togglePlay = function () {
if ($scope.audio.url) {
- checkPlayer($scope.mediaPlayer.player)
- $scope.mediaPlayer.player.playPause()
+ checkAudioPlayer($scope)
+ setZeroTimeout(function () {
+ $scope.mediaPlayer.player.playPause()
+ })
} else if ($scope.audio.progress && $scope.audio.progress.enabled) {
} else {
AppDocsManager.downloadDoc($scope.audio.id).then(function () {
onContentLoaded(function () {
- var errorListenerEl = $('audio', element)[0] || element[0]
+ var errorListenerEl = $('audio, ogvjs', element)[0] || element[0]
if (errorListenerEl) {
var errorAlready = false
var onAudioError = function (event) {
@@ -3122,13 +3394,13 @@ angular.module('myApp.directives', ['myApp.filters'])
})
}
setTimeout(function () {
- checkPlayer($scope.mediaPlayer.player)
+ checkAudioPlayer($scope)
$scope.mediaPlayer.player.setVolume(audioVolume)
$scope.mediaPlayer.player.play()
if ($scope.message &&
- !$scope.message.pFlags.out &&
- $scope.message.pFlags.media_unread) {
+ !$scope.message.pFlags.out &&
+ $scope.message.pFlags.media_unread) {
AppMessagesManager.readMessages([$scope.message.mid])
}
}, 300)
@@ -3773,4 +4045,4 @@ angular.module('myApp.directives', ['myApp.filters'])
return {
link: link
}
- })
+ })
\ No newline at end of file
diff --git a/app/js/directives_mobile.js b/app/js/directives_mobile.js
index d5b79d6b..082a9f1d 100644
--- a/app/js/directives_mobile.js
+++ b/app/js/directives_mobile.js
@@ -1,5 +1,5 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
diff --git a/app/js/filters.js b/app/js/filters.js
index 2e9549d5..2840c7e8 100644
--- a/app/js/filters.js
+++ b/app/js/filters.js
@@ -1,5 +1,5 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
diff --git a/app/js/lib/bin_utils.js b/app/js/lib/bin_utils.js
index 74282fb6..e2ca7dfd 100644
--- a/app/js/lib/bin_utils.js
+++ b/app/js/lib/bin_utils.js
@@ -1,5 +1,5 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
diff --git a/app/js/lib/config.js b/app/js/lib/config.js
index 1d3a27f9..ab4bcdcf 100644
--- a/app/js/lib/config.js
+++ b/app/js/lib/config.js
@@ -1,5 +1,5 @@
/*!
- * Webogram v0.5.6 - messaging web application for MTProto
+ * Webogram v0.6.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov
* https://github.com/zhukov/webogram/blob/master/LICENSE
@@ -20,7 +20,7 @@ Config = window.Config || {}
Config.App = {
id: 2496,
hash: '8da85b0d5bfe62527e5b244c209159c3',
- version: '0.5.6',
+ version: '0.6.0',
domains: ['web.telegram.org', 'zhukov.github.io']
}
@@ -100,9 +100,9 @@ Config.Schema.MTProto = {'constructors': [{'id': '481674261','predicate': 'vecto
// From https://github.com/stephenmathieson/node-tlds/blob/master/index.js
Config.TLD = ['abogado', 'ac', 'academy', 'accountants', 'active', 'actor', 'ad', 'adult', 'ae', 'aero', 'af', 'ag', 'agency', 'ai', 'airforce', 'al', 'allfinanz', 'alsace', 'am', 'amsterdam', 'an', 'android', 'ao', 'apartments', 'aq', 'aquarelle', 'ar', 'archi', 'army', 'arpa', 'as', 'asia', 'associates', 'at', 'attorney', 'au', 'auction', 'audio', 'autos', 'aw', 'ax', 'axa', 'az', 'ba', 'band', 'bank', 'bar', 'barclaycard', 'barclays', 'bargains', 'bayern', 'bb', 'bd', 'be', 'beer', 'berlin', 'best', 'bf', 'bg', 'bh', 'bi', 'bid', 'bike', 'bingo', 'bio', 'biz', 'bj', 'black', 'blackfriday', 'bloomberg', 'blue', 'bm', 'bmw', 'bn', 'bnpparibas', 'bo', 'boo', 'boutique', 'br', 'brussels', 'bs', 'bt', 'budapest', 'build', 'builders', 'business', 'buzz', 'bv', 'bw', 'by', 'bz', 'bzh', 'ca', 'cab', 'cal', 'camera', 'camp', 'cancerresearch', 'canon', 'capetown', 'capital', 'caravan', 'cards', 'care', 'career', 'careers', 'cartier', 'casa', 'cash', 'cat', 'catering', 'cc', 'cd', 'center', 'ceo', 'cern', 'cf', 'cg', 'ch', 'channel', 'chat', 'cheap', 'christmas', 'chrome', 'church', 'ci', 'citic', 'city', 'ck', 'cl', 'claims', 'cleaning', 'click', 'clinic', 'clothing', 'club', 'cm', 'cn', 'co', 'coach', 'codes', 'coffee', 'college', 'cologne', 'com', 'community', 'company', 'computer', 'condos', 'construction', 'consulting', 'contractors', 'cooking', 'cool', 'coop', 'country', 'cr', 'credit', 'creditcard', 'cricket', 'crs', 'cruises', 'cu', 'cuisinella', 'cv', 'cw', 'cx', 'cy', 'cymru', 'cz', 'dabur', 'dad', 'dance', 'dating', 'day', 'dclk', 'de', 'deals', 'degree', 'delivery', 'democrat', 'dental', 'dentist', 'desi', 'design', 'dev', 'diamonds', 'diet', 'digital', 'direct', 'directory', 'discount', 'dj', 'dk', 'dm', 'dnp', 'do', 'docs', 'domains', 'doosan', 'durban', 'dvag', 'dz', 'eat', 'ec', 'edu', 'education', 'ee', 'eg', 'email', 'emerck', 'energy', 'engineer', 'engineering', 'enterprises', 'equipment', 'er', 'es', 'esq', 'estate', 'et', 'eu', 'eurovision', 'eus', 'events', 'everbank', 'exchange', 'expert', 'exposed', 'fail', 'farm', 'fashion', 'feedback', 'fi', 'finance', 'financial', 'firmdale', 'fish', 'fishing', 'fit', 'fitness', 'fj', 'fk', 'flights', 'florist', 'flowers', 'flsmidth', 'fly', 'fm', 'fo', 'foo', 'forsale', 'foundation', 'fr', 'frl', 'frogans', 'fund', 'furniture', 'futbol', 'ga', 'gal', 'gallery', 'garden', 'gb', 'gbiz', 'gd', 'ge', 'gent', 'gf', 'gg', 'ggee', 'gh', 'gi', 'gift', 'gifts', 'gives', 'gl', 'glass', 'gle', 'global', 'globo', 'gm', 'gmail', 'gmo', 'gmx', 'gn', 'goog', 'google', 'gop', 'gov', 'gp', 'gq', 'gr', 'graphics', 'gratis', 'green', 'gripe', 'gs', 'gt', 'gu', 'guide', 'guitars', 'guru', 'gw', 'gy', 'hamburg', 'hangout', 'haus', 'healthcare', 'help', 'here', 'hermes', 'hiphop', 'hiv', 'hk', 'hm', 'hn', 'holdings', 'holiday', 'homes', 'horse', 'host', 'hosting', 'house', 'how', 'hr', 'ht', 'hu', 'ibm', 'id', 'ie', 'ifm', 'il', 'im', 'immo', 'immobilien', 'in', 'industries', 'info', 'ing', 'ink', 'institute', 'insure', 'int', 'international', 'investments', 'io', 'iq', 'ir', 'irish', 'is', 'it', 'iwc', 'jcb', 'je', 'jetzt', 'jm', 'jo', 'jobs', 'joburg', 'jp', 'juegos', 'kaufen', 'kddi', 'ke', 'kg', 'kh', 'ki', 'kim', 'kitchen', 'kiwi', 'km', 'kn', 'koeln', 'kp', 'kr', 'krd', 'kred', 'kw', 'ky', 'kyoto', 'kz', 'la', 'lacaixa', 'land', 'lat', 'latrobe', 'lawyer', 'lb', 'lc', 'lds', 'lease', 'legal', 'lgbt', 'li', 'lidl', 'life', 'lighting', 'limited', 'limo', 'link', 'lk', 'loans', 'london', 'lotte', 'lotto', 'lr', 'ls', 'lt', 'ltda', 'lu', 'luxe', 'luxury', 'lv', 'ly', 'ma', 'madrid', 'maison', 'management', 'mango', 'market', 'marketing', 'marriott', 'mc', 'md', 'me', 'media', 'meet', 'melbourne', 'meme', 'memorial', 'menu', 'mg', 'mh', 'miami', 'mil', 'mini', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'moda', 'moe', 'monash', 'money', 'mormon', 'mortgage', 'moscow', 'motorcycles', 'mov', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nagoya', 'name', 'navy', 'nc', 'ne', 'net', 'network', 'neustar', 'new', 'nexus', 'nf', 'ng', 'ngo', 'nhk', 'ni', 'nico', 'ninja', 'nl', 'no', 'np', 'nr', 'nra', 'nrw', 'ntt', 'nu', 'nyc', 'nz', 'okinawa', 'om', 'one', 'ong', 'onl', 'ooo', 'org', 'organic', 'osaka', 'otsuka', 'ovh', 'pa', 'paris', 'partners', 'parts', 'party', 'pe', 'pf', 'pg', 'ph', 'pharmacy', 'photo', 'photography', 'photos', 'physio', 'pics', 'pictures', 'pink', 'pizza', 'pk', 'pl', 'place', 'plumbing', 'pm', 'pn', 'pohl', 'poker', 'porn', 'post', 'pr', 'praxi', 'press', 'pro', 'prod', 'productions', 'prof', 'properties', 'property', 'ps', 'pt', 'pub', 'pw', 'py', 'qa', 'qpon', 'quebec', 're', 'realtor', 'recipes', 'red', 'rehab', 'reise', 'reisen', 'reit', 'ren', 'rentals', 'repair', 'report', 'republican', 'rest', 'restaurant', 'reviews', 'rich', 'rio', 'rip', 'ro', 'rocks', 'rodeo', 'rs', 'rsvp', 'ru', 'ruhr', 'rw', 'ryukyu', 'sa', 'saarland', 'sale', 'samsung', 'sarl', 'saxo', 'sb', 'sc', 'sca', 'scb', 'schmidt', 'schule', 'schwarz', 'science', 'scot', 'sd', 'se', 'services', 'sew', 'sexy', 'sg', 'sh', 'shiksha', 'shoes', 'shriram', 'si', 'singles', 'sj', 'sk', 'sky', 'sl', 'sm', 'sn', 'so', 'social', 'software', 'sohu', 'solar', 'solutions', 'soy', 'space', 'spiegel', 'sr', 'st', 'style', 'su', 'supplies', 'supply', 'support', 'surf', 'surgery', 'suzuki', 'sv', 'sx', 'sy', 'sydney', 'systems', 'sz', 'taipei', 'tatar', 'tattoo', 'tax', 'tc', 'td', 'technology', 'tel', 'temasek', 'tennis', 'tf', 'tg', 'th', 'tienda', 'tips', 'tires', 'tirol', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'today', 'tokyo', 'tools', 'top', 'toshiba', 'town', 'toys', 'tp', 'tr', 'trade', 'training', 'travel', 'trust', 'tt', 'tui', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'university', 'uno', 'uol', 'us', 'uy', 'uz', 'va', 'vacations', 'vc', 've', 'vegas', 'ventures', 'versicherung', 'vet', 'vg', 'vi', 'viajes', 'video', 'villas', 'vision', 'vlaanderen', 'vn', 'vodka', 'vote', 'voting', 'voto', 'voyage', 'vu', 'wales', 'wang', 'watch', 'webcam', 'website', 'wed', 'wedding', 'wf', 'whoswho', 'wien', 'wiki', 'williamhill', 'wme', 'work', 'works', 'world', 'ws', 'wtc', 'wtf', '佛山', '集团', '在线', '한국', 'ভারত', '八卦', 'موقع', '公益', '公司', '移动', '我爱你', 'москва', 'қаз', 'онлайн', 'сайт', 'срб', '淡马锡', 'орг', '삼성', 'சிங்கப்பூர்', '商标', '商店', '商城', 'дети', 'мкд', '中文网', '中信', '中国', '中國', '谷歌', 'భారత్', 'ලංකා', 'ભારત', 'भारत', '网店', 'संगठन', '网络', 'укр', '香港', '台湾', '台灣', '手机', 'мон', 'الجزائر', 'عمان', 'ایران', 'امارات', 'بازار', 'الاردن', 'بھارت', 'المغرب', 'السعودية', 'مليسيا', 'شبكة', 'გე', '机构', '组织机构', 'ไทย', 'سورية', 'рус', 'рф', 'تونس', 'みんな', 'グーグル', '世界', 'ਭਾਰਤ', '网址', '游戏', 'vermögensberater', 'vermögensberatung', '企业', 'مصر', 'قطر', '广东', 'இலங்கை', 'இந்தியா', '新加坡', 'فلسطين', '政务', 'xxx', 'xyz', 'yachts', 'yandex', 'ye', 'yoga', 'yokohama', 'youtube', 'yt', 'za', 'zip', 'zm', 'zone', 'zuerich', 'zw']
-Config.Schema.API = {"constructors":[{"id":"-1132882121","predicate":"boolFalse","params":[],"type":"Bool"},{"id":"-1720552011","predicate":"boolTrue","params":[],"type":"Bool"},{"id":"1072550713","predicate":"true","params":[],"type":"True"},{"id":"481674261","predicate":"vector","params":[],"type":"Vector t"},{"id":"-994444869","predicate":"error","params":[{"name":"code","type":"int"},{"name":"text","type":"string"}],"type":"Error"},{"id":"1450380236","predicate":"null","params":[],"type":"Null"},{"id":"2134579434","predicate":"inputPeerEmpty","params":[],"type":"InputPeer"},{"id":"2107670217","predicate":"inputPeerSelf","params":[],"type":"InputPeer"},{"id":"396093539","predicate":"inputPeerChat","params":[{"name":"chat_id","type":"int"}],"type":"InputPeer"},{"id":"-1182234929","predicate":"inputUserEmpty","params":[],"type":"InputUser"},{"id":"-138301121","predicate":"inputUserSelf","params":[],"type":"InputUser"},{"id":"-208488460","predicate":"inputPhoneContact","params":[{"name":"client_id","type":"long"},{"name":"phone","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"InputContact"},{"id":"-181407105","predicate":"inputFile","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"name","type":"string"},{"name":"md5_checksum","type":"string"}],"type":"InputFile"},{"id":"-1771768449","predicate":"inputMediaEmpty","params":[],"type":"InputMedia"},{"id":"1661770481","predicate":"inputMediaUploadedPhoto","params":[{"name":"flags","type":"#"},{"name":"file","type":"InputFile"},{"name":"caption","type":"string"},{"name":"stickers","type":"flags.0?Vector"}],"type":"InputMedia"},{"id":"-373312269","predicate":"inputMediaPhoto","params":[{"name":"id","type":"InputPhoto"},{"name":"caption","type":"string"}],"type":"InputMedia"},{"id":"-104578748","predicate":"inputMediaGeoPoint","params":[{"name":"geo_point","type":"InputGeoPoint"}],"type":"InputMedia"},{"id":"-1494984313","predicate":"inputMediaContact","params":[{"name":"phone_number","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"InputMedia"},{"id":"480546647","predicate":"inputChatPhotoEmpty","params":[],"type":"InputChatPhoto"},{"id":"-1837345356","predicate":"inputChatUploadedPhoto","params":[{"name":"file","type":"InputFile"}],"type":"InputChatPhoto"},{"id":"-1991004873","predicate":"inputChatPhoto","params":[{"name":"id","type":"InputPhoto"}],"type":"InputChatPhoto"},{"id":"-457104426","predicate":"inputGeoPointEmpty","params":[],"type":"InputGeoPoint"},{"id":"-206066487","predicate":"inputGeoPoint","params":[{"name":"lat","type":"double"},{"name":"long","type":"double"}],"type":"InputGeoPoint"},{"id":"483901197","predicate":"inputPhotoEmpty","params":[],"type":"InputPhoto"},{"id":"-74070332","predicate":"inputPhoto","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputPhoto"},{"id":"342061462","predicate":"inputFileLocation","params":[{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"InputFileLocation"},{"id":"1996904104","predicate":"inputAppEvent","params":[{"name":"time","type":"double"},{"name":"type","type":"string"},{"name":"peer","type":"long"},{"name":"data","type":"string"}],"type":"InputAppEvent"},{"id":"-1649296275","predicate":"peerUser","params":[{"name":"user_id","type":"int"}],"type":"Peer"},{"id":"-1160714821","predicate":"peerChat","params":[{"name":"chat_id","type":"int"}],"type":"Peer"},{"id":"-1432995067","predicate":"storage.fileUnknown","params":[],"type":"storage.FileType"},{"id":"8322574","predicate":"storage.fileJpeg","params":[],"type":"storage.FileType"},{"id":"-891180321","predicate":"storage.fileGif","params":[],"type":"storage.FileType"},{"id":"172975040","predicate":"storage.filePng","params":[],"type":"storage.FileType"},{"id":"-1373745011","predicate":"storage.filePdf","params":[],"type":"storage.FileType"},{"id":"1384777335","predicate":"storage.fileMp3","params":[],"type":"storage.FileType"},{"id":"1258941372","predicate":"storage.fileMov","params":[],"type":"storage.FileType"},{"id":"1086091090","predicate":"storage.filePartial","params":[],"type":"storage.FileType"},{"id":"-1278304028","predicate":"storage.fileMp4","params":[],"type":"storage.FileType"},{"id":"276907596","predicate":"storage.fileWebp","params":[],"type":"storage.FileType"},{"id":"2086234950","predicate":"fileLocationUnavailable","params":[{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"FileLocation"},{"id":"1406570614","predicate":"fileLocation","params":[{"name":"dc_id","type":"int"},{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"FileLocation"},{"id":"537022650","predicate":"userEmpty","params":[{"name":"id","type":"int"}],"type":"User"},{"id":"1326562017","predicate":"userProfilePhotoEmpty","params":[],"type":"UserProfilePhoto"},{"id":"-715532088","predicate":"userProfilePhoto","params":[{"name":"photo_id","type":"long"},{"name":"photo_small","type":"FileLocation"},{"name":"photo_big","type":"FileLocation"}],"type":"UserProfilePhoto"},{"id":"164646985","predicate":"userStatusEmpty","params":[],"type":"UserStatus"},{"id":"-306628279","predicate":"userStatusOnline","params":[{"name":"expires","type":"int"}],"type":"UserStatus"},{"id":"9203775","predicate":"userStatusOffline","params":[{"name":"was_online","type":"int"}],"type":"UserStatus"},{"id":"-1683826688","predicate":"chatEmpty","params":[{"name":"id","type":"int"}],"type":"Chat"},{"id":"-652419756","predicate":"chat","params":[{"name":"flags","type":"#"},{"name":"creator","type":"flags.0?true"},{"name":"kicked","type":"flags.1?true"},{"name":"left","type":"flags.2?true"},{"name":"admins_enabled","type":"flags.3?true"},{"name":"admin","type":"flags.4?true"},{"name":"deactivated","type":"flags.5?true"},{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"photo","type":"ChatPhoto"},{"name":"participants_count","type":"int"},{"name":"date","type":"int"},{"name":"version","type":"int"},{"name":"migrated_to","type":"flags.6?InputChannel"}],"type":"Chat"},{"id":"120753115","predicate":"chatForbidden","params":[{"name":"id","type":"int"},{"name":"title","type":"string"}],"type":"Chat"},{"id":"771925524","predicate":"chatFull","params":[{"name":"id","type":"int"},{"name":"participants","type":"ChatParticipants"},{"name":"chat_photo","type":"Photo"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"exported_invite","type":"ExportedChatInvite"},{"name":"bot_info","type":"Vector"}],"type":"ChatFull"},{"id":"-925415106","predicate":"chatParticipant","params":[{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"date","type":"int"}],"type":"ChatParticipant"},{"id":"-57668565","predicate":"chatParticipantsForbidden","params":[{"name":"flags","type":"#"},{"name":"chat_id","type":"int"},{"name":"self_participant","type":"flags.0?ChatParticipant"}],"type":"ChatParticipants"},{"id":"1061556205","predicate":"chatParticipants","params":[{"name":"chat_id","type":"int"},{"name":"participants","type":"Vector"},{"name":"version","type":"int"}],"type":"ChatParticipants"},{"id":"935395612","predicate":"chatPhotoEmpty","params":[],"type":"ChatPhoto"},{"id":"1632839530","predicate":"chatPhoto","params":[{"name":"photo_small","type":"FileLocation"},{"name":"photo_big","type":"FileLocation"}],"type":"ChatPhoto"},{"id":"-2082087340","predicate":"messageEmpty","params":[{"name":"id","type":"int"}],"type":"Message"},{"id":"-1063525281","predicate":"message","params":[{"name":"flags","type":"#"},{"name":"out","type":"flags.1?true"},{"name":"mentioned","type":"flags.4?true"},{"name":"media_unread","type":"flags.5?true"},{"name":"silent","type":"flags.13?true"},{"name":"post","type":"flags.14?true"},{"name":"id","type":"int"},{"name":"from_id","type":"flags.8?int"},{"name":"to_id","type":"Peer"},{"name":"fwd_from","type":"flags.2?MessageFwdHeader"},{"name":"via_bot_id","type":"flags.11?int"},{"name":"reply_to_msg_id","type":"flags.3?int"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"flags.9?MessageMedia"},{"name":"reply_markup","type":"flags.6?ReplyMarkup"},{"name":"entities","type":"flags.7?Vector"},{"name":"views","type":"flags.10?int"},{"name":"edit_date","type":"flags.15?int"}],"type":"Message"},{"id":"-1642487306","predicate":"messageService","params":[{"name":"flags","type":"#"},{"name":"out","type":"flags.1?true"},{"name":"mentioned","type":"flags.4?true"},{"name":"media_unread","type":"flags.5?true"},{"name":"silent","type":"flags.13?true"},{"name":"post","type":"flags.14?true"},{"name":"id","type":"int"},{"name":"from_id","type":"flags.8?int"},{"name":"to_id","type":"Peer"},{"name":"reply_to_msg_id","type":"flags.3?int"},{"name":"date","type":"int"},{"name":"action","type":"MessageAction"}],"type":"Message"},{"id":"1038967584","predicate":"messageMediaEmpty","params":[],"type":"MessageMedia"},{"id":"1032643901","predicate":"messageMediaPhoto","params":[{"name":"photo","type":"Photo"},{"name":"caption","type":"string"}],"type":"MessageMedia"},{"id":"1457575028","predicate":"messageMediaGeo","params":[{"name":"geo","type":"GeoPoint"}],"type":"MessageMedia"},{"id":"1585262393","predicate":"messageMediaContact","params":[{"name":"phone_number","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"user_id","type":"int"}],"type":"MessageMedia"},{"id":"-1618676578","predicate":"messageMediaUnsupported","params":[],"type":"MessageMedia"},{"id":"-1230047312","predicate":"messageActionEmpty","params":[],"type":"MessageAction"},{"id":"-1503425638","predicate":"messageActionChatCreate","params":[{"name":"title","type":"string"},{"name":"users","type":"Vector"}],"type":"MessageAction"},{"id":"-1247687078","predicate":"messageActionChatEditTitle","params":[{"name":"title","type":"string"}],"type":"MessageAction"},{"id":"2144015272","predicate":"messageActionChatEditPhoto","params":[{"name":"photo","type":"Photo"}],"type":"MessageAction"},{"id":"-1780220945","predicate":"messageActionChatDeletePhoto","params":[],"type":"MessageAction"},{"id":"1217033015","predicate":"messageActionChatAddUser","params":[{"name":"users","type":"Vector"}],"type":"MessageAction"},{"id":"-1297179892","predicate":"messageActionChatDeleteUser","params":[{"name":"user_id","type":"int"}],"type":"MessageAction"},{"id":"1728035348","predicate":"dialog","params":[{"name":"flags","type":"#"},{"name":"pinned","type":"flags.2?true"},{"name":"peer","type":"Peer"},{"name":"top_message","type":"int"},{"name":"read_inbox_max_id","type":"int"},{"name":"read_outbox_max_id","type":"int"},{"name":"unread_count","type":"int"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"pts","type":"flags.0?int"},{"name":"draft","type":"flags.1?DraftMessage"}],"type":"Dialog"},{"id":"590459437","predicate":"photoEmpty","params":[{"name":"id","type":"long"}],"type":"Photo"},{"id":"-1836524247","predicate":"photo","params":[{"name":"flags","type":"#"},{"name":"has_stickers","type":"flags.0?true"},{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"sizes","type":"Vector"}],"type":"Photo"},{"id":"236446268","predicate":"photoSizeEmpty","params":[{"name":"type","type":"string"}],"type":"PhotoSize"},{"id":"2009052699","predicate":"photoSize","params":[{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"size","type":"int"}],"type":"PhotoSize"},{"id":"-374917894","predicate":"photoCachedSize","params":[{"name":"type","type":"string"},{"name":"location","type":"FileLocation"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"bytes","type":"bytes"}],"type":"PhotoSize"},{"id":"286776671","predicate":"geoPointEmpty","params":[],"type":"GeoPoint"},{"id":"541710092","predicate":"geoPoint","params":[{"name":"long","type":"double"},{"name":"lat","type":"double"}],"type":"GeoPoint"},{"id":"-2128698738","predicate":"auth.checkedPhone","params":[{"name":"phone_registered","type":"Bool"}],"type":"auth.CheckedPhone"},{"id":"1577067778","predicate":"auth.sentCode","params":[{"name":"flags","type":"#"},{"name":"phone_registered","type":"flags.0?true"},{"name":"type","type":"auth.SentCodeType"},{"name":"phone_code_hash","type":"string"},{"name":"next_type","type":"flags.1?auth.CodeType"},{"name":"timeout","type":"flags.2?int"}],"type":"auth.SentCode"},{"id":"-855308010","predicate":"auth.authorization","params":[{"name":"flags","type":"#"},{"name":"tmp_sessions","type":"flags.0?int"},{"name":"user","type":"User"}],"type":"auth.Authorization"},{"id":"-543777747","predicate":"auth.exportedAuthorization","params":[{"name":"id","type":"int"},{"name":"bytes","type":"bytes"}],"type":"auth.ExportedAuthorization"},{"id":"-1195615476","predicate":"inputNotifyPeer","params":[{"name":"peer","type":"InputPeer"}],"type":"InputNotifyPeer"},{"id":"423314455","predicate":"inputNotifyUsers","params":[],"type":"InputNotifyPeer"},{"id":"1251338318","predicate":"inputNotifyChats","params":[],"type":"InputNotifyPeer"},{"id":"-1540769658","predicate":"inputNotifyAll","params":[],"type":"InputNotifyPeer"},{"id":"-265263912","predicate":"inputPeerNotifyEventsEmpty","params":[],"type":"InputPeerNotifyEvents"},{"id":"-395694988","predicate":"inputPeerNotifyEventsAll","params":[],"type":"InputPeerNotifyEvents"},{"id":"949182130","predicate":"inputPeerNotifySettings","params":[{"name":"flags","type":"#"},{"name":"show_previews","type":"flags.0?true"},{"name":"silent","type":"flags.1?true"},{"name":"mute_until","type":"int"},{"name":"sound","type":"string"}],"type":"InputPeerNotifySettings"},{"id":"-1378534221","predicate":"peerNotifyEventsEmpty","params":[],"type":"PeerNotifyEvents"},{"id":"1830677896","predicate":"peerNotifyEventsAll","params":[],"type":"PeerNotifyEvents"},{"id":"1889961234","predicate":"peerNotifySettingsEmpty","params":[],"type":"PeerNotifySettings"},{"id":"-1697798976","predicate":"peerNotifySettings","params":[{"name":"flags","type":"#"},{"name":"show_previews","type":"flags.0?true"},{"name":"silent","type":"flags.1?true"},{"name":"mute_until","type":"int"},{"name":"sound","type":"string"}],"type":"PeerNotifySettings"},{"id":"-2122045747","predicate":"peerSettings","params":[{"name":"flags","type":"#"},{"name":"report_spam","type":"flags.0?true"}],"type":"PeerSettings"},{"id":"-860866985","predicate":"wallPaper","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"sizes","type":"Vector"},{"name":"color","type":"int"}],"type":"WallPaper"},{"id":"1490799288","predicate":"inputReportReasonSpam","params":[],"type":"ReportReason"},{"id":"505595789","predicate":"inputReportReasonViolence","params":[],"type":"ReportReason"},{"id":"777640226","predicate":"inputReportReasonPornography","params":[],"type":"ReportReason"},{"id":"-512463606","predicate":"inputReportReasonOther","params":[{"name":"text","type":"string"}],"type":"ReportReason"},{"id":"253890367","predicate":"userFull","params":[{"name":"flags","type":"#"},{"name":"blocked","type":"flags.0?true"},{"name":"phone_calls_available","type":"flags.4?true"},{"name":"user","type":"User"},{"name":"about","type":"flags.1?string"},{"name":"link","type":"contacts.Link"},{"name":"profile_photo","type":"flags.2?Photo"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"bot_info","type":"flags.3?BotInfo"},{"name":"common_chats_count","type":"int"}],"type":"UserFull"},{"id":"-116274796","predicate":"contact","params":[{"name":"user_id","type":"int"},{"name":"mutual","type":"Bool"}],"type":"Contact"},{"id":"-805141448","predicate":"importedContact","params":[{"name":"user_id","type":"int"},{"name":"client_id","type":"long"}],"type":"ImportedContact"},{"id":"1444661369","predicate":"contactBlocked","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"}],"type":"ContactBlocked"},{"id":"-748155807","predicate":"contactStatus","params":[{"name":"user_id","type":"int"},{"name":"status","type":"UserStatus"}],"type":"ContactStatus"},{"id":"986597452","predicate":"contacts.link","params":[{"name":"my_link","type":"ContactLink"},{"name":"foreign_link","type":"ContactLink"},{"name":"user","type":"User"}],"type":"contacts.Link"},{"id":"-1219778094","predicate":"contacts.contactsNotModified","params":[],"type":"contacts.Contacts"},{"id":"1871416498","predicate":"contacts.contacts","params":[{"name":"contacts","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Contacts"},{"id":"-1387117803","predicate":"contacts.importedContacts","params":[{"name":"imported","type":"Vector"},{"name":"retry_contacts","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.ImportedContacts"},{"id":"471043349","predicate":"contacts.blocked","params":[{"name":"blocked","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Blocked"},{"id":"-1878523231","predicate":"contacts.blockedSlice","params":[{"name":"count","type":"int"},{"name":"blocked","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Blocked"},{"id":"364538944","predicate":"messages.dialogs","params":[{"name":"dialogs","type":"Vector