diff --git a/app/css/app.css b/app/css/app.css index f8bf0eb7..b8c8f2d0 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -771,7 +771,7 @@ a.tg_radio_on:hover i.icon-radio { display: inline-block; vertical-align: top; background: url(../img/icons/General.png) no-repeat -5px -10px; - background-size: 40px 678px; + background-size: 40px 778px; margin-right: 18px; } .icon-tg-title { @@ -809,7 +809,7 @@ a.tg_radio_on:hover i.icon-radio { display: inline-block; vertical-align: middle; background: url(../img/icons/General.png) no-repeat -18px -50px; - background-size: 40px 678px; + background-size: 40px 778px; margin-left: 12px; margin-top: -1px; } @@ -1453,7 +1453,7 @@ div.im_message_video_thumb { display: inline-block; line-height: 0; background: url(../img/icons/General.png) no-repeat -14px -509px; - background-size: 40px 678px; + background-size: 40px 778px; width: 12px; height: 18px; margin: 12px 15px; @@ -1476,7 +1476,7 @@ div.im_message_video_thumb { width: 14px; height: 16px; background: url(../img/icons/General.png) no-repeat -13px -611px; - background-size: 40px 678px;; + background-size: 40px 778px;; margin: 13px 16px; } .is_1x .im_message_file_button_dl_audio .im_message_file_button_icon { @@ -1775,42 +1775,6 @@ a.im_message_fwd_photo { line-height: 150%; } -span.emoji { - display: -moz-inline-box; - -moz-box-orient: vertical; - display: inline-block; - vertical-align: baseline; - *vertical-align: auto; - *zoom: 1; - *display: inline; - height: 18px; - width: 18px; - background-repeat: no-repeat; - text-indent: -9999px; -} - -/* widths and heights calculated according to spritesheet dimensions and icon size */ -.emoji-spritesheet-0 { - background-size: 486px 126px; - background-image: url('../img/emojisprite_0.png'); -} -.emoji-spritesheet-1 { - background-size: 522px 72px; - background-image: url('../img/emojisprite_1.png'); -} -.emoji-spritesheet-2 { - background-size: 594px 126px; - background-image: url('../img/emojisprite_2.png'); -} -.emoji-spritesheet-3 { - background-size: 612px 54px; - background-image: url('../img/emojisprite_3.png'); -} -.emoji-spritesheet-4 { - background-size: 612px 126px; - background-image: url('../img/emojisprite_4.png'); -} - .im_history_not_selected, .im_history_empty { visibility: hidden; @@ -1951,159 +1915,306 @@ img.img_fullsize { -/* Emoji area */ -.emoji-wysiwyg-editor:empty:before { - content: attr(placeholder); - color: #9aa2ab; -} -.emoji-wysiwyg-editor:active:before, -.emoji-wysiwyg-editor:focus:before { - content: none; -} - -.emoji-wysiwyg-editor { - box-sizing: content-box; - -moz-box-sizing: content-box; - font-size: 12px; - margin-bottom: 10px; - padding: 6px; - min-height: 38px; - height: auto; - width: auto; - max-height: 284px; - overflow: auto; - line-height: 17px; - - border: 1px solid #d2dbe3; - border-radius: 2px; - -webkit-box-shadow: none; - box-shadow: none; - -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; - transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; - - -webkit-user-select: text; - word-wrap: break-word; +/* Message composer */ +.composer_emoji_insert_btn { + display: block; + position: absolute; + right: 3px; + top: 2px; + cursor: pointer; + padding: 0; - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; + width: 22px; + height: 22px; + margin-top: 1px; } -.emoji-wysiwyg-editor img { - width: 20px; - height: 20px; - vertical-align: middle; - margin: -3px 0 0 0; +.icon-emoji { + display: inline-block; + width: 22px; + height: 22px; + vertical-align: top; + background: url(../img/icons/General.png) no-repeat -9px -335px; + background-size: 40px 778px; + opacity: 0.8; } -.emoji-menu { +.composer_emoji_tooltip { + display: none; position: absolute; z-index: 999; width: 220px; - margin-left: -107px; - margin-top: -252px; - overflow: hidden; + margin-left: -100px; + margin-top: -248px; border: 1px #dfdfdf solid; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; - overflow: hidden; -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1); -} -.emoji-items-wrap1 { background: #FFF; padding: 5px 2px 5px 5px; } -.emoji-items-wrap1 .emoji-menu-tabs { +.composer_emoji_tooltip_shown { + display: block; +} +.composer_emoji_tooltip_tail { + position: absolute; + bottom: -14px; + left: 50%; + margin-left: -13px; + overflow: hidden; + width: 26px; + height: 14px; +} +.icon-tooltip-tail { + background: #FFF; + width: 18px; + height: 18px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + display: inline-block; + -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); + border: 1px #dfdfdf solid; + border-width: 0 1px 1px 0; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + position: relative; + top: -8px; + left: 4px; + +} + +.composer_emoji_tooltip_tabs { width: 100%; margin-bottom: 8px; margin-top: 3px; } -.emoji-items-wrap1 .emoji-menu-tabs td { - text-align: center; - color: white; +.composer_emoji_tooltip_tab { line-height: 0; -} -.emoji-menu-tabs .emoji-menu-tab { + color: white; display: inline-block; width: 24px; height: 29px; background: url(../img/icons/IconsetSmiles.png) no-repeat; - background-size: 42px 350px; + background-size: 42px 470px; + cursor: pointer; + opacity: 0.7; + margin: 0 3px; } -.is_1x .emoji-menu-tabs .emoji-menu-tab { +.is_1x .composer_emoji_tooltip_tab { background-image: url(../img/icons/IconsetSmiles_1x.png); } +.composer_emoji_tooltip_tab.active { + opacity: 1; +} -.emoji-menu-tabs .icon-recent {background-position: -9px -306px; } -.emoji-menu-tabs .icon-recent-selected {background-position: -9px -277px; } +.composer_emoji_tooltip_tab_recent {background-position: -9px -306px; } +.composer_emoji_tooltip_tab_recent.active {background-position: -9px -277px; } -.emoji-menu-tabs .icon-smile {background-position: -9px -34px; } -.emoji-menu-tabs .icon-smile-selected {background-position: -9px -5px; } +.composer_emoji_tooltip_tab_smile {background-position: -9px -34px; } +.composer_emoji_tooltip_tab_smile.active {background-position: -9px -5px; } -.emoji-menu-tabs .icon-flower {background-position: -9px -145px; } -.emoji-menu-tabs .icon-flower-selected {background-position: -9px -118px; } +.composer_emoji_tooltip_tab_flower {background-position: -9px -145px; } +.composer_emoji_tooltip_tab_flower.active {background-position: -9px -118px; } -.emoji-menu-tabs .icon-bell {background-position: -9px -89px; } -.emoji-menu-tabs .icon-bell-selected {background-position: -9px -61px; } +.composer_emoji_tooltip_tab_bell {background-position: -9px -89px; } +.composer_emoji_tooltip_tab_bell.active {background-position: -9px -61px; } -.emoji-menu-tabs .icon-car {background-position: -9px -196px; } -.emoji-menu-tabs .icon-car-selected {background-position: -9px -170px; } +.composer_emoji_tooltip_tab_car {background-position: -9px -196px; } +.composer_emoji_tooltip_tab_car.active {background-position: -9px -170px; } -.emoji-menu-tabs .icon-grid {background-position: -9px -248px; } -.emoji-menu-tabs .icon-grid-selected {background-position: -9px -222px; } +.composer_emoji_tooltip_tab_grid {background-position: -9px -248px; } +.composer_emoji_tooltip_tab_grid.active {background-position: -9px -222px; } -.emoji-menu-tabs .icon-recent, -.emoji-menu-tabs .icon-smile, -.emoji-menu-tabs .icon-flower, -.emoji-menu-tabs .icon-bell, -.emoji-menu-tabs .icon-car, -.emoji-menu-tabs .icon-grid { - opacity: 0.7; -} -.emoji-menu-tabs .icon-recent:hover, -.emoji-menu-tabs .icon-smile:hover, -.emoji-menu-tabs .icon-flower:hover, -.emoji-menu-tabs .icon-bell:hover, -.emoji-menu-tabs .icon-car:hover, -.emoji-menu-tabs .icon-grid:hover { - opacity: 1; -} +.composer_emoji_tooltip_tab_stickers {background-position: -9px -361px; } +.composer_emoji_tooltip_tab_stickers.active {background-position: -9px -333px; } -.emoji-menu .emoji-items-wrap { - position: relative; +.nano.composer_emoji_tooltip_content_wrap { height: 174px; + position: relative; } -.emoji-menu .emoji-items { +.composer_emoji_tooltip_content { + /*position: relative;*/ + /*overflow: hidden; + overflow-y: auto;*/ padding-right: 8px; - outline: 0 !important; -} -.emoji-menu img { - width: 20px; - height: 20px; - vertical-align: middle; - border: 0 none; + outline: 0!important; } -.emoji-menu .emoji-items a { + + +a.composer_emoji_btn { margin: -1px 0 0 -1px; padding: 5px; display: block; float: left; border-radius: 2px; } -.emoji-menu .emoji-items a:hover { +a.composer_emoji_btn:hover { background-color: #edf2f5; } -.emoji-menu:after { - content: ' '; - display: block; - clear: left; + +.emoji { + display: -moz-inline-box; + -moz-box-orient: vertical; + display: inline-block; + vertical-align: baseline; + *vertical-align: auto; + *zoom: 1; + *display: inline; + height: 18px; + width: 18px; + background-repeat: no-repeat; + text-indent: -9999px; + border: 0 none; +} + +/* widths and heights calculated according to spritesheet dimensions and icon size */ +.emoji-spritesheet-0 { + background-size: 486px 126px; + background-image: url('../img/emojisprite_0.png'); +} +.emoji-spritesheet-1 { + background-size: 522px 72px; + background-image: url('../img/emojisprite_1.png'); +} +.emoji-spritesheet-2 { + background-size: 594px 126px; + background-image: url('../img/emojisprite_2.png'); +} +.emoji-spritesheet-3 { + background-size: 612px 54px; + background-image: url('../img/emojisprite_3.png'); +} +.emoji-spritesheet-4 { + background-size: 612px 126px; + background-image: url('../img/emojisprite_4.png'); +} + +.emoji-w20 { + width: 20px; + height: 20px; + vertical-align: middle; + display: inline-block; +} +.emoji-w20.emoji-spritesheet-0 {background-size: 540px 140px;} +.emoji-w20.emoji-spritesheet-1 {background-size: 580px 80px;} +.emoji-w20.emoji-spritesheet-2 {background-size: 660px 140px;} +.emoji-w20.emoji-spritesheet-3 {background-size: 680px 60px;} +.emoji-w20.emoji-spritesheet-4 {background-size: 680px 140px;} + +.emoji-w26 { + width: 26px; + height: 26px; + vertical-align: middle; + display: inline-block; } -.emoji-menu a .label { +.emoji-w26.emoji-spritesheet-0 {background-size: 702px 182px;} +.emoji-w26.emoji-spritesheet-1 {background-size: 754px 104px;} +.emoji-w26.emoji-spritesheet-2 {background-size: 858px 182px;} +.emoji-w26.emoji-spritesheet-3 {background-size: 884px 78px;} +.emoji-w26.emoji-spritesheet-4 {background-size: 884px 182px;} + +.composer_dropdown { display: none; + /*max-width: 100%;*/ + border-radius: 2px; + padding: 6px 0; + border: 1px solid rgba(15, 60, 96, 0.2); + -webkit-box-shadow: 0px 1px 3px 0px rgba(60,75,87,0.27); + -moz-box-shadow: 0px 1px 3px 0px rgba(60,75,87,0.27); + box-shadow: 0px 1px 3px 0px rgba(60,75,87,0.27); +} + +.composer_dropdown > li > a { + display: block; + font-size: 13px; + line-height: 15px; + padding: 4px 10px; + color: #52719a; +} +.composer_dropdown li a:hover, +.composer_dropdown li a.composer_emoji_option_active { + color: #52719a; + background: #f2f6fa; +} +.composer_emoji_shortcut { + display: inline-block; + vertical-align: top; + margin-left: 15px; + line-height: 20px; +} +.composer_sticker_btn { + width: 67px; + height: 67px; + display: block; + display: inline-block; + text-align: center; + padding: 3px; +} +.composer_sticker_btn:hover { + background: #f2f6fa; +} +.composer_sticker_image { + max-width: 64px; + max-height: 64px; +} + +.composer_rich_textarea { + box-sizing: content-box; + -moz-box-sizing: content-box; + font-size: 12px; + margin-bottom: 10px; + padding: 6px; + min-height: 38px; + height: auto; + width: auto; + max-height: 284px; + overflow: auto; + line-height: 17px; + + border: 1px solid #d2dbe3; + border-radius: 2px; + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + + -webkit-user-select: text; + word-wrap: break-word; + + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.composer_rich_textarea:empty:before { + content: attr(placeholder); + color: #9aa2ab; +} +.composer_rich_textarea:active:before, +.composer_rich_textarea:focus:before { + content: none; +} +.composer_rich_textarea:empty:active:before, +.composer_rich_textarea:empty:focus:before { + content: attr(placeholder); + color: #9aa2ab; +} + +.composer_rich_textarea img { + width: 20px; + height: 20px; + vertical-align: middle; + margin: -3px 0 0 0; } diff --git a/app/css/desktop.css b/app/css/desktop.css index b2cc8bd9..ac190f4d 100644 --- a/app/css/desktop.css +++ b/app/css/desktop.css @@ -171,7 +171,7 @@ margin-right: 38px; display: inline-block; background: url(../img/icons/General.png) no-repeat -10px -111px; - background-size: 40px 678px; + background-size: 40px 778px; vertical-align: top; margin-top: 3px; } @@ -183,7 +183,7 @@ display: inline-block; vertical-align: top; background: url(../img/icons/General.png) no-repeat -11px -135px; - background-size: 40px 678px; + background-size: 40px 778px; } .icon-settings { width: 20px; @@ -193,7 +193,7 @@ display: inline-block; vertical-align: top; background: url(../img/icons/General.png) no-repeat -10px -163px; - background-size: 40px 678px; + background-size: 40px 778px; } .icon-faq { width: 20px; @@ -203,7 +203,7 @@ display: inline-block; vertical-align: top; background: url(../img/icons/General.png) no-repeat -10px -637px; - background-size: 40px 678px; + background-size: 40px 778px; } .icon-about { width: 21px; @@ -212,7 +212,7 @@ display: inline-block; vertical-align: top; background: url(../img/icons/General.png) no-repeat -10px -193px; - background-size: 40px 678px; + background-size: 40px 778px; } .is_1x .icon-new-group, .is_1x .icon-contacts, @@ -315,7 +315,7 @@ .icon-filter-audio { display: inline-block; background: url(../img/icons/General.png) no-repeat 0 0; - background-size: 40px 678px; + background-size: 40px 778px; margin-right: 12px; vertical-align: top; } @@ -408,11 +408,11 @@ opacity : 0.99; } -.emoji-menu .nano > .nano-pane { +.composer_emoji_tooltip .nano > .nano-pane { background : rgba(255,255,255,0.0); right: -2px; } -.emoji-menu .nano > .nano-pane > .nano-slider { +.composer_emoji_tooltip .nano > .nano-pane > .nano-slider { background: #d1d1d1; margin: 0 3px 0 4px; } @@ -722,26 +722,21 @@ a.footer_link.active:active { background: inherit; } -.im_emoji_quick_select_area { +.composer_emoji_panel { display: block; height: 30px; overflow: hidden; max-width: 210px; } - -.im_emoji_quick_select_area a { +.composer_emoji_panel a { display: inline-block; padding: 5px; outline: 0; border-radius: 2px; } - -.im_emoji_quick_select_area a:hover { +/*.composer_emoji_panel a:hover { background-color: #edf2f5; -} -.im_emoji_quick_select_area a .label { - display: none; -} +}*/ .im_message_selected .im_message_date, .im_message_selected .im_message_document_size, @@ -940,7 +935,8 @@ a.im_panel_peer_photo .peer_initials { margin-left: 36px; } -.im_emoji_btn { +/*.composer_emoji_insert_btn { + display: block; position: absolute; right: 3px; top: 2px; @@ -950,33 +946,48 @@ a.im_panel_peer_photo .peer_initials { width: 22px; height: 22px; margin-top: 1px; -} -.icon-emoji { +}*/ +/*.icon-emoji { display: inline-block; width: 22px; height: 22px; vertical-align: top; background: url(../img/icons/General.png) no-repeat -9px -335px; - background-size: 40px 678px; + background-size: 40px 778px; opacity: 0.8; -} +}*/ .is_1x .icon-emoji { background-image: url(../img/icons/General_1x.png); } -.im_emoji_btn:hover .icon-emoji { +.composer_emoji_insert_btn:hover .icon-emoji { opacity: 1; } -.im_emoji_btn:active .icon-emoji, -.im_emoji_btn.on .icon-emoji { +.composer_emoji_insert_btn:active .icon-emoji, +.composer_emoji_insert_btn.composer_emoji_insert_btn_on .icon-emoji { background-position: -9px -367px; opacity: 1; } + + + + + + + + + + + + + + + .im_send_field_wrap { margin-bottom: 15px; } -.emoji-wysiwyg-editor, -.form-control.im_message_field { +.composer_rich_textarea, +.composer_textarea { border-radius: 0; border: 0; box-shadow: none; @@ -988,8 +999,8 @@ a.im_panel_peer_photo .peer_initials { line-height: 20px; height: auto; } -.emoji-wysiwyg-editor:focus, -.form-control.im_message_field:focus { +.composer_rich_textarea:focus, +.composer_textarea:focus { border: 0; box-shadow: none; outline: none; @@ -1014,7 +1025,7 @@ a.im_panel_peer_photo .peer_initials { height: 17px; vertical-align: top; background: url(../img/icons/General.png) no-repeat -11px -455px; - background-size: 40px 678px; + background-size: 40px 778px; opacity: 0.8; margin: 0; } @@ -1050,7 +1061,7 @@ a.im_panel_peer_photo .peer_initials { height: 18px; vertical-align: top; background: url(../img/icons/General.png) no-repeat -10px -399px; - background-size: 40px 678px; + background-size: 40px 778px; opacity: 0.8; } .is_1x .icon-camera { diff --git a/app/css/mobile.css b/app/css/mobile.css index e02939ec..1e84e566 100644 --- a/app/css/mobile.css +++ b/app/css/mobile.css @@ -1105,7 +1105,7 @@ a.mobile_modal_action .tg_checkbox_label { display: block; } -.im_emoji_btn { +.composer_emoji_insert_btn { position: absolute; left: 0; top: 0; @@ -1127,10 +1127,10 @@ a.mobile_modal_action .tg_checkbox_label { .is_1x .icon-emoji { background-image: url(../img/icons/IconsetW_1x.png); } -.im_emoji_btn:active .icon-emoji, -.is_1x .im_emoji_btn:active .icon-emoji, -.im_emoji_btn.on .icon-emoji, -.is_1x .im_emoji_btn.on .icon-emoji { +.composer_emoji_insert_btn:active .icon-emoji, +.is_1x .composer_emoji_insert_btn:active .icon-emoji, +.composer_emoji_insert_btn.on .icon-emoji, +.is_1x .composer_emoji_insert_btn.on .icon-emoji { background-position: -10px -803px; } @@ -1141,21 +1141,21 @@ a.mobile_modal_action .tg_checkbox_label { .im_send_field_wrap .form-control { border-radius: 4px; } -.emoji-wysiwyg-editor { +.composer_rich_textarea { min-height: 18px; max-height: 136px; margin-bottom: 0; font-size: 15px; } -.emoji-wysiwyg-editor:empty { +.composer_rich_textarea:empty { background: #f1f1f1; border-color: #f1f1f1; } -.emoji-wysiwyg-editor:empty:before { +.composer_rich_textarea:empty:before { color: #999; } -.emoji-wysiwyg-editor:active, -.emoji-wysiwyg-editor:focus { +.composer_rich_textarea:active, +.composer_rich_textarea:focus { box-shadow: none; outline: 0; background: #FFF; @@ -1164,17 +1164,33 @@ a.mobile_modal_action .tg_checkbox_label { } -.emoji-menu { - margin-left: -20px; - margin-top: -202px; +.composer_emoji_tooltip { + margin-left: 10px; + margin-top: -175px; width: 262px; } -.emoji-menu .emoji-items-wrap { +.composer_emoji_tooltip .composer_emoji_tooltip_content { height: 106px; } -.emoji-menu .emoji-items a { +.composer_emoji_tooltip .composer_emoji_tooltip_content .composer_emoji_btn { padding: 5px; } +.icon-tooltip-tail { + display: none; +} +.composer_emoji_tooltip_tab { + margin: 0 5px; +} + +.composer_sticker_btn { + width: 80px; + height: 80px; + padding: 3px; +} +.composer_sticker_image { + max-width: 64px; + max-height: 64px; +} .contacts_modal_search { diff --git a/app/img/icons/General.png b/app/img/icons/General.png index b6f3fdf6..aa2e7ec8 100644 Binary files a/app/img/icons/General.png and b/app/img/icons/General.png differ diff --git a/app/img/icons/General_1x.png b/app/img/icons/General_1x.png index 271503ca..045dccad 100644 Binary files a/app/img/icons/General_1x.png and b/app/img/icons/General_1x.png differ diff --git a/app/img/icons/IconsetSmiles.png b/app/img/icons/IconsetSmiles.png index 4fb10645..6618c24b 100644 Binary files a/app/img/icons/IconsetSmiles.png and b/app/img/icons/IconsetSmiles.png differ diff --git a/app/img/icons/IconsetSmiles_1x.png b/app/img/icons/IconsetSmiles_1x.png index 9679265d..b244cb76 100644 Binary files a/app/img/icons/IconsetSmiles_1x.png and b/app/img/icons/IconsetSmiles_1x.png differ diff --git a/app/index.html b/app/index.html index 78eb06a2..1164326e 100644 --- a/app/index.html +++ b/app/index.html @@ -48,7 +48,6 @@ - @@ -83,6 +82,7 @@ PRODUCTION_ONLY_END--> + diff --git a/app/js/app.js b/app/js/app.js index e8ec4a78..a80ee454 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -27,25 +27,25 @@ angular.module('myApp', [ ]). config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvider', function($locationProvider, $routeProvider, $compileProvider, StorageProvider) { - var icons = {}, reverseIcons = {}, i, j, hex, name, dataItem, row, column, totalColumns; - - for (j = 0; j < Config.EmojiCategories.length; j++) { - totalColumns = Config.EmojiCategorySpritesheetDimens[j][1]; - for (i = 0; i < Config.EmojiCategories[j].length; i++) { - dataItem = Config.Emoji[Config.EmojiCategories[j][i]]; - name = dataItem[1][0]; - row = Math.floor(i / totalColumns); - column = (i % totalColumns); - icons[':' + name + ':'] = [j, row, column, ':'+name+':']; - reverseIcons[name] = dataItem[0]; - } - } - - $.emojiarea.spritesheetPath = 'img/emojisprite_!.png'; - $.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens; - $.emojiarea.iconSize = 20; - $.emojiarea.icons = icons; - $.emojiarea.reverseIcons = reverseIcons; + // var icons = {}, reverseIcons = {}, i, j, hex, name, dataItem, row, column, totalColumns; + + // for (j = 0; j < Config.EmojiCategories.length; j++) { + // totalColumns = Config.EmojiCategorySpritesheetDimens[j][1]; + // for (i = 0; i < Config.EmojiCategories[j].length; i++) { + // dataItem = Config.Emoji[Config.EmojiCategories[j][i]]; + // name = dataItem[1][0]; + // row = Math.floor(i / totalColumns); + // column = (i % totalColumns); + // icons[':' + name + ':'] = [j, row, column, ':'+name+':']; + // reverseIcons[name] = dataItem[0]; + // } + // } + + // $.emojiarea.spritesheetPath = 'img/emojisprite_!.png'; + // $.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens; + // $.emojiarea.iconSize = 20; + // $.emojiarea.icons = icons; + // $.emojiarea.reverseIcons = reverseIcons; $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|filesystem|chrome-extension|app):|data:image\//); $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|mailto|blob|filesystem|chrome-extension|app):|data:image\//); diff --git a/app/js/controllers.js b/app/js/controllers.js index b0ece371..890119b0 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -316,7 +316,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) LayoutSwitchService.start(); }) - .controller('AppIMController', function ($scope, $location, $routeParams, $modal, $rootScope, $modalStack, MtpApiManager, AppUsersManager, AppChatsManager, AppPeersManager, ContactsSelectService, ChangelogNotifyService, ErrorService, AppRuntimeManager, HttpsMigrateService, LayoutSwitchService, LocationParamsService) { + .controller('AppIMController', function ($scope, $location, $routeParams, $modal, $rootScope, $modalStack, MtpApiManager, AppUsersManager, AppChatsManager, AppPeersManager, ContactsSelectService, ChangelogNotifyService, ErrorService, AppRuntimeManager, HttpsMigrateService, LayoutSwitchService, LocationParamsService, AppStickersManager) { $scope.$on('$routeUpdate', updateCurDialog); @@ -496,6 +496,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) HttpsMigrateService.start(); LayoutSwitchService.start(); LocationParamsService.start(); + AppStickersManager.start(); }) .controller('AppImDialogsController', function ($scope, $location, $q, $timeout, $routeParams, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, PhonebookContactsService, ErrorService, AppRuntimeManager) { @@ -1454,7 +1455,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.$on('user_update', angular.noop); }) - .controller('AppImSendController', function ($scope, $timeout, MtpApiManager, Storage, AppPeersManager, AppMessagesManager, ApiUpdatesManager, MtpApiFileManager) { + .controller('AppImSendController', function ($scope, $timeout, MtpApiManager, Storage, AppPeersManager, AppDocsManager, AppMessagesManager, ApiUpdatesManager, MtpApiFileManager) { $scope.$watch('curDialog.peer', resetDraft); $scope.$on('user_update', angular.noop); @@ -1463,6 +1464,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.draftMessage = {text: '', send: sendMessage}; $scope.$watch('draftMessage.text', onMessageChange); $scope.$watch('draftMessage.files', onFilesSelected); + $scope.$watch('draftMessage.sticker', onStickerSelected); function sendMessage (e) { $scope.$broadcast('ui_message_before_send'); @@ -1471,10 +1473,10 @@ angular.module('myApp.controllers', ['myApp.i18n']) var text = $scope.draftMessage.text; if (angular.isString(text) && text.length > 0) { - text = text.replace(/:([a-z0-9\-\+\*_]+?):/gi, function (all, name) { - var utfChar = $.emojiarea.reverseIcons[name]; - if (utfChar !== undefined) { - return utfChar; + text = text.replace(/:([a-z0-9\-\+\*_]+?):/gi, function (all, shortcut) { + var emojiCode = EmojiHelper.shortcuts[shortcut]; + if (emojiCode !== undefined) { + return EmojiHelper.emojis[emojiCode][0]; } return all; }); @@ -1529,10 +1531,10 @@ angular.module('myApp.controllers', ['myApp.i18n']) var backupDraftObj = {}; backupDraftObj['draft' + $scope.curDialog.peerID] = newVal; Storage.set(backupDraftObj); - // console.log('draft save', backupDraftObj); + // console.log(dT(), 'draft save', backupDraftObj); } else { Storage.remove('draft' + $scope.curDialog.peerID); - // console.log('draft delete', 'draft' + $scope.curDialog.peerID); + // console.log(dT(), 'draft delete', 'draft' + $scope.curDialog.peerID); } } @@ -1555,6 +1557,28 @@ angular.module('myApp.controllers', ['myApp.i18n']) $scope.$broadcast('ui_message_send'); } } + + function onStickerSelected (newVal) { + if (!newVal) { + return; + } + + var doc = AppDocsManager.getDoc(newVal); + if (doc.id && doc.access_hash) { + console.log('sticker', doc); + var inputMedia = { + _: 'inputMediaDocument', + id: { + _: 'inputDocument', + id: doc.id, + access_hash: doc.access_hash + } + } + AppMessagesManager.sendOther($scope.curDialog.peerID, inputMedia); + $scope.$broadcast('ui_message_send'); + } + delete $scope.draftMessage.sticker; + } }) .controller('AppLangSelectController', function ($scope, _, Storage, ErrorService, AppRuntimeManager) { @@ -3017,7 +3041,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) }) - .controller('CountrySelectModalController', function ($scope, $modalInstance, $rootScope, SearchIndexManager, _) { + .controller('CountrySelectModalController', function ($scope, $modalInstance, $rootScope, _) { $scope.search = {}; $scope.slice = {limit: 20, limitDelta: 20} @@ -3060,7 +3084,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) }) - .controller('PhonebookModalController', function ($scope, $modalInstance, $rootScope, AppUsersManager, PhonebookContactsService, SearchIndexManager, ErrorService) { + .controller('PhonebookModalController', function ($scope, $modalInstance, $rootScope, AppUsersManager, PhonebookContactsService, ErrorService) { $scope.search = {}; $scope.phonebook = []; diff --git a/app/js/directives.js b/app/js/directives.js index 6d919047..6899fc1d 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -1061,7 +1061,7 @@ angular.module('myApp.directives', ['myApp.filters']) }) - .directive('mySendForm', function ($timeout, $modalStack, $http, $interpolate, Storage, ErrorService) { + .directive('mySendForm', function ($timeout, $modalStack, $http, $interpolate, Storage, AppStickersManager, ErrorService) { return { link: link, @@ -1071,139 +1071,107 @@ angular.module('myApp.directives', ['myApp.filters']) }; function link ($scope, element, attrs) { - var messageField = $('textarea', element)[0], - fileSelects = $('input', element), - dropbox = $('.im_send_dropbox_wrap', element)[0], - emojiButton = $('.im_emoji_btn', element)[0], - emojiQuickSelect = !Config.Mobile ? $('.im_emoji_quick_select_area', element)[0] : false, - editorElement = messageField, - dragStarted, dragTimeout, - emojiArea = $(messageField).emojiarea({button: emojiButton, norealTime: true, quickSelect: emojiQuickSelect}), - emojiMenu = $('.emoji-menu', element)[0], - submitBtn = $('.im_submit', element)[0], - richTextarea = $('.emoji-wysiwyg-editor', element)[0]; - if (richTextarea) { - editorElement = richTextarea; - $(richTextarea).addClass('form-control'); - $(richTextarea).attr('placeholder', $interpolate($(messageField).attr('placeholder'))($scope)); - - var updatePromise; - $(richTextarea) - .on('DOMNodeInserted', onPastedImageEvent) - .on('keyup', function (e) { - updateHeight(); - - if (!sendAwaiting) { - $scope.$apply(function () { - $scope.draftMessage.text = richTextarea.textContent; - }); - } - - $timeout.cancel(updatePromise); - updatePromise = $timeout(updateValue, 1000); - }); - } - - // Head is sometimes slower - $timeout(function () { - fileSelects - .on('change', function () { - var self = this; - $scope.$apply(function () { - $scope.draftMessage.files = Array.prototype.slice.call(self.files); - $scope.draftMessage.isMedia = $(self).hasClass('im_media_attach_input') || Config.Mobile; - setTimeout(function () { - try { - self.value = ''; - } catch (e) {}; - }, 1000); + 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, dragTimeout; + var submitBtn = $('.im_submit', element)[0]; + + new EmojiTooltip(emojiButton, { + getStickers: function (callback) { + AppStickersManager.getStickers().then(function () { + AppStickersManager.getStickersImages().then(function (stickersData) { + callback(stickersData); }); }); - }, 1000); - - var sendOnEnter = true, - updateSendSettings = function () { - Storage.get('send_ctrlenter').then(function (sendOnCtrl) { - sendOnEnter = !sendOnCtrl; - }); - }; - - $scope.$on('settings_changed', updateSendSettings); - updateSendSettings(); - - $(editorElement).on('keydown', function (e) { - if (richTextarea) { - updateHeight(); + }, + onEmojiSelected: function (code) { + $scope.$apply(function () { + composer.onEmojiSelected(code); + }) + }, + onStickerSelected: function (docID) { + $scope.$apply(function () { + $scope.draftMessage.sticker = docID; + }); } + }); - if (e.keyCode == 13) { - var submit = false; - if (sendOnEnter && !e.shiftKey) { - submit = true; - } else if (!sendOnEnter && (e.ctrlKey || e.metaKey)) { - submit = true; - } - - if (submit) { - $timeout.cancel(updatePromise); - updateValue(); - $scope.draftMessage.send(); - $(element).trigger('message_send'); - resetTyping(); - return cancelEvent(e); + var composerEmojiPanel; + if (emojiPanel) { + composerEmojiPanel = new EmojiPanel(emojiPanel, { + onEmojiSelected: function (code) { + composer.onEmojiSelected(code); } - } - - }); + }); + } - $(submitBtn).on('mousedown touchstart', function (e) { - $timeout.cancel(updatePromise); - updateValue(); - $scope.draftMessage.send(); - $(element).trigger('message_send'); - resetTyping(); - return cancelEvent(e); + var composer = new MessageComposer(messageField, { + onTyping: function () { + $scope.$emit('ui_typing'); + }, + getSendOnEnter: function () { + return sendOnEnter; + }, + onMessageSubmit: onMessageSubmit, + onFilesPaste: onFilesPaste }); - var lastTyping = 0, - lastLength; - $(editorElement).on('keyup', function (e) { - var now = tsNow(), - length = (editorElement[richTextarea ? 'textContent' : 'value']).length; - + var richTextarea = composer.richTextareaEl[0]; + if (richTextarea) { + $(richTextarea) + .attr('placeholder', $interpolate($(messageField).attr('placeholder'))($scope)) + .on('keydown keyup', updateHeight); + } - if (now - lastTyping > 5000 && length != lastLength) { - lastTyping = now; - lastLength = length; - $scope.$emit('ui_typing'); - } + fileSelects.on('change', function () { + var self = this; + $scope.$apply(function () { + $scope.draftMessage.files = Array.prototype.slice.call(self.files); + $scope.draftMessage.isMedia = $(self).hasClass('im_media_attach_input') || Config.Mobile; + setTimeout(function () { + try { + self.value = ''; + } catch (e) {}; + }, 1000); + }); }); - function resetTyping () { - lastTyping = 0; - lastLength = 0; + var sendOnEnter = true; + function updateSendSettings () { + Storage.get('send_ctrlenter').then(function (sendOnCtrl) { + sendOnEnter = !sendOnCtrl; + }); }; + $scope.$on('settings_changed', updateSendSettings); + updateSendSettings(); - function updateRichTextarea () { - if (richTextarea) { - $timeout.cancel(updatePromise); - var html = $('
').text($scope.draftMessage.text || '').html(); - html = html.replace(/\n/g, '
'); - $(richTextarea).html(html); - lastLength = html.length; - updateHeight(); - } + $(submitBtn).on('mousedown touchstart', onMessageSubmit); + + function onMessageSubmit (e) { + $scope.$apply(function () { + updateValue(); + $scope.draftMessage.send(); + composer.resetTyping(); + if (composerEmojiPanel) { + composerEmojiPanel.update(); + } + }); + return cancelEvent(e); } function updateValue () { if (richTextarea) { - $(richTextarea).trigger('change'); + composer.onChange(); updateHeight(); } } - var height = richTextarea.offsetHeight; + var height = richTextarea && richTextarea.offsetHeight; function updateHeight () { var newHeight = richTextarea.offsetHeight; if (height != newHeight) { @@ -1214,7 +1182,7 @@ angular.module('myApp.directives', ['myApp.filters']) function onKeyDown(e) { if (e.keyCode == 9 && !e.shiftKey && !e.ctrlKey && !e.metaKey && !$modalStack.getTop()) { // TAB - editorElement.focus(); + composer.focus(); return cancelEvent(e); } } @@ -1229,13 +1197,18 @@ angular.module('myApp.directives', ['myApp.filters']) $scope.$on('ui_history_change', focusField); } - $scope.$on('ui_peer_change', resetTyping); - $scope.$on('ui_peer_draft', updateRichTextarea); + $scope.$on('ui_peer_change', composer.resetTyping.bind(composer)); + $scope.$on('ui_peer_draft', function () { + if (richTextarea) { + composer.setValue($scope.draftMessage.text || ''); + updateHeight(); + } + composer.focus(); + }); var sendAwaiting = false; $scope.$on('ui_message_before_send', function () { sendAwaiting = true; - $timeout.cancel(updatePromise); updateValue(); }); $scope.$on('ui_message_send', function () { @@ -1243,35 +1216,17 @@ angular.module('myApp.directives', ['myApp.filters']) focusField(); }); - function focusField () { onContentLoaded(function () { - editorElement.focus(); + composer.focus(); }); } - function onPastedImageEvent (e) { - var element = (e.originalEvent || e).target, - src = (element || {}).src || '', - remove = false; - - if (src.substr(0, 5) == 'data:') { - remove = true; - var blob = dataUrlToBlob(src); - ErrorService.confirm({type: 'FILE_CLIPBOARD_PASTE'}).then(function () { - $scope.draftMessage.files = [blob]; - $scope.draftMessage.isMedia = true; - }); - setZeroTimeout(function () { - element.parentNode.removeChild(element); - }) - } - else if (src && !src.match(/img\/blank\.gif/)) { - var replacementNode = document.createTextNode(' ' + src + ' '); - setTimeout(function () { - element.parentNode.replaceChild(replacementNode, element); - }, 100); - } + function onFilesPaste (blobs) { + ErrorService.confirm({type: 'FILE_CLIPBOARD_PASTE'}).then(function () { + $scope.draftMessage.files = blobs; + $scope.draftMessage.isMedia = true; + }); }; function onPasteEvent (e) { @@ -1312,7 +1267,7 @@ angular.module('myApp.directives', ['myApp.filters']) if (e.type == 'dragenter' || e.type == 'dragover') { if (dragStateChanged) { $(dropbox) - .css({height: editorElement.offsetHeight + 2, width: editorElement.offsetWidth}) + .css({height: messageFieldWrap.offsetHeight + 2, width: messageFieldWrap.offsetWidth}) .show(); } } else { @@ -1335,15 +1290,11 @@ angular.module('myApp.directives', ['myApp.filters']) $scope.$on('$destroy', function cleanup() { - $('body').off('dragenter dragleave dragover drop', onDragDropEvent); $(document).off('paste', onPasteEvent); $(document).off('keydown', onKeyDown); - $(submitBtn).off('mousedown') + $('body').off('dragenter dragleave dragover drop', onDragDropEvent); + $(submitBtn).off('mousedown touchstart'); fileSelects.off('change'); - if (richTextarea) { - $(richTextarea).off('DOMNodeInserted keyup', onPastedImageEvent); - } - $(editorElement).off('keydown'); }); if (!Config.Navigator.touch) { @@ -2587,4 +2538,4 @@ angular.module('myApp.directives', ['myApp.filters']) } }; - }) + }) \ No newline at end of file diff --git a/app/js/lib/config.js b/app/js/lib/config.js index 443e05e5..b0a832f8 100644 --- a/app/js/lib/config.js +++ b/app/js/lib/config.js @@ -85,7 +85,7 @@ Config.Schema.MTProto = {"constructors":[{"id":"481674261","predicate":"vector", -Config.Schema.API = {"constructors":[{"id":"-1132882121","predicate":"boolFalse","params":[],"type":"Bool"},{"id":"-1720552011","predicate":"boolTrue","params":[],"type":"Bool"},{"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":"270785512","predicate":"inputPeerContact","params":[{"name":"user_id","type":"int"}],"type":"InputPeer"},{"id":"-1690012891","predicate":"inputPeerForeign","params":[{"name":"user_id","type":"int"},{"name":"access_hash","type":"long"}],"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":"-2031530139","predicate":"inputUserContact","params":[{"name":"user_id","type":"int"}],"type":"InputUser"},{"id":"1700689151","predicate":"inputUserForeign","params":[{"name":"user_id","type":"int"},{"name":"access_hash","type":"long"}],"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":"767900285","predicate":"inputMediaUploadedPhoto","params":[{"name":"file","type":"InputFile"}],"type":"InputMedia"},{"id":"-1893027092","predicate":"inputMediaPhoto","params":[{"name":"id","type":"InputPhoto"}],"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":"322623222","predicate":"inputMediaUploadedVideo","params":[{"name":"file","type":"InputFile"},{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"mime_type","type":"string"}],"type":"InputMedia"},{"id":"-1726817601","predicate":"inputMediaUploadedThumbVideo","params":[{"name":"file","type":"InputFile"},{"name":"thumb","type":"InputFile"},{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"mime_type","type":"string"}],"type":"InputMedia"},{"id":"2130852582","predicate":"inputMediaVideo","params":[{"name":"id","type":"InputVideo"}],"type":"InputMedia"},{"id":"480546647","predicate":"inputChatPhotoEmpty","params":[],"type":"InputChatPhoto"},{"id":"-1809496270","predicate":"inputChatUploadedPhoto","params":[{"name":"file","type":"InputFile"},{"name":"crop","type":"InputPhotoCrop"}],"type":"InputChatPhoto"},{"id":"-1293828344","predicate":"inputChatPhoto","params":[{"name":"id","type":"InputPhoto"},{"name":"crop","type":"InputPhotoCrop"}],"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":"1426648181","predicate":"inputVideoEmpty","params":[],"type":"InputVideo"},{"id":"-296249774","predicate":"inputVideo","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputVideo"},{"id":"342061462","predicate":"inputFileLocation","params":[{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"InputFileLocation"},{"id":"1023632620","predicate":"inputVideoFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"-1377390588","predicate":"inputPhotoCropAuto","params":[],"type":"InputPhotoCrop"},{"id":"-644787419","predicate":"inputPhotoCrop","params":[{"name":"crop_left","type":"double"},{"name":"crop_top","type":"double"},{"name":"crop_width","type":"double"}],"type":"InputPhotoCrop"},{"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":"1879553105","predicate":"userSelf","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"phone","type":"string"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"},{"name":"inactive","type":"Bool"}],"type":"User"},{"id":"-894214632","predicate":"userContact","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"access_hash","type":"long"},{"name":"phone","type":"string"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"}],"type":"User"},{"id":"-640891665","predicate":"userRequest","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"access_hash","type":"long"},{"name":"phone","type":"string"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"}],"type":"User"},{"id":"123533224","predicate":"userForeign","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"access_hash","type":"long"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"}],"type":"User"},{"id":"-704549510","predicate":"userDeleted","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"}],"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":"1855757255","predicate":"chat","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"photo","type":"ChatPhoto"},{"name":"participants_count","type":"int"},{"name":"date","type":"int"},{"name":"left","type":"Bool"},{"name":"version","type":"int"}],"type":"Chat"},{"id":"-83047359","predicate":"chatForbidden","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"date","type":"int"}],"type":"Chat"},{"id":"1661886910","predicate":"chatFull","params":[{"name":"id","type":"int"},{"name":"participants","type":"ChatParticipants"},{"name":"chat_photo","type":"Photo"},{"name":"notify_settings","type":"PeerNotifySettings"}],"type":"ChatFull"},{"id":"-925415106","predicate":"chatParticipant","params":[{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"date","type":"int"}],"type":"ChatParticipant"},{"id":"265468810","predicate":"chatParticipantsForbidden","params":[{"name":"chat_id","type":"int"}],"type":"ChatParticipants"},{"id":"2017571861","predicate":"chatParticipants","params":[{"name":"chat_id","type":"int"},{"name":"admin_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":"1450613171","predicate":"message","params":[{"name":"flags","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"to_id","type":"Peer"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"}],"type":"Message"},{"id":"-1553471722","predicate":"messageForwarded","params":[{"name":"flags","type":"int"},{"name":"id","type":"int"},{"name":"fwd_from_id","type":"int"},{"name":"fwd_date","type":"int"},{"name":"from_id","type":"int"},{"name":"to_id","type":"Peer"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"}],"type":"Message"},{"id":"495384334","predicate":"messageService","params":[{"name":"flags","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"to_id","type":"Peer"},{"name":"date","type":"int"},{"name":"action","type":"MessageAction"}],"type":"Message"},{"id":"1038967584","predicate":"messageMediaEmpty","params":[],"type":"MessageMedia"},{"id":"-926655958","predicate":"messageMediaPhoto","params":[{"name":"photo","type":"Photo"}],"type":"MessageMedia"},{"id":"-1563278704","predicate":"messageMediaVideo","params":[{"name":"video","type":"Video"}],"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":"694364726","predicate":"messageMediaUnsupported","params":[{"name":"bytes","type":"bytes"}],"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":"1581055051","predicate":"messageActionChatAddUser","params":[{"name":"user_id","type":"int"}],"type":"MessageAction"},{"id":"-1297179892","predicate":"messageActionChatDeleteUser","params":[{"name":"user_id","type":"int"}],"type":"MessageAction"},{"id":"-1422222932","predicate":"dialog","params":[{"name":"peer","type":"Peer"},{"name":"top_message","type":"int"},{"name":"unread_count","type":"int"},{"name":"notify_settings","type":"PeerNotifySettings"}],"type":"Dialog"},{"id":"590459437","predicate":"photoEmpty","params":[{"name":"id","type":"long"}],"type":"Photo"},{"id":"582313809","predicate":"photo","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"caption","type":"string"},{"name":"geo","type":"GeoPoint"},{"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":"-1056548696","predicate":"videoEmpty","params":[{"name":"id","type":"long"}],"type":"Video"},{"id":"948937617","predicate":"video","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"caption","type":"string"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"thumb","type":"PhotoSize"},{"name":"dc_id","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"Video"},{"id":"286776671","predicate":"geoPointEmpty","params":[],"type":"GeoPoint"},{"id":"541710092","predicate":"geoPoint","params":[{"name":"long","type":"double"},{"name":"lat","type":"double"}],"type":"GeoPoint"},{"id":"-486486981","predicate":"auth.checkedPhone","params":[{"name":"phone_registered","type":"Bool"},{"name":"phone_invited","type":"Bool"}],"type":"auth.CheckedPhone"},{"id":"-269659687","predicate":"auth.sentCode","params":[{"name":"phone_registered","type":"Bool"},{"name":"phone_code_hash","type":"string"},{"name":"send_call_timeout","type":"int"},{"name":"is_password","type":"Bool"}],"type":"auth.SentCode"},{"id":"-155815004","predicate":"auth.authorization","params":[{"name":"expires","type":"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":"1185074840","predicate":"inputPeerNotifySettings","params":[{"name":"mute_until","type":"int"},{"name":"sound","type":"string"},{"name":"show_previews","type":"Bool"},{"name":"events_mask","type":"int"}],"type":"InputPeerNotifySettings"},{"id":"-1378534221","predicate":"peerNotifyEventsEmpty","params":[],"type":"PeerNotifyEvents"},{"id":"1830677896","predicate":"peerNotifyEventsAll","params":[],"type":"PeerNotifyEvents"},{"id":"1889961234","predicate":"peerNotifySettingsEmpty","params":[],"type":"PeerNotifySettings"},{"id":"-1923214866","predicate":"peerNotifySettings","params":[{"name":"mute_until","type":"int"},{"name":"sound","type":"string"},{"name":"show_previews","type":"Bool"},{"name":"events_mask","type":"int"}],"type":"PeerNotifySettings"},{"id":"1089848634","predicate":"globalPrivacySettings","params":[{"name":"no_suggestions","type":"Bool"},{"name":"hide_contacts","type":"Bool"},{"name":"hide_located","type":"Bool"},{"name":"hide_last_visit","type":"Bool"}],"type":"GlobalPrivacySettings"},{"id":"-860866985","predicate":"wallPaper","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"sizes","type":"Vector"},{"name":"color","type":"int"}],"type":"WallPaper"},{"id":"1997575642","predicate":"userFull","params":[{"name":"user","type":"User"},{"name":"link","type":"contacts.Link"},{"name":"profile_photo","type":"Photo"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"blocked","type":"Bool"},{"name":"real_first_name","type":"string"},{"name":"real_last_name","type":"string"}],"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":"1038193057","predicate":"contactSuggested","params":[{"name":"user_id","type":"int"},{"name":"mutual_contacts","type":"int"}],"type":"ContactSuggested"},{"id":"-748155807","predicate":"contactStatus","params":[{"name":"user_id","type":"int"},{"name":"status","type":"UserStatus"}],"type":"ContactStatus"},{"id":"909233996","predicate":"chatLocated","params":[{"name":"chat_id","type":"int"},{"name":"distance","type":"int"}],"type":"ChatLocated"},{"id":"322183672","predicate":"contacts.foreignLinkUnknown","params":[],"type":"contacts.ForeignLink"},{"id":"-1484775609","predicate":"contacts.foreignLinkRequested","params":[{"name":"has_phone","type":"Bool"}],"type":"contacts.ForeignLink"},{"id":"468356321","predicate":"contacts.foreignLinkMutual","params":[],"type":"contacts.ForeignLink"},{"id":"-768992160","predicate":"contacts.myLinkEmpty","params":[],"type":"contacts.MyLink"},{"id":"1818882030","predicate":"contacts.myLinkRequested","params":[{"name":"contact","type":"Bool"}],"type":"contacts.MyLink"},{"id":"-1035932711","predicate":"contacts.myLinkContact","params":[],"type":"contacts.MyLink"},{"id":"-322001931","predicate":"contacts.link","params":[{"name":"my_link","type":"contacts.MyLink"},{"name":"foreign_link","type":"contacts.ForeignLink"},{"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":"1447681221","predicate":"contacts.suggested","params":[{"name":"results","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Suggested"},{"id":"364538944","predicate":"messages.dialogs","params":[{"name":"dialogs","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Dialogs"},{"id":"1910543603","predicate":"messages.dialogsSlice","params":[{"name":"count","type":"int"},{"name":"dialogs","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Dialogs"},{"id":"-1938715001","predicate":"messages.messages","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Messages"},{"id":"189033187","predicate":"messages.messagesSlice","params":[{"name":"count","type":"int"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Messages"},{"id":"1062078024","predicate":"messages.messageEmpty","params":[],"type":"messages.Message"},{"id":"-7289833","predicate":"messages.message","params":[{"name":"message","type":"Message"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Message"},{"id":"-1768654661","predicate":"messages.statedMessages","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessages"},{"id":"-797251802","predicate":"messages.statedMessage","params":[{"name":"message","type":"Message"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessage"},{"id":"-772484260","predicate":"messages.sentMessage","params":[{"name":"id","type":"int"},{"name":"date","type":"int"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.SentMessage"},{"id":"1089011754","predicate":"messages.chat","params":[{"name":"chat","type":"Chat"},{"name":"users","type":"Vector"}],"type":"messages.Chat"},{"id":"-2125411368","predicate":"messages.chats","params":[{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Chats"},{"id":"-438840932","predicate":"messages.chatFull","params":[{"name":"full_chat","type":"ChatFull"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.ChatFull"},{"id":"-1210173710","predicate":"messages.affectedHistory","params":[{"name":"pts","type":"int"},{"name":"seq","type":"int"},{"name":"offset","type":"int"}],"type":"messages.AffectedHistory"},{"id":"1474492012","predicate":"inputMessagesFilterEmpty","params":[],"type":"MessagesFilter"},{"id":"-1777752804","predicate":"inputMessagesFilterPhotos","params":[],"type":"MessagesFilter"},{"id":"-1614803355","predicate":"inputMessagesFilterVideo","params":[],"type":"MessagesFilter"},{"id":"1458172132","predicate":"inputMessagesFilterPhotoVideo","params":[],"type":"MessagesFilter"},{"id":"-1629621880","predicate":"inputMessagesFilterDocument","params":[],"type":"MessagesFilter"},{"id":"-808946398","predicate":"inputMessagesFilterAudio","params":[],"type":"MessagesFilter"},{"id":"20626867","predicate":"updateNewMessage","params":[{"name":"message","type":"Message"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"1318109142","predicate":"updateMessageID","params":[{"name":"id","type":"int"},{"name":"random_id","type":"long"}],"type":"Update"},{"id":"-966484431","predicate":"updateReadMessages","params":[{"name":"messages","type":"Vector"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"-1456734682","predicate":"updateDeleteMessages","params":[{"name":"messages","type":"Vector"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"-782376883","predicate":"updateRestoreMessages","params":[{"name":"messages","type":"Vector"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"1548249383","predicate":"updateUserTyping","params":[{"name":"user_id","type":"int"},{"name":"action","type":"SendMessageAction"}],"type":"Update"},{"id":"-1704596961","predicate":"updateChatUserTyping","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"action","type":"SendMessageAction"}],"type":"Update"},{"id":"125178264","predicate":"updateChatParticipants","params":[{"name":"participants","type":"ChatParticipants"}],"type":"Update"},{"id":"469489699","predicate":"updateUserStatus","params":[{"name":"user_id","type":"int"},{"name":"status","type":"UserStatus"}],"type":"Update"},{"id":"-1489818765","predicate":"updateUserName","params":[{"name":"user_id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"}],"type":"Update"},{"id":"-1791935732","predicate":"updateUserPhoto","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"photo","type":"UserProfilePhoto"},{"name":"previous","type":"Bool"}],"type":"Update"},{"id":"628472761","predicate":"updateContactRegistered","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"}],"type":"Update"},{"id":"1369737882","predicate":"updateContactLink","params":[{"name":"user_id","type":"int"},{"name":"my_link","type":"contacts.MyLink"},{"name":"foreign_link","type":"contacts.ForeignLink"}],"type":"Update"},{"id":"1869154659","predicate":"updateActivation","params":[{"name":"user_id","type":"int"}],"type":"Update"},{"id":"-1895411046","predicate":"updateNewAuthorization","params":[{"name":"auth_key_id","type":"long"},{"name":"date","type":"int"},{"name":"device","type":"string"},{"name":"location","type":"string"}],"type":"Update"},{"id":"-1519637954","predicate":"updates.state","params":[{"name":"pts","type":"int"},{"name":"qts","type":"int"},{"name":"date","type":"int"},{"name":"seq","type":"int"},{"name":"unread_count","type":"int"}],"type":"updates.State"},{"id":"1567990072","predicate":"updates.differenceEmpty","params":[{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"updates.Difference"},{"id":"16030880","predicate":"updates.difference","params":[{"name":"new_messages","type":"Vector"},{"name":"new_encrypted_messages","type":"Vector"},{"name":"other_updates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"state","type":"updates.State"}],"type":"updates.Difference"},{"id":"-1459938943","predicate":"updates.differenceSlice","params":[{"name":"new_messages","type":"Vector"},{"name":"new_encrypted_messages","type":"Vector"},{"name":"other_updates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"intermediate_state","type":"updates.State"}],"type":"updates.Difference"},{"id":"-484987010","predicate":"updatesTooLong","params":[],"type":"Updates"},{"id":"-738961532","predicate":"updateShortMessage","params":[{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"message","type":"string"},{"name":"pts","type":"int"},{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"724548942","predicate":"updateShortChatMessage","params":[{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"chat_id","type":"int"},{"name":"message","type":"string"},{"name":"pts","type":"int"},{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"2027216577","predicate":"updateShort","params":[{"name":"update","type":"Update"},{"name":"date","type":"int"}],"type":"Updates"},{"id":"1918567619","predicate":"updatesCombined","params":[{"name":"updates","type":"Vector"},{"name":"users","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"date","type":"int"},{"name":"seq_start","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"1957577280","predicate":"updates","params":[{"name":"updates","type":"Vector"},{"name":"users","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"-1916114267","predicate":"photos.photos","params":[{"name":"photos","type":"Vector"},{"name":"users","type":"Vector"}],"type":"photos.Photos"},{"id":"352657236","predicate":"photos.photosSlice","params":[{"name":"count","type":"int"},{"name":"photos","type":"Vector"},{"name":"users","type":"Vector"}],"type":"photos.Photos"},{"id":"539045032","predicate":"photos.photo","params":[{"name":"photo","type":"Photo"},{"name":"users","type":"Vector"}],"type":"photos.Photo"},{"id":"157948117","predicate":"upload.file","params":[{"name":"type","type":"storage.FileType"},{"name":"mtime","type":"int"},{"name":"bytes","type":"bytes"}],"type":"upload.File"},{"id":"784507964","predicate":"dcOption","params":[{"name":"id","type":"int"},{"name":"hostname","type":"string"},{"name":"ip_address","type":"string"},{"name":"port","type":"int"}],"type":"DcOption"},{"id":"777313652","predicate":"config","params":[{"name":"date","type":"int"},{"name":"test_mode","type":"Bool"},{"name":"this_dc","type":"int"},{"name":"dc_options","type":"Vector"},{"name":"chat_size_max","type":"int"},{"name":"broadcast_size_max","type":"int"}],"type":"Config"},{"id":"-1910892683","predicate":"nearestDc","params":[{"name":"country","type":"string"},{"name":"this_dc","type":"int"},{"name":"nearest_dc","type":"int"}],"type":"NearestDc"},{"id":"-1987579119","predicate":"help.appUpdate","params":[{"name":"id","type":"int"},{"name":"critical","type":"Bool"},{"name":"url","type":"string"},{"name":"text","type":"string"}],"type":"help.AppUpdate"},{"id":"-1000708810","predicate":"help.noAppUpdate","params":[],"type":"help.AppUpdate"},{"id":"415997816","predicate":"help.inviteText","params":[{"name":"message","type":"string"}],"type":"help.InviteText"},{"id":"1047852486","predicate":"messages.statedMessagesLinks","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"links","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessages"},{"id":"-1448138623","predicate":"messages.statedMessageLink","params":[{"name":"message","type":"Message"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"links","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessage"},{"id":"-371504577","predicate":"messages.sentMessageLink","params":[{"name":"id","type":"int"},{"name":"date","type":"int"},{"name":"pts","type":"int"},{"name":"seq","type":"int"},{"name":"links","type":"Vector"}],"type":"messages.SentMessage"},{"id":"1960072954","predicate":"inputGeoChat","params":[{"name":"chat_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputGeoChat"},{"id":"1301143240","predicate":"inputNotifyGeoChatPeer","params":[{"name":"peer","type":"InputGeoChat"}],"type":"InputNotifyPeer"},{"id":"1978329690","predicate":"geoChat","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"title","type":"string"},{"name":"address","type":"string"},{"name":"venue","type":"string"},{"name":"geo","type":"GeoPoint"},{"name":"photo","type":"ChatPhoto"},{"name":"participants_count","type":"int"},{"name":"date","type":"int"},{"name":"checked_in","type":"Bool"},{"name":"version","type":"int"}],"type":"Chat"},{"id":"1613830811","predicate":"geoChatMessageEmpty","params":[{"name":"chat_id","type":"int"},{"name":"id","type":"int"}],"type":"GeoChatMessage"},{"id":"1158019297","predicate":"geoChatMessage","params":[{"name":"chat_id","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"}],"type":"GeoChatMessage"},{"id":"-749755826","predicate":"geoChatMessageService","params":[{"name":"chat_id","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"date","type":"int"},{"name":"action","type":"MessageAction"}],"type":"GeoChatMessage"},{"id":"397498251","predicate":"geochats.statedMessage","params":[{"name":"message","type":"GeoChatMessage"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"seq","type":"int"}],"type":"geochats.StatedMessage"},{"id":"1224651367","predicate":"geochats.located","params":[{"name":"results","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"geochats.Located"},{"id":"-783127119","predicate":"geochats.messages","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"geochats.Messages"},{"id":"-1135057944","predicate":"geochats.messagesSlice","params":[{"name":"count","type":"int"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"geochats.Messages"},{"id":"1862504124","predicate":"messageActionGeoChatCreate","params":[{"name":"title","type":"string"},{"name":"address","type":"string"}],"type":"MessageAction"},{"id":"209540062","predicate":"messageActionGeoChatCheckin","params":[],"type":"MessageAction"},{"id":"1516823543","predicate":"updateNewGeoChatMessage","params":[{"name":"message","type":"GeoChatMessage"}],"type":"Update"},{"id":"1662091044","predicate":"wallPaperSolid","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"bg_color","type":"int"},{"name":"color","type":"int"}],"type":"WallPaper"},{"id":"314359194","predicate":"updateNewEncryptedMessage","params":[{"name":"message","type":"EncryptedMessage"},{"name":"qts","type":"int"}],"type":"Update"},{"id":"386986326","predicate":"updateEncryptedChatTyping","params":[{"name":"chat_id","type":"int"}],"type":"Update"},{"id":"-1264392051","predicate":"updateEncryption","params":[{"name":"chat","type":"EncryptedChat"},{"name":"date","type":"int"}],"type":"Update"},{"id":"956179895","predicate":"updateEncryptedMessagesRead","params":[{"name":"chat_id","type":"int"},{"name":"max_date","type":"int"},{"name":"date","type":"int"}],"type":"Update"},{"id":"-1417756512","predicate":"encryptedChatEmpty","params":[{"name":"id","type":"int"}],"type":"EncryptedChat"},{"id":"1006044124","predicate":"encryptedChatWaiting","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"}],"type":"EncryptedChat"},{"id":"-931638658","predicate":"encryptedChatRequested","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a","type":"bytes"}],"type":"EncryptedChat"},{"id":"-94974410","predicate":"encryptedChat","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a_or_b","type":"bytes"},{"name":"key_fingerprint","type":"long"}],"type":"EncryptedChat"},{"id":"332848423","predicate":"encryptedChatDiscarded","params":[{"name":"id","type":"int"}],"type":"EncryptedChat"},{"id":"-247351839","predicate":"inputEncryptedChat","params":[{"name":"chat_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputEncryptedChat"},{"id":"-1038136962","predicate":"encryptedFileEmpty","params":[],"type":"EncryptedFile"},{"id":"1248893260","predicate":"encryptedFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"size","type":"int"},{"name":"dc_id","type":"int"},{"name":"key_fingerprint","type":"int"}],"type":"EncryptedFile"},{"id":"406307684","predicate":"inputEncryptedFileEmpty","params":[],"type":"InputEncryptedFile"},{"id":"1690108678","predicate":"inputEncryptedFileUploaded","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"md5_checksum","type":"string"},{"name":"key_fingerprint","type":"int"}],"type":"InputEncryptedFile"},{"id":"1511503333","predicate":"inputEncryptedFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputEncryptedFile"},{"id":"-182231723","predicate":"inputEncryptedFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"-317144808","predicate":"encryptedMessage","params":[{"name":"random_id","type":"long"},{"name":"chat_id","type":"int"},{"name":"date","type":"int"},{"name":"bytes","type":"bytes"},{"name":"file","type":"EncryptedFile"}],"type":"EncryptedMessage"},{"id":"594758406","predicate":"encryptedMessageService","params":[{"name":"random_id","type":"long"},{"name":"chat_id","type":"int"},{"name":"date","type":"int"},{"name":"bytes","type":"bytes"}],"type":"EncryptedMessage"},{"id":"-1058912715","predicate":"messages.dhConfigNotModified","params":[{"name":"random","type":"bytes"}],"type":"messages.DhConfig"},{"id":"740433629","predicate":"messages.dhConfig","params":[{"name":"g","type":"int"},{"name":"p","type":"bytes"},{"name":"version","type":"int"},{"name":"random","type":"bytes"}],"type":"messages.DhConfig"},{"id":"1443858741","predicate":"messages.sentEncryptedMessage","params":[{"name":"date","type":"int"}],"type":"messages.SentEncryptedMessage"},{"id":"-1802240206","predicate":"messages.sentEncryptedFile","params":[{"name":"date","type":"int"},{"name":"file","type":"EncryptedFile"}],"type":"messages.SentEncryptedMessage"},{"id":"-95482955","predicate":"inputFileBig","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"name","type":"string"}],"type":"InputFile"},{"id":"767652808","predicate":"inputEncryptedFileBigUploaded","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"key_fingerprint","type":"int"}],"type":"InputEncryptedFile"},{"id":"974056226","predicate":"updateChatParticipantAdd","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"version","type":"int"}],"type":"Update"},{"id":"1851755554","predicate":"updateChatParticipantDelete","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"version","type":"int"}],"type":"Update"},{"id":"-1906403213","predicate":"updateDcOptions","params":[{"name":"dc_options","type":"Vector"}],"type":"Update"},{"id":"1313442987","predicate":"inputMediaUploadedAudio","params":[{"name":"file","type":"InputFile"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"}],"type":"InputMedia"},{"id":"-1986820223","predicate":"inputMediaAudio","params":[{"name":"id","type":"InputAudio"}],"type":"InputMedia"},{"id":"-1610888","predicate":"inputMediaUploadedDocument","params":[{"name":"file","type":"InputFile"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"}],"type":"InputMedia"},{"id":"1095242886","predicate":"inputMediaUploadedThumbDocument","params":[{"name":"file","type":"InputFile"},{"name":"thumb","type":"InputFile"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"}],"type":"InputMedia"},{"id":"-779818943","predicate":"inputMediaDocument","params":[{"name":"id","type":"InputDocument"}],"type":"InputMedia"},{"id":"802824708","predicate":"messageMediaDocument","params":[{"name":"document","type":"Document"}],"type":"MessageMedia"},{"id":"-961117440","predicate":"messageMediaAudio","params":[{"name":"audio","type":"Audio"}],"type":"MessageMedia"},{"id":"-648356732","predicate":"inputAudioEmpty","params":[],"type":"InputAudio"},{"id":"2010398975","predicate":"inputAudio","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputAudio"},{"id":"1928391342","predicate":"inputDocumentEmpty","params":[],"type":"InputDocument"},{"id":"410618194","predicate":"inputDocument","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputDocument"},{"id":"1960591437","predicate":"inputAudioFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"1313188841","predicate":"inputDocumentFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"1483311320","predicate":"audioEmpty","params":[{"name":"id","type":"long"}],"type":"Audio"},{"id":"-945003370","predicate":"audio","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"dc_id","type":"int"}],"type":"Audio"},{"id":"922273905","predicate":"documentEmpty","params":[{"name":"id","type":"long"}],"type":"Document"},{"id":"-106717361","predicate":"document","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"thumb","type":"PhotoSize"},{"name":"dc_id","type":"int"},{"name":"attributes","type":"Vector"}],"type":"Document"},{"id":"398898678","predicate":"help.support","params":[{"name":"phone_number","type":"string"},{"name":"user","type":"User"}],"type":"help.Support"},{"id":"-1613493288","predicate":"notifyPeer","params":[{"name":"peer","type":"Peer"}],"type":"NotifyPeer"},{"id":"-1261946036","predicate":"notifyUsers","params":[],"type":"NotifyPeer"},{"id":"-1073230141","predicate":"notifyChats","params":[],"type":"NotifyPeer"},{"id":"1959820384","predicate":"notifyAll","params":[],"type":"NotifyPeer"},{"id":"-2131957734","predicate":"updateUserBlocked","params":[{"name":"user_id","type":"int"},{"name":"blocked","type":"Bool"}],"type":"Update"},{"id":"-1094555409","predicate":"updateNotifySettings","params":[{"name":"peer","type":"NotifyPeer"},{"name":"notify_settings","type":"PeerNotifySettings"}],"type":"Update"},{"id":"-484053553","predicate":"auth.sentAppCode","params":[{"name":"phone_registered","type":"Bool"},{"name":"phone_code_hash","type":"string"},{"name":"send_call_timeout","type":"int"},{"name":"is_password","type":"Bool"}],"type":"auth.SentCode"},{"id":"381645902","predicate":"sendMessageTypingAction","params":[],"type":"SendMessageAction"},{"id":"-44119819","predicate":"sendMessageCancelAction","params":[],"type":"SendMessageAction"},{"id":"-1584933265","predicate":"sendMessageRecordVideoAction","params":[],"type":"SendMessageAction"},{"id":"-1845219337","predicate":"sendMessageUploadVideoAction","params":[],"type":"SendMessageAction"},{"id":"-718310409","predicate":"sendMessageRecordAudioAction","params":[],"type":"SendMessageAction"},{"id":"-424899985","predicate":"sendMessageUploadAudioAction","params":[],"type":"SendMessageAction"},{"id":"-1727382502","predicate":"sendMessageUploadPhotoAction","params":[],"type":"SendMessageAction"},{"id":"-1884362354","predicate":"sendMessageUploadDocumentAction","params":[],"type":"SendMessageAction"},{"id":"393186209","predicate":"sendMessageGeoLocationAction","params":[],"type":"SendMessageAction"},{"id":"1653390447","predicate":"sendMessageChooseContactAction","params":[],"type":"SendMessageAction"},{"id":"-360210539","predicate":"contactFound","params":[{"name":"user_id","type":"int"}],"type":"ContactFound"},{"id":"90570766","predicate":"contacts.found","params":[{"name":"results","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Found"},{"id":"942527460","predicate":"updateServiceNotification","params":[{"name":"type","type":"string"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"},{"name":"popup","type":"Bool"}],"type":"Update"},{"id":"-496024847","predicate":"userStatusRecently","params":[],"type":"UserStatus"},{"id":"129960444","predicate":"userStatusLastWeek","params":[],"type":"UserStatus"},{"id":"2011940674","predicate":"userStatusLastMonth","params":[],"type":"UserStatus"},{"id":"-298113238","predicate":"updatePrivacy","params":[{"name":"key","type":"PrivacyKey"},{"name":"rules","type":"Vector"}],"type":"Update"},{"id":"1335282456","predicate":"inputPrivacyKeyStatusTimestamp","params":[],"type":"InputPrivacyKey"},{"id":"-1137792208","predicate":"privacyKeyStatusTimestamp","params":[],"type":"PrivacyKey"},{"id":"218751099","predicate":"inputPrivacyValueAllowContacts","params":[],"type":"InputPrivacyRule"},{"id":"407582158","predicate":"inputPrivacyValueAllowAll","params":[],"type":"InputPrivacyRule"},{"id":"320652927","predicate":"inputPrivacyValueAllowUsers","params":[{"name":"users","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"195371015","predicate":"inputPrivacyValueDisallowContacts","params":[],"type":"InputPrivacyRule"},{"id":"-697604407","predicate":"inputPrivacyValueDisallowAll","params":[],"type":"InputPrivacyRule"},{"id":"-1877932953","predicate":"inputPrivacyValueDisallowUsers","params":[{"name":"users","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"-123988","predicate":"privacyValueAllowContacts","params":[],"type":"PrivacyRule"},{"id":"1698855810","predicate":"privacyValueAllowAll","params":[],"type":"PrivacyRule"},{"id":"1297858060","predicate":"privacyValueAllowUsers","params":[{"name":"users","type":"Vector"}],"type":"PrivacyRule"},{"id":"-125240806","predicate":"privacyValueDisallowContacts","params":[],"type":"PrivacyRule"},{"id":"-1955338397","predicate":"privacyValueDisallowAll","params":[],"type":"PrivacyRule"},{"id":"209668535","predicate":"privacyValueDisallowUsers","params":[{"name":"users","type":"Vector"}],"type":"PrivacyRule"},{"id":"1430961007","predicate":"account.privacyRules","params":[{"name":"rules","type":"Vector"},{"name":"users","type":"Vector"}],"type":"account.PrivacyRules"},{"id":"-1194283041","predicate":"accountDaysTTL","params":[{"name":"days","type":"int"}],"type":"AccountDaysTTL"},{"id":"-1527411636","predicate":"account.sentChangePhoneCode","params":[{"name":"phone_code_hash","type":"string"},{"name":"send_call_timeout","type":"int"}],"type":"account.SentChangePhoneCode"},{"id":"314130811","predicate":"updateUserPhone","params":[{"name":"user_id","type":"int"},{"name":"phone","type":"string"}],"type":"Update"},{"id":"1467017129","predicate":"account.noPassword","params":[{"name":"new_salt","type":"bytes"}],"type":"account.Password"},{"id":"1939758962","predicate":"account.password","params":[{"name":"current_salt","type":"bytes"},{"name":"new_salt","type":"bytes"},{"name":"hint","type":"string"}],"type":"account.Password"},{"id":"1815593308","predicate":"documentAttributeImageSize","params":[{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute"},{"id":"297109817","predicate":"documentAttributeAnimated","params":[],"type":"DocumentAttribute"},{"id":"-83208409","predicate":"documentAttributeSticker","params":[],"type":"DocumentAttribute"},{"id":"1494273227","predicate":"documentAttributeVideo","params":[{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute"},{"id":"85215461","predicate":"documentAttributeAudio","params":[{"name":"duration","type":"int"}],"type":"DocumentAttribute"},{"id":"358154344","predicate":"documentAttributeFilename","params":[{"name":"file_name","type":"string"}],"type":"DocumentAttribute"},{"id":"-244016606","predicate":"messages.stickersNotModified","params":[],"type":"messages.Stickers"},{"id":"-1970352846","predicate":"messages.stickers","params":[{"name":"hash","type":"string"},{"name":"stickers","type":"Vector"}],"type":"messages.Stickers"}],"methods":[{"id":"-878758099","method":"invokeAfterMsg","params":[{"name":"msg_id","type":"long"},{"name":"query","type":"!X"}],"type":"X"},{"id":"1036301552","method":"invokeAfterMsgs","params":[{"name":"msg_ids","type":"Vector"},{"name":"query","type":"!X"}],"type":"X"},{"id":"1877286395","method":"auth.checkPhone","params":[{"name":"phone_number","type":"string"}],"type":"auth.CheckedPhone"},{"id":"1988976461","method":"auth.sendCode","params":[{"name":"phone_number","type":"string"},{"name":"sms_type","type":"int"},{"name":"api_id","type":"int"},{"name":"api_hash","type":"string"},{"name":"lang_code","type":"string"}],"type":"auth.SentCode"},{"id":"63247716","method":"auth.sendCall","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"}],"type":"Bool"},{"id":"453408308","method":"auth.signUp","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"auth.Authorization"},{"id":"-1126886015","method":"auth.signIn","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"auth.Authorization"},{"id":"1461180992","method":"auth.logOut","params":[],"type":"Bool"},{"id":"-1616179942","method":"auth.resetAuthorizations","params":[],"type":"Bool"},{"id":"1998331287","method":"auth.sendInvites","params":[{"name":"phone_numbers","type":"Vector"},{"name":"message","type":"string"}],"type":"Bool"},{"id":"-440401971","method":"auth.exportAuthorization","params":[{"name":"dc_id","type":"int"}],"type":"auth.ExportedAuthorization"},{"id":"-470837741","method":"auth.importAuthorization","params":[{"name":"id","type":"int"},{"name":"bytes","type":"bytes"}],"type":"auth.Authorization"},{"id":"-841733627","method":"auth.bindTempAuthKey","params":[{"name":"perm_auth_key_id","type":"long"},{"name":"nonce","type":"long"},{"name":"expires_at","type":"int"},{"name":"encrypted_message","type":"bytes"}],"type":"Bool"},{"id":"1147957548","method":"account.registerDevice","params":[{"name":"token_type","type":"int"},{"name":"token","type":"string"},{"name":"device_model","type":"string"},{"name":"system_version","type":"string"},{"name":"app_version","type":"string"},{"name":"app_sandbox","type":"Bool"},{"name":"lang_code","type":"string"}],"type":"Bool"},{"id":"1707432768","method":"account.unregisterDevice","params":[{"name":"token_type","type":"int"},{"name":"token","type":"string"}],"type":"Bool"},{"id":"-2067899501","method":"account.updateNotifySettings","params":[{"name":"peer","type":"InputNotifyPeer"},{"name":"settings","type":"InputPeerNotifySettings"}],"type":"Bool"},{"id":"313765169","method":"account.getNotifySettings","params":[{"name":"peer","type":"InputNotifyPeer"}],"type":"PeerNotifySettings"},{"id":"-612493497","method":"account.resetNotifySettings","params":[],"type":"Bool"},{"id":"-259486360","method":"account.updateProfile","params":[{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"User"},{"id":"1713919532","method":"account.updateStatus","params":[{"name":"offline","type":"Bool"}],"type":"Bool"},{"id":"-1068696894","method":"account.getWallPapers","params":[],"type":"Vector"},{"id":"227648840","method":"users.getUsers","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"-902781519","method":"users.getFullUser","params":[{"name":"id","type":"InputUser"}],"type":"UserFull"},{"id":"-995929106","method":"contacts.getStatuses","params":[],"type":"Vector"},{"id":"583445000","method":"contacts.getContacts","params":[{"name":"hash","type":"string"}],"type":"contacts.Contacts"},{"id":"-634342611","method":"contacts.importContacts","params":[{"name":"contacts","type":"Vector"},{"name":"replace","type":"Bool"}],"type":"contacts.ImportedContacts"},{"id":"-847825880","method":"contacts.getSuggested","params":[{"name":"limit","type":"int"}],"type":"contacts.Suggested"},{"id":"-1902823612","method":"contacts.deleteContact","params":[{"name":"id","type":"InputUser"}],"type":"contacts.Link"},{"id":"1504393374","method":"contacts.deleteContacts","params":[{"name":"id","type":"Vector"}],"type":"Bool"},{"id":"858475004","method":"contacts.block","params":[{"name":"id","type":"InputUser"}],"type":"Bool"},{"id":"-448724803","method":"contacts.unblock","params":[{"name":"id","type":"InputUser"}],"type":"Bool"},{"id":"-176409329","method":"contacts.getBlocked","params":[{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"contacts.Blocked"},{"id":"-2065352905","method":"contacts.exportCard","params":[],"type":"Vector"},{"id":"1340184318","method":"contacts.importCard","params":[{"name":"export_card","type":"Vector"}],"type":"User"},{"id":"1109588596","method":"messages.getMessages","params":[{"name":"id","type":"Vector"}],"type":"messages.Messages"},{"id":"-321970698","method":"messages.getDialogs","params":[{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Dialogs"},{"id":"-1834885329","method":"messages.getHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Messages"},{"id":"132772523","method":"messages.search","params":[{"name":"peer","type":"InputPeer"},{"name":"q","type":"string"},{"name":"filter","type":"MessagesFilter"},{"name":"min_date","type":"int"},{"name":"max_date","type":"int"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Messages"},{"id":"-287800122","method":"messages.readHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"max_id","type":"int"},{"name":"offset","type":"int"},{"name":"read_contents","type":"Bool"}],"type":"messages.AffectedHistory"},{"id":"-185009311","method":"messages.deleteHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"offset","type":"int"}],"type":"messages.AffectedHistory"},{"id":"351460618","method":"messages.deleteMessages","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"962567550","method":"messages.restoreMessages","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"682347368","method":"messages.receivedMessages","params":[{"name":"max_id","type":"int"}],"type":"Vector"},{"id":"-1551737264","method":"messages.setTyping","params":[{"name":"peer","type":"InputPeer"},{"name":"action","type":"SendMessageAction"}],"type":"Bool"},{"id":"1289620139","method":"messages.sendMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"message","type":"string"},{"name":"random_id","type":"long"}],"type":"messages.SentMessage"},{"id":"-1547149962","method":"messages.sendMedia","params":[{"name":"peer","type":"InputPeer"},{"name":"media","type":"InputMedia"},{"name":"random_id","type":"long"}],"type":"messages.StatedMessage"},{"id":"1363988751","method":"messages.forwardMessages","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"Vector"}],"type":"messages.StatedMessages"},{"id":"1013621127","method":"messages.getChats","params":[{"name":"id","type":"Vector"}],"type":"messages.Chats"},{"id":"998448230","method":"messages.getFullChat","params":[{"name":"chat_id","type":"int"}],"type":"messages.ChatFull"},{"id":"-1262720843","method":"messages.editChatTitle","params":[{"name":"chat_id","type":"int"},{"name":"title","type":"string"}],"type":"messages.StatedMessage"},{"id":"-662601187","method":"messages.editChatPhoto","params":[{"name":"chat_id","type":"int"},{"name":"photo","type":"InputChatPhoto"}],"type":"messages.StatedMessage"},{"id":"787082910","method":"messages.addChatUser","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"InputUser"},{"name":"fwd_limit","type":"int"}],"type":"messages.StatedMessage"},{"id":"-1010447069","method":"messages.deleteChatUser","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"InputUser"}],"type":"messages.StatedMessage"},{"id":"1100847854","method":"messages.createChat","params":[{"name":"users","type":"Vector"},{"name":"title","type":"string"}],"type":"messages.StatedMessage"},{"id":"-304838614","method":"updates.getState","params":[],"type":"updates.State"},{"id":"168039573","method":"updates.getDifference","params":[{"name":"pts","type":"int"},{"name":"date","type":"int"},{"name":"qts","type":"int"}],"type":"updates.Difference"},{"id":"-285902432","method":"photos.updateProfilePhoto","params":[{"name":"id","type":"InputPhoto"},{"name":"crop","type":"InputPhotoCrop"}],"type":"UserProfilePhoto"},{"id":"-720397176","method":"photos.uploadProfilePhoto","params":[{"name":"file","type":"InputFile"},{"name":"caption","type":"string"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"crop","type":"InputPhotoCrop"}],"type":"photos.Photo"},{"id":"-2016444625","method":"photos.deletePhotos","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"-1291540959","method":"upload.saveFilePart","params":[{"name":"file_id","type":"long"},{"name":"file_part","type":"int"},{"name":"bytes","type":"bytes"}],"type":"Bool"},{"id":"-475607115","method":"upload.getFile","params":[{"name":"location","type":"InputFileLocation"},{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"upload.File"},{"id":"-990308245","method":"help.getConfig","params":[],"type":"Config"},{"id":"531836966","method":"help.getNearestDc","params":[],"type":"NearestDc"},{"id":"-938300290","method":"help.getAppUpdate","params":[{"name":"device_model","type":"string"},{"name":"system_version","type":"string"},{"name":"app_version","type":"string"},{"name":"lang_code","type":"string"}],"type":"help.AppUpdate"},{"id":"1862465352","method":"help.saveAppLog","params":[{"name":"events","type":"Vector"}],"type":"Bool"},{"id":"-1532407418","method":"help.getInviteText","params":[{"name":"lang_code","type":"string"}],"type":"help.InviteText"},{"id":"-1209117380","method":"photos.getUserPhotos","params":[{"name":"user_id","type":"InputUser"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"photos.Photos"},{"id":"66319602","method":"messages.forwardMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"},{"name":"random_id","type":"long"}],"type":"messages.StatedMessage"},{"id":"1102776690","method":"messages.sendBroadcast","params":[{"name":"contacts","type":"Vector"},{"name":"message","type":"string"},{"name":"media","type":"InputMedia"}],"type":"messages.StatedMessages"},{"id":"2132356495","method":"geochats.getLocated","params":[{"name":"geo_point","type":"InputGeoPoint"},{"name":"radius","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Located"},{"id":"-515735953","method":"geochats.getRecents","params":[{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Messages"},{"id":"1437853947","method":"geochats.checkin","params":[{"name":"peer","type":"InputGeoChat"}],"type":"geochats.StatedMessage"},{"id":"1730338159","method":"geochats.getFullChat","params":[{"name":"peer","type":"InputGeoChat"}],"type":"messages.ChatFull"},{"id":"1284383347","method":"geochats.editChatTitle","params":[{"name":"peer","type":"InputGeoChat"},{"name":"title","type":"string"},{"name":"address","type":"string"}],"type":"geochats.StatedMessage"},{"id":"903355029","method":"geochats.editChatPhoto","params":[{"name":"peer","type":"InputGeoChat"},{"name":"photo","type":"InputChatPhoto"}],"type":"geochats.StatedMessage"},{"id":"-808598451","method":"geochats.search","params":[{"name":"peer","type":"InputGeoChat"},{"name":"q","type":"string"},{"name":"filter","type":"MessagesFilter"},{"name":"min_date","type":"int"},{"name":"max_date","type":"int"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Messages"},{"id":"-1254131096","method":"geochats.getHistory","params":[{"name":"peer","type":"InputGeoChat"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Messages"},{"id":"146319145","method":"geochats.setTyping","params":[{"name":"peer","type":"InputGeoChat"},{"name":"typing","type":"Bool"}],"type":"Bool"},{"id":"102432836","method":"geochats.sendMessage","params":[{"name":"peer","type":"InputGeoChat"},{"name":"message","type":"string"},{"name":"random_id","type":"long"}],"type":"geochats.StatedMessage"},{"id":"-1192173825","method":"geochats.sendMedia","params":[{"name":"peer","type":"InputGeoChat"},{"name":"media","type":"InputMedia"},{"name":"random_id","type":"long"}],"type":"geochats.StatedMessage"},{"id":"235482646","method":"geochats.createGeoChat","params":[{"name":"title","type":"string"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"address","type":"string"},{"name":"venue","type":"string"}],"type":"geochats.StatedMessage"},{"id":"651135312","method":"messages.getDhConfig","params":[{"name":"version","type":"int"},{"name":"random_length","type":"int"}],"type":"messages.DhConfig"},{"id":"-162681021","method":"messages.requestEncryption","params":[{"name":"user_id","type":"InputUser"},{"name":"random_id","type":"int"},{"name":"g_a","type":"bytes"}],"type":"EncryptedChat"},{"id":"1035731989","method":"messages.acceptEncryption","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"g_b","type":"bytes"},{"name":"key_fingerprint","type":"long"}],"type":"EncryptedChat"},{"id":"-304536635","method":"messages.discardEncryption","params":[{"name":"chat_id","type":"int"}],"type":"Bool"},{"id":"2031374829","method":"messages.setEncryptedTyping","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"typing","type":"Bool"}],"type":"Bool"},{"id":"2135648522","method":"messages.readEncryptedHistory","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"max_date","type":"int"}],"type":"Bool"},{"id":"-1451792525","method":"messages.sendEncrypted","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"}],"type":"messages.SentEncryptedMessage"},{"id":"-1701831834","method":"messages.sendEncryptedFile","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"},{"name":"file","type":"InputEncryptedFile"}],"type":"messages.SentEncryptedMessage"},{"id":"852769188","method":"messages.sendEncryptedService","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"}],"type":"messages.SentEncryptedMessage"},{"id":"1436924774","method":"messages.receivedQueue","params":[{"name":"max_qts","type":"int"}],"type":"Vector"},{"id":"-562337987","method":"upload.saveBigFilePart","params":[{"name":"file_id","type":"long"},{"name":"file_part","type":"int"},{"name":"file_total_parts","type":"int"},{"name":"bytes","type":"bytes"}],"type":"Bool"},{"id":"1769565673","method":"initConnection","params":[{"name":"api_id","type":"int"},{"name":"device_model","type":"string"},{"name":"system_version","type":"string"},{"name":"app_version","type":"string"},{"name":"lang_code","type":"string"},{"name":"query","type":"!X"}],"type":"X"},{"id":"-1663104819","method":"help.getSupport","params":[],"type":"help.Support"},{"id":"229241832","method":"auth.sendSms","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"}],"type":"Bool"},{"id":"894131138","method":"messages.readMessageContents","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"655677548","method":"account.checkUsername","params":[{"name":"username","type":"string"}],"type":"Bool"},{"id":"1040964988","method":"account.updateUsername","params":[{"name":"username","type":"string"}],"type":"User"},{"id":"301470424","method":"contacts.search","params":[{"name":"q","type":"string"},{"name":"limit","type":"int"}],"type":"contacts.Found"},{"id":"-623130288","method":"account.getPrivacy","params":[{"name":"key","type":"InputPrivacyKey"}],"type":"account.PrivacyRules"},{"id":"-906486552","method":"account.setPrivacy","params":[{"name":"key","type":"InputPrivacyKey"},{"name":"rules","type":"Vector"}],"type":"account.PrivacyRules"},{"id":"1099779595","method":"account.deleteAccount","params":[{"name":"reason","type":"string"}],"type":"Bool"},{"id":"150761757","method":"account.getAccountTTL","params":[],"type":"AccountDaysTTL"},{"id":"608323678","method":"account.setAccountTTL","params":[{"name":"ttl","type":"AccountDaysTTL"}],"type":"Bool"},{"id":"-627372787","method":"invokeWithLayer","params":[{"name":"layer","type":"int"},{"name":"query","type":"!X"}],"type":"X"},{"id":"200282908","method":"contacts.resolveUsername","params":[{"name":"username","type":"string"}],"type":"User"},{"id":"-1543001868","method":"account.sendChangePhoneCode","params":[{"name":"phone_number","type":"string"}],"type":"account.SentChangePhoneCode"},{"id":"1891839707","method":"account.changePhone","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"User"},{"id":"1418342645","method":"account.getPassword","params":[],"type":"account.Password"},{"id":"-584430193","method":"account.setPassword","params":[{"name":"current_password_hash","type":"bytes"},{"name":"new_salt","type":"bytes"},{"name":"new_password_hash","type":"bytes"},{"name":"hint","type":"string"}],"type":"Bool"},{"id":"174260510","method":"auth.checkPassword","params":[{"name":"password_hash","type":"bytes"}],"type":"auth.Authorization"},{"id":"-1373446075","method":"messages.getStickers","params":[{"name":"emoticon","type":"string"},{"name":"hash","type":"string"}],"type":"messages.Stickers"}]}; +Config.Schema.API = {"constructors":[{"id":"-1132882121","predicate":"boolFalse","params":[],"type":"Bool"},{"id":"-1720552011","predicate":"boolTrue","params":[],"type":"Bool"},{"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":"270785512","predicate":"inputPeerContact","params":[{"name":"user_id","type":"int"}],"type":"InputPeer"},{"id":"-1690012891","predicate":"inputPeerForeign","params":[{"name":"user_id","type":"int"},{"name":"access_hash","type":"long"}],"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":"-2031530139","predicate":"inputUserContact","params":[{"name":"user_id","type":"int"}],"type":"InputUser"},{"id":"1700689151","predicate":"inputUserForeign","params":[{"name":"user_id","type":"int"},{"name":"access_hash","type":"long"}],"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":"767900285","predicate":"inputMediaUploadedPhoto","params":[{"name":"file","type":"InputFile"}],"type":"InputMedia"},{"id":"-1893027092","predicate":"inputMediaPhoto","params":[{"name":"id","type":"InputPhoto"}],"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":"322623222","predicate":"inputMediaUploadedVideo","params":[{"name":"file","type":"InputFile"},{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"mime_type","type":"string"}],"type":"InputMedia"},{"id":"-1726817601","predicate":"inputMediaUploadedThumbVideo","params":[{"name":"file","type":"InputFile"},{"name":"thumb","type":"InputFile"},{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"},{"name":"mime_type","type":"string"}],"type":"InputMedia"},{"id":"2130852582","predicate":"inputMediaVideo","params":[{"name":"id","type":"InputVideo"}],"type":"InputMedia"},{"id":"480546647","predicate":"inputChatPhotoEmpty","params":[],"type":"InputChatPhoto"},{"id":"-1809496270","predicate":"inputChatUploadedPhoto","params":[{"name":"file","type":"InputFile"},{"name":"crop","type":"InputPhotoCrop"}],"type":"InputChatPhoto"},{"id":"-1293828344","predicate":"inputChatPhoto","params":[{"name":"id","type":"InputPhoto"},{"name":"crop","type":"InputPhotoCrop"}],"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":"1426648181","predicate":"inputVideoEmpty","params":[],"type":"InputVideo"},{"id":"-296249774","predicate":"inputVideo","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputVideo"},{"id":"342061462","predicate":"inputFileLocation","params":[{"name":"volume_id","type":"long"},{"name":"local_id","type":"int"},{"name":"secret","type":"long"}],"type":"InputFileLocation"},{"id":"1023632620","predicate":"inputVideoFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"-1377390588","predicate":"inputPhotoCropAuto","params":[],"type":"InputPhotoCrop"},{"id":"-644787419","predicate":"inputPhotoCrop","params":[{"name":"crop_left","type":"double"},{"name":"crop_top","type":"double"},{"name":"crop_width","type":"double"}],"type":"InputPhotoCrop"},{"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":"1879553105","predicate":"userSelf","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"phone","type":"string"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"},{"name":"inactive","type":"Bool"}],"type":"User"},{"id":"-894214632","predicate":"userContact","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"access_hash","type":"long"},{"name":"phone","type":"string"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"}],"type":"User"},{"id":"-640891665","predicate":"userRequest","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"access_hash","type":"long"},{"name":"phone","type":"string"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"}],"type":"User"},{"id":"123533224","predicate":"userForeign","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"},{"name":"access_hash","type":"long"},{"name":"photo","type":"UserProfilePhoto"},{"name":"status","type":"UserStatus"}],"type":"User"},{"id":"-704549510","predicate":"userDeleted","params":[{"name":"id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"}],"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":"1855757255","predicate":"chat","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"photo","type":"ChatPhoto"},{"name":"participants_count","type":"int"},{"name":"date","type":"int"},{"name":"left","type":"Bool"},{"name":"version","type":"int"}],"type":"Chat"},{"id":"-83047359","predicate":"chatForbidden","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"date","type":"int"}],"type":"Chat"},{"id":"1661886910","predicate":"chatFull","params":[{"name":"id","type":"int"},{"name":"participants","type":"ChatParticipants"},{"name":"chat_photo","type":"Photo"},{"name":"notify_settings","type":"PeerNotifySettings"}],"type":"ChatFull"},{"id":"-925415106","predicate":"chatParticipant","params":[{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"date","type":"int"}],"type":"ChatParticipant"},{"id":"265468810","predicate":"chatParticipantsForbidden","params":[{"name":"chat_id","type":"int"}],"type":"ChatParticipants"},{"id":"2017571861","predicate":"chatParticipants","params":[{"name":"chat_id","type":"int"},{"name":"admin_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":"1450613171","predicate":"message","params":[{"name":"flags","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"to_id","type":"Peer"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"}],"type":"Message"},{"id":"-1553471722","predicate":"messageForwarded","params":[{"name":"flags","type":"int"},{"name":"id","type":"int"},{"name":"fwd_from_id","type":"int"},{"name":"fwd_date","type":"int"},{"name":"from_id","type":"int"},{"name":"to_id","type":"Peer"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"}],"type":"Message"},{"id":"495384334","predicate":"messageService","params":[{"name":"flags","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"to_id","type":"Peer"},{"name":"date","type":"int"},{"name":"action","type":"MessageAction"}],"type":"Message"},{"id":"1038967584","predicate":"messageMediaEmpty","params":[],"type":"MessageMedia"},{"id":"-926655958","predicate":"messageMediaPhoto","params":[{"name":"photo","type":"Photo"}],"type":"MessageMedia"},{"id":"-1563278704","predicate":"messageMediaVideo","params":[{"name":"video","type":"Video"}],"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":"694364726","predicate":"messageMediaUnsupported","params":[{"name":"bytes","type":"bytes"}],"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":"1581055051","predicate":"messageActionChatAddUser","params":[{"name":"user_id","type":"int"}],"type":"MessageAction"},{"id":"-1297179892","predicate":"messageActionChatDeleteUser","params":[{"name":"user_id","type":"int"}],"type":"MessageAction"},{"id":"-1422222932","predicate":"dialog","params":[{"name":"peer","type":"Peer"},{"name":"top_message","type":"int"},{"name":"unread_count","type":"int"},{"name":"notify_settings","type":"PeerNotifySettings"}],"type":"Dialog"},{"id":"590459437","predicate":"photoEmpty","params":[{"name":"id","type":"long"}],"type":"Photo"},{"id":"582313809","predicate":"photo","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"caption","type":"string"},{"name":"geo","type":"GeoPoint"},{"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":"-1056548696","predicate":"videoEmpty","params":[{"name":"id","type":"long"}],"type":"Video"},{"id":"948937617","predicate":"video","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"caption","type":"string"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"thumb","type":"PhotoSize"},{"name":"dc_id","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"Video"},{"id":"286776671","predicate":"geoPointEmpty","params":[],"type":"GeoPoint"},{"id":"541710092","predicate":"geoPoint","params":[{"name":"long","type":"double"},{"name":"lat","type":"double"}],"type":"GeoPoint"},{"id":"-486486981","predicate":"auth.checkedPhone","params":[{"name":"phone_registered","type":"Bool"},{"name":"phone_invited","type":"Bool"}],"type":"auth.CheckedPhone"},{"id":"-269659687","predicate":"auth.sentCode","params":[{"name":"phone_registered","type":"Bool"},{"name":"phone_code_hash","type":"string"},{"name":"send_call_timeout","type":"int"},{"name":"is_password","type":"Bool"}],"type":"auth.SentCode"},{"id":"-155815004","predicate":"auth.authorization","params":[{"name":"expires","type":"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":"1185074840","predicate":"inputPeerNotifySettings","params":[{"name":"mute_until","type":"int"},{"name":"sound","type":"string"},{"name":"show_previews","type":"Bool"},{"name":"events_mask","type":"int"}],"type":"InputPeerNotifySettings"},{"id":"-1378534221","predicate":"peerNotifyEventsEmpty","params":[],"type":"PeerNotifyEvents"},{"id":"1830677896","predicate":"peerNotifyEventsAll","params":[],"type":"PeerNotifyEvents"},{"id":"1889961234","predicate":"peerNotifySettingsEmpty","params":[],"type":"PeerNotifySettings"},{"id":"-1923214866","predicate":"peerNotifySettings","params":[{"name":"mute_until","type":"int"},{"name":"sound","type":"string"},{"name":"show_previews","type":"Bool"},{"name":"events_mask","type":"int"}],"type":"PeerNotifySettings"},{"id":"-860866985","predicate":"wallPaper","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"sizes","type":"Vector"},{"name":"color","type":"int"}],"type":"WallPaper"},{"id":"1997575642","predicate":"userFull","params":[{"name":"user","type":"User"},{"name":"link","type":"contacts.Link"},{"name":"profile_photo","type":"Photo"},{"name":"notify_settings","type":"PeerNotifySettings"},{"name":"blocked","type":"Bool"},{"name":"real_first_name","type":"string"},{"name":"real_last_name","type":"string"}],"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":"1038193057","predicate":"contactSuggested","params":[{"name":"user_id","type":"int"},{"name":"mutual_contacts","type":"int"}],"type":"ContactSuggested"},{"id":"-748155807","predicate":"contactStatus","params":[{"name":"user_id","type":"int"},{"name":"status","type":"UserStatus"}],"type":"ContactStatus"},{"id":"909233996","predicate":"chatLocated","params":[{"name":"chat_id","type":"int"},{"name":"distance","type":"int"}],"type":"ChatLocated"},{"id":"322183672","predicate":"contacts.foreignLinkUnknown","params":[],"type":"contacts.ForeignLink"},{"id":"-1484775609","predicate":"contacts.foreignLinkRequested","params":[{"name":"has_phone","type":"Bool"}],"type":"contacts.ForeignLink"},{"id":"468356321","predicate":"contacts.foreignLinkMutual","params":[],"type":"contacts.ForeignLink"},{"id":"-768992160","predicate":"contacts.myLinkEmpty","params":[],"type":"contacts.MyLink"},{"id":"1818882030","predicate":"contacts.myLinkRequested","params":[{"name":"contact","type":"Bool"}],"type":"contacts.MyLink"},{"id":"-1035932711","predicate":"contacts.myLinkContact","params":[],"type":"contacts.MyLink"},{"id":"-322001931","predicate":"contacts.link","params":[{"name":"my_link","type":"contacts.MyLink"},{"name":"foreign_link","type":"contacts.ForeignLink"},{"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":"1447681221","predicate":"contacts.suggested","params":[{"name":"results","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Suggested"},{"id":"364538944","predicate":"messages.dialogs","params":[{"name":"dialogs","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Dialogs"},{"id":"1910543603","predicate":"messages.dialogsSlice","params":[{"name":"count","type":"int"},{"name":"dialogs","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Dialogs"},{"id":"-1938715001","predicate":"messages.messages","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Messages"},{"id":"189033187","predicate":"messages.messagesSlice","params":[{"name":"count","type":"int"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Messages"},{"id":"1062078024","predicate":"messages.messageEmpty","params":[],"type":"messages.Message"},{"id":"-7289833","predicate":"messages.message","params":[{"name":"message","type":"Message"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Message"},{"id":"-1768654661","predicate":"messages.statedMessages","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessages"},{"id":"-797251802","predicate":"messages.statedMessage","params":[{"name":"message","type":"Message"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessage"},{"id":"-772484260","predicate":"messages.sentMessage","params":[{"name":"id","type":"int"},{"name":"date","type":"int"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.SentMessage"},{"id":"-2125411368","predicate":"messages.chats","params":[{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.Chats"},{"id":"-438840932","predicate":"messages.chatFull","params":[{"name":"full_chat","type":"ChatFull"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"messages.ChatFull"},{"id":"-1210173710","predicate":"messages.affectedHistory","params":[{"name":"pts","type":"int"},{"name":"seq","type":"int"},{"name":"offset","type":"int"}],"type":"messages.AffectedHistory"},{"id":"1474492012","predicate":"inputMessagesFilterEmpty","params":[],"type":"MessagesFilter"},{"id":"-1777752804","predicate":"inputMessagesFilterPhotos","params":[],"type":"MessagesFilter"},{"id":"-1614803355","predicate":"inputMessagesFilterVideo","params":[],"type":"MessagesFilter"},{"id":"1458172132","predicate":"inputMessagesFilterPhotoVideo","params":[],"type":"MessagesFilter"},{"id":"-648121413","predicate":"inputMessagesFilterPhotoVideoDocuments","params":[],"type":"MessagesFilter"},{"id":"-1629621880","predicate":"inputMessagesFilterDocument","params":[],"type":"MessagesFilter"},{"id":"-808946398","predicate":"inputMessagesFilterAudio","params":[],"type":"MessagesFilter"},{"id":"20626867","predicate":"updateNewMessage","params":[{"name":"message","type":"Message"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"1318109142","predicate":"updateMessageID","params":[{"name":"id","type":"int"},{"name":"random_id","type":"long"}],"type":"Update"},{"id":"-966484431","predicate":"updateReadMessages","params":[{"name":"messages","type":"Vector"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"-1456734682","predicate":"updateDeleteMessages","params":[{"name":"messages","type":"Vector"},{"name":"pts","type":"int"}],"type":"Update"},{"id":"1548249383","predicate":"updateUserTyping","params":[{"name":"user_id","type":"int"},{"name":"action","type":"SendMessageAction"}],"type":"Update"},{"id":"-1704596961","predicate":"updateChatUserTyping","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"action","type":"SendMessageAction"}],"type":"Update"},{"id":"125178264","predicate":"updateChatParticipants","params":[{"name":"participants","type":"ChatParticipants"}],"type":"Update"},{"id":"469489699","predicate":"updateUserStatus","params":[{"name":"user_id","type":"int"},{"name":"status","type":"UserStatus"}],"type":"Update"},{"id":"-1489818765","predicate":"updateUserName","params":[{"name":"user_id","type":"int"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"},{"name":"username","type":"string"}],"type":"Update"},{"id":"-1791935732","predicate":"updateUserPhoto","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"photo","type":"UserProfilePhoto"},{"name":"previous","type":"Bool"}],"type":"Update"},{"id":"628472761","predicate":"updateContactRegistered","params":[{"name":"user_id","type":"int"},{"name":"date","type":"int"}],"type":"Update"},{"id":"1369737882","predicate":"updateContactLink","params":[{"name":"user_id","type":"int"},{"name":"my_link","type":"contacts.MyLink"},{"name":"foreign_link","type":"contacts.ForeignLink"}],"type":"Update"},{"id":"-1895411046","predicate":"updateNewAuthorization","params":[{"name":"auth_key_id","type":"long"},{"name":"date","type":"int"},{"name":"device","type":"string"},{"name":"location","type":"string"}],"type":"Update"},{"id":"-1519637954","predicate":"updates.state","params":[{"name":"pts","type":"int"},{"name":"qts","type":"int"},{"name":"date","type":"int"},{"name":"seq","type":"int"},{"name":"unread_count","type":"int"}],"type":"updates.State"},{"id":"1567990072","predicate":"updates.differenceEmpty","params":[{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"updates.Difference"},{"id":"16030880","predicate":"updates.difference","params":[{"name":"new_messages","type":"Vector"},{"name":"new_encrypted_messages","type":"Vector"},{"name":"other_updates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"state","type":"updates.State"}],"type":"updates.Difference"},{"id":"-1459938943","predicate":"updates.differenceSlice","params":[{"name":"new_messages","type":"Vector"},{"name":"new_encrypted_messages","type":"Vector"},{"name":"other_updates","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"intermediate_state","type":"updates.State"}],"type":"updates.Difference"},{"id":"-484987010","predicate":"updatesTooLong","params":[],"type":"Updates"},{"id":"-738961532","predicate":"updateShortMessage","params":[{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"message","type":"string"},{"name":"pts","type":"int"},{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"724548942","predicate":"updateShortChatMessage","params":[{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"chat_id","type":"int"},{"name":"message","type":"string"},{"name":"pts","type":"int"},{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"2027216577","predicate":"updateShort","params":[{"name":"update","type":"Update"},{"name":"date","type":"int"}],"type":"Updates"},{"id":"1918567619","predicate":"updatesCombined","params":[{"name":"updates","type":"Vector"},{"name":"users","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"date","type":"int"},{"name":"seq_start","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"1957577280","predicate":"updates","params":[{"name":"updates","type":"Vector"},{"name":"users","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"date","type":"int"},{"name":"seq","type":"int"}],"type":"Updates"},{"id":"-1916114267","predicate":"photos.photos","params":[{"name":"photos","type":"Vector"},{"name":"users","type":"Vector"}],"type":"photos.Photos"},{"id":"352657236","predicate":"photos.photosSlice","params":[{"name":"count","type":"int"},{"name":"photos","type":"Vector"},{"name":"users","type":"Vector"}],"type":"photos.Photos"},{"id":"539045032","predicate":"photos.photo","params":[{"name":"photo","type":"Photo"},{"name":"users","type":"Vector"}],"type":"photos.Photo"},{"id":"157948117","predicate":"upload.file","params":[{"name":"type","type":"storage.FileType"},{"name":"mtime","type":"int"},{"name":"bytes","type":"bytes"}],"type":"upload.File"},{"id":"784507964","predicate":"dcOption","params":[{"name":"id","type":"int"},{"name":"hostname","type":"string"},{"name":"ip_address","type":"string"},{"name":"port","type":"int"}],"type":"DcOption"},{"id":"777313652","predicate":"config","params":[{"name":"date","type":"int"},{"name":"test_mode","type":"Bool"},{"name":"this_dc","type":"int"},{"name":"dc_options","type":"Vector"},{"name":"chat_size_max","type":"int"},{"name":"broadcast_size_max","type":"int"}],"type":"Config"},{"id":"-1910892683","predicate":"nearestDc","params":[{"name":"country","type":"string"},{"name":"this_dc","type":"int"},{"name":"nearest_dc","type":"int"}],"type":"NearestDc"},{"id":"-1987579119","predicate":"help.appUpdate","params":[{"name":"id","type":"int"},{"name":"critical","type":"Bool"},{"name":"url","type":"string"},{"name":"text","type":"string"}],"type":"help.AppUpdate"},{"id":"-1000708810","predicate":"help.noAppUpdate","params":[],"type":"help.AppUpdate"},{"id":"415997816","predicate":"help.inviteText","params":[{"name":"message","type":"string"}],"type":"help.InviteText"},{"id":"1047852486","predicate":"messages.statedMessagesLinks","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"links","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessages"},{"id":"-1448138623","predicate":"messages.statedMessageLink","params":[{"name":"message","type":"Message"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"links","type":"Vector"},{"name":"pts","type":"int"},{"name":"seq","type":"int"}],"type":"messages.StatedMessage"},{"id":"-371504577","predicate":"messages.sentMessageLink","params":[{"name":"id","type":"int"},{"name":"date","type":"int"},{"name":"pts","type":"int"},{"name":"seq","type":"int"},{"name":"links","type":"Vector"}],"type":"messages.SentMessage"},{"id":"1960072954","predicate":"inputGeoChat","params":[{"name":"chat_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputGeoChat"},{"id":"1301143240","predicate":"inputNotifyGeoChatPeer","params":[{"name":"peer","type":"InputGeoChat"}],"type":"InputNotifyPeer"},{"id":"1978329690","predicate":"geoChat","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"title","type":"string"},{"name":"address","type":"string"},{"name":"venue","type":"string"},{"name":"geo","type":"GeoPoint"},{"name":"photo","type":"ChatPhoto"},{"name":"participants_count","type":"int"},{"name":"date","type":"int"},{"name":"checked_in","type":"Bool"},{"name":"version","type":"int"}],"type":"Chat"},{"id":"1613830811","predicate":"geoChatMessageEmpty","params":[{"name":"chat_id","type":"int"},{"name":"id","type":"int"}],"type":"GeoChatMessage"},{"id":"1158019297","predicate":"geoChatMessage","params":[{"name":"chat_id","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"date","type":"int"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"}],"type":"GeoChatMessage"},{"id":"-749755826","predicate":"geoChatMessageService","params":[{"name":"chat_id","type":"int"},{"name":"id","type":"int"},{"name":"from_id","type":"int"},{"name":"date","type":"int"},{"name":"action","type":"MessageAction"}],"type":"GeoChatMessage"},{"id":"397498251","predicate":"geochats.statedMessage","params":[{"name":"message","type":"GeoChatMessage"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"},{"name":"seq","type":"int"}],"type":"geochats.StatedMessage"},{"id":"1224651367","predicate":"geochats.located","params":[{"name":"results","type":"Vector"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"geochats.Located"},{"id":"-783127119","predicate":"geochats.messages","params":[{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"geochats.Messages"},{"id":"-1135057944","predicate":"geochats.messagesSlice","params":[{"name":"count","type":"int"},{"name":"messages","type":"Vector"},{"name":"chats","type":"Vector"},{"name":"users","type":"Vector"}],"type":"geochats.Messages"},{"id":"1862504124","predicate":"messageActionGeoChatCreate","params":[{"name":"title","type":"string"},{"name":"address","type":"string"}],"type":"MessageAction"},{"id":"209540062","predicate":"messageActionGeoChatCheckin","params":[],"type":"MessageAction"},{"id":"1516823543","predicate":"updateNewGeoChatMessage","params":[{"name":"message","type":"GeoChatMessage"}],"type":"Update"},{"id":"1662091044","predicate":"wallPaperSolid","params":[{"name":"id","type":"int"},{"name":"title","type":"string"},{"name":"bg_color","type":"int"},{"name":"color","type":"int"}],"type":"WallPaper"},{"id":"314359194","predicate":"updateNewEncryptedMessage","params":[{"name":"message","type":"EncryptedMessage"},{"name":"qts","type":"int"}],"type":"Update"},{"id":"386986326","predicate":"updateEncryptedChatTyping","params":[{"name":"chat_id","type":"int"}],"type":"Update"},{"id":"-1264392051","predicate":"updateEncryption","params":[{"name":"chat","type":"EncryptedChat"},{"name":"date","type":"int"}],"type":"Update"},{"id":"956179895","predicate":"updateEncryptedMessagesRead","params":[{"name":"chat_id","type":"int"},{"name":"max_date","type":"int"},{"name":"date","type":"int"}],"type":"Update"},{"id":"-1417756512","predicate":"encryptedChatEmpty","params":[{"name":"id","type":"int"}],"type":"EncryptedChat"},{"id":"1006044124","predicate":"encryptedChatWaiting","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"}],"type":"EncryptedChat"},{"id":"-931638658","predicate":"encryptedChatRequested","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a","type":"bytes"}],"type":"EncryptedChat"},{"id":"-94974410","predicate":"encryptedChat","params":[{"name":"id","type":"int"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"admin_id","type":"int"},{"name":"participant_id","type":"int"},{"name":"g_a_or_b","type":"bytes"},{"name":"key_fingerprint","type":"long"}],"type":"EncryptedChat"},{"id":"332848423","predicate":"encryptedChatDiscarded","params":[{"name":"id","type":"int"}],"type":"EncryptedChat"},{"id":"-247351839","predicate":"inputEncryptedChat","params":[{"name":"chat_id","type":"int"},{"name":"access_hash","type":"long"}],"type":"InputEncryptedChat"},{"id":"-1038136962","predicate":"encryptedFileEmpty","params":[],"type":"EncryptedFile"},{"id":"1248893260","predicate":"encryptedFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"size","type":"int"},{"name":"dc_id","type":"int"},{"name":"key_fingerprint","type":"int"}],"type":"EncryptedFile"},{"id":"406307684","predicate":"inputEncryptedFileEmpty","params":[],"type":"InputEncryptedFile"},{"id":"1690108678","predicate":"inputEncryptedFileUploaded","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"md5_checksum","type":"string"},{"name":"key_fingerprint","type":"int"}],"type":"InputEncryptedFile"},{"id":"1511503333","predicate":"inputEncryptedFile","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputEncryptedFile"},{"id":"-182231723","predicate":"inputEncryptedFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"-317144808","predicate":"encryptedMessage","params":[{"name":"random_id","type":"long"},{"name":"chat_id","type":"int"},{"name":"date","type":"int"},{"name":"bytes","type":"bytes"},{"name":"file","type":"EncryptedFile"}],"type":"EncryptedMessage"},{"id":"594758406","predicate":"encryptedMessageService","params":[{"name":"random_id","type":"long"},{"name":"chat_id","type":"int"},{"name":"date","type":"int"},{"name":"bytes","type":"bytes"}],"type":"EncryptedMessage"},{"id":"-1058912715","predicate":"messages.dhConfigNotModified","params":[{"name":"random","type":"bytes"}],"type":"messages.DhConfig"},{"id":"740433629","predicate":"messages.dhConfig","params":[{"name":"g","type":"int"},{"name":"p","type":"bytes"},{"name":"version","type":"int"},{"name":"random","type":"bytes"}],"type":"messages.DhConfig"},{"id":"1443858741","predicate":"messages.sentEncryptedMessage","params":[{"name":"date","type":"int"}],"type":"messages.SentEncryptedMessage"},{"id":"-1802240206","predicate":"messages.sentEncryptedFile","params":[{"name":"date","type":"int"},{"name":"file","type":"EncryptedFile"}],"type":"messages.SentEncryptedMessage"},{"id":"-95482955","predicate":"inputFileBig","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"name","type":"string"}],"type":"InputFile"},{"id":"767652808","predicate":"inputEncryptedFileBigUploaded","params":[{"name":"id","type":"long"},{"name":"parts","type":"int"},{"name":"key_fingerprint","type":"int"}],"type":"InputEncryptedFile"},{"id":"974056226","predicate":"updateChatParticipantAdd","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"inviter_id","type":"int"},{"name":"version","type":"int"}],"type":"Update"},{"id":"1851755554","predicate":"updateChatParticipantDelete","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"int"},{"name":"version","type":"int"}],"type":"Update"},{"id":"-1906403213","predicate":"updateDcOptions","params":[{"name":"dc_options","type":"Vector"}],"type":"Update"},{"id":"1313442987","predicate":"inputMediaUploadedAudio","params":[{"name":"file","type":"InputFile"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"}],"type":"InputMedia"},{"id":"-1986820223","predicate":"inputMediaAudio","params":[{"name":"id","type":"InputAudio"}],"type":"InputMedia"},{"id":"-1610888","predicate":"inputMediaUploadedDocument","params":[{"name":"file","type":"InputFile"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"}],"type":"InputMedia"},{"id":"1095242886","predicate":"inputMediaUploadedThumbDocument","params":[{"name":"file","type":"InputFile"},{"name":"thumb","type":"InputFile"},{"name":"mime_type","type":"string"},{"name":"attributes","type":"Vector"}],"type":"InputMedia"},{"id":"-779818943","predicate":"inputMediaDocument","params":[{"name":"id","type":"InputDocument"}],"type":"InputMedia"},{"id":"802824708","predicate":"messageMediaDocument","params":[{"name":"document","type":"Document"}],"type":"MessageMedia"},{"id":"-961117440","predicate":"messageMediaAudio","params":[{"name":"audio","type":"Audio"}],"type":"MessageMedia"},{"id":"-648356732","predicate":"inputAudioEmpty","params":[],"type":"InputAudio"},{"id":"2010398975","predicate":"inputAudio","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputAudio"},{"id":"1928391342","predicate":"inputDocumentEmpty","params":[],"type":"InputDocument"},{"id":"410618194","predicate":"inputDocument","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputDocument"},{"id":"1960591437","predicate":"inputAudioFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"1313188841","predicate":"inputDocumentFileLocation","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"}],"type":"InputFileLocation"},{"id":"1483311320","predicate":"audioEmpty","params":[{"name":"id","type":"long"}],"type":"Audio"},{"id":"-945003370","predicate":"audio","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"user_id","type":"int"},{"name":"date","type":"int"},{"name":"duration","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"dc_id","type":"int"}],"type":"Audio"},{"id":"922273905","predicate":"documentEmpty","params":[{"name":"id","type":"long"}],"type":"Document"},{"id":"-106717361","predicate":"document","params":[{"name":"id","type":"long"},{"name":"access_hash","type":"long"},{"name":"date","type":"int"},{"name":"mime_type","type":"string"},{"name":"size","type":"int"},{"name":"thumb","type":"PhotoSize"},{"name":"dc_id","type":"int"},{"name":"attributes","type":"Vector"}],"type":"Document"},{"id":"398898678","predicate":"help.support","params":[{"name":"phone_number","type":"string"},{"name":"user","type":"User"}],"type":"help.Support"},{"id":"-1613493288","predicate":"notifyPeer","params":[{"name":"peer","type":"Peer"}],"type":"NotifyPeer"},{"id":"-1261946036","predicate":"notifyUsers","params":[],"type":"NotifyPeer"},{"id":"-1073230141","predicate":"notifyChats","params":[],"type":"NotifyPeer"},{"id":"1959820384","predicate":"notifyAll","params":[],"type":"NotifyPeer"},{"id":"-2131957734","predicate":"updateUserBlocked","params":[{"name":"user_id","type":"int"},{"name":"blocked","type":"Bool"}],"type":"Update"},{"id":"-1094555409","predicate":"updateNotifySettings","params":[{"name":"peer","type":"NotifyPeer"},{"name":"notify_settings","type":"PeerNotifySettings"}],"type":"Update"},{"id":"-484053553","predicate":"auth.sentAppCode","params":[{"name":"phone_registered","type":"Bool"},{"name":"phone_code_hash","type":"string"},{"name":"send_call_timeout","type":"int"},{"name":"is_password","type":"Bool"}],"type":"auth.SentCode"},{"id":"381645902","predicate":"sendMessageTypingAction","params":[],"type":"SendMessageAction"},{"id":"-44119819","predicate":"sendMessageCancelAction","params":[],"type":"SendMessageAction"},{"id":"-1584933265","predicate":"sendMessageRecordVideoAction","params":[],"type":"SendMessageAction"},{"id":"-1845219337","predicate":"sendMessageUploadVideoAction","params":[],"type":"SendMessageAction"},{"id":"-718310409","predicate":"sendMessageRecordAudioAction","params":[],"type":"SendMessageAction"},{"id":"-424899985","predicate":"sendMessageUploadAudioAction","params":[],"type":"SendMessageAction"},{"id":"-1727382502","predicate":"sendMessageUploadPhotoAction","params":[],"type":"SendMessageAction"},{"id":"-1884362354","predicate":"sendMessageUploadDocumentAction","params":[],"type":"SendMessageAction"},{"id":"393186209","predicate":"sendMessageGeoLocationAction","params":[],"type":"SendMessageAction"},{"id":"1653390447","predicate":"sendMessageChooseContactAction","params":[],"type":"SendMessageAction"},{"id":"-360210539","predicate":"contactFound","params":[{"name":"user_id","type":"int"}],"type":"ContactFound"},{"id":"90570766","predicate":"contacts.found","params":[{"name":"results","type":"Vector"},{"name":"users","type":"Vector"}],"type":"contacts.Found"},{"id":"942527460","predicate":"updateServiceNotification","params":[{"name":"type","type":"string"},{"name":"message","type":"string"},{"name":"media","type":"MessageMedia"},{"name":"popup","type":"Bool"}],"type":"Update"},{"id":"-496024847","predicate":"userStatusRecently","params":[],"type":"UserStatus"},{"id":"129960444","predicate":"userStatusLastWeek","params":[],"type":"UserStatus"},{"id":"2011940674","predicate":"userStatusLastMonth","params":[],"type":"UserStatus"},{"id":"-298113238","predicate":"updatePrivacy","params":[{"name":"key","type":"PrivacyKey"},{"name":"rules","type":"Vector"}],"type":"Update"},{"id":"1335282456","predicate":"inputPrivacyKeyStatusTimestamp","params":[],"type":"InputPrivacyKey"},{"id":"-1137792208","predicate":"privacyKeyStatusTimestamp","params":[],"type":"PrivacyKey"},{"id":"218751099","predicate":"inputPrivacyValueAllowContacts","params":[],"type":"InputPrivacyRule"},{"id":"407582158","predicate":"inputPrivacyValueAllowAll","params":[],"type":"InputPrivacyRule"},{"id":"320652927","predicate":"inputPrivacyValueAllowUsers","params":[{"name":"users","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"195371015","predicate":"inputPrivacyValueDisallowContacts","params":[],"type":"InputPrivacyRule"},{"id":"-697604407","predicate":"inputPrivacyValueDisallowAll","params":[],"type":"InputPrivacyRule"},{"id":"-1877932953","predicate":"inputPrivacyValueDisallowUsers","params":[{"name":"users","type":"Vector"}],"type":"InputPrivacyRule"},{"id":"-123988","predicate":"privacyValueAllowContacts","params":[],"type":"PrivacyRule"},{"id":"1698855810","predicate":"privacyValueAllowAll","params":[],"type":"PrivacyRule"},{"id":"1297858060","predicate":"privacyValueAllowUsers","params":[{"name":"users","type":"Vector"}],"type":"PrivacyRule"},{"id":"-125240806","predicate":"privacyValueDisallowContacts","params":[],"type":"PrivacyRule"},{"id":"-1955338397","predicate":"privacyValueDisallowAll","params":[],"type":"PrivacyRule"},{"id":"209668535","predicate":"privacyValueDisallowUsers","params":[{"name":"users","type":"Vector"}],"type":"PrivacyRule"},{"id":"1430961007","predicate":"account.privacyRules","params":[{"name":"rules","type":"Vector"},{"name":"users","type":"Vector"}],"type":"account.PrivacyRules"},{"id":"-1194283041","predicate":"accountDaysTTL","params":[{"name":"days","type":"int"}],"type":"AccountDaysTTL"},{"id":"-1527411636","predicate":"account.sentChangePhoneCode","params":[{"name":"phone_code_hash","type":"string"},{"name":"send_call_timeout","type":"int"}],"type":"account.SentChangePhoneCode"},{"id":"314130811","predicate":"updateUserPhone","params":[{"name":"user_id","type":"int"},{"name":"phone","type":"string"}],"type":"Update"},{"id":"1467017129","predicate":"account.noPassword","params":[{"name":"new_salt","type":"bytes"}],"type":"account.Password"},{"id":"1939758962","predicate":"account.password","params":[{"name":"current_salt","type":"bytes"},{"name":"new_salt","type":"bytes"},{"name":"hint","type":"string"}],"type":"account.Password"},{"id":"1815593308","predicate":"documentAttributeImageSize","params":[{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute"},{"id":"297109817","predicate":"documentAttributeAnimated","params":[],"type":"DocumentAttribute"},{"id":"-83208409","predicate":"documentAttributeSticker","params":[],"type":"DocumentAttribute"},{"id":"1494273227","predicate":"documentAttributeVideo","params":[{"name":"duration","type":"int"},{"name":"w","type":"int"},{"name":"h","type":"int"}],"type":"DocumentAttribute"},{"id":"85215461","predicate":"documentAttributeAudio","params":[{"name":"duration","type":"int"}],"type":"DocumentAttribute"},{"id":"358154344","predicate":"documentAttributeFilename","params":[{"name":"file_name","type":"string"}],"type":"DocumentAttribute"},{"id":"-244016606","predicate":"messages.stickersNotModified","params":[],"type":"messages.Stickers"},{"id":"-1970352846","predicate":"messages.stickers","params":[{"name":"hash","type":"string"},{"name":"stickers","type":"Vector"}],"type":"messages.Stickers"},{"id":"313694676","predicate":"stickerPack","params":[{"name":"emoticon","type":"string"},{"name":"documents","type":"Vector"}],"type":"StickerPack"},{"id":"-395967805","predicate":"messages.allStickersNotModified","params":[],"type":"messages.AllStickers"},{"id":"-588304126","predicate":"messages.allStickers","params":[{"name":"hash","type":"string"},{"name":"packs","type":"Vector"},{"name":"documents","type":"Vector"}],"type":"messages.AllStickers"}],"methods":[{"id":"-878758099","method":"invokeAfterMsg","params":[{"name":"msg_id","type":"long"},{"name":"query","type":"!X"}],"type":"X"},{"id":"1036301552","method":"invokeAfterMsgs","params":[{"name":"msg_ids","type":"Vector"},{"name":"query","type":"!X"}],"type":"X"},{"id":"1877286395","method":"auth.checkPhone","params":[{"name":"phone_number","type":"string"}],"type":"auth.CheckedPhone"},{"id":"1988976461","method":"auth.sendCode","params":[{"name":"phone_number","type":"string"},{"name":"sms_type","type":"int"},{"name":"api_id","type":"int"},{"name":"api_hash","type":"string"},{"name":"lang_code","type":"string"}],"type":"auth.SentCode"},{"id":"63247716","method":"auth.sendCall","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"}],"type":"Bool"},{"id":"453408308","method":"auth.signUp","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"},{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"auth.Authorization"},{"id":"-1126886015","method":"auth.signIn","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"auth.Authorization"},{"id":"1461180992","method":"auth.logOut","params":[],"type":"Bool"},{"id":"-1616179942","method":"auth.resetAuthorizations","params":[],"type":"Bool"},{"id":"1998331287","method":"auth.sendInvites","params":[{"name":"phone_numbers","type":"Vector"},{"name":"message","type":"string"}],"type":"Bool"},{"id":"-440401971","method":"auth.exportAuthorization","params":[{"name":"dc_id","type":"int"}],"type":"auth.ExportedAuthorization"},{"id":"-470837741","method":"auth.importAuthorization","params":[{"name":"id","type":"int"},{"name":"bytes","type":"bytes"}],"type":"auth.Authorization"},{"id":"-841733627","method":"auth.bindTempAuthKey","params":[{"name":"perm_auth_key_id","type":"long"},{"name":"nonce","type":"long"},{"name":"expires_at","type":"int"},{"name":"encrypted_message","type":"bytes"}],"type":"Bool"},{"id":"1147957548","method":"account.registerDevice","params":[{"name":"token_type","type":"int"},{"name":"token","type":"string"},{"name":"device_model","type":"string"},{"name":"system_version","type":"string"},{"name":"app_version","type":"string"},{"name":"app_sandbox","type":"Bool"},{"name":"lang_code","type":"string"}],"type":"Bool"},{"id":"1707432768","method":"account.unregisterDevice","params":[{"name":"token_type","type":"int"},{"name":"token","type":"string"}],"type":"Bool"},{"id":"-2067899501","method":"account.updateNotifySettings","params":[{"name":"peer","type":"InputNotifyPeer"},{"name":"settings","type":"InputPeerNotifySettings"}],"type":"Bool"},{"id":"313765169","method":"account.getNotifySettings","params":[{"name":"peer","type":"InputNotifyPeer"}],"type":"PeerNotifySettings"},{"id":"-612493497","method":"account.resetNotifySettings","params":[],"type":"Bool"},{"id":"-259486360","method":"account.updateProfile","params":[{"name":"first_name","type":"string"},{"name":"last_name","type":"string"}],"type":"User"},{"id":"1713919532","method":"account.updateStatus","params":[{"name":"offline","type":"Bool"}],"type":"Bool"},{"id":"-1068696894","method":"account.getWallPapers","params":[],"type":"Vector"},{"id":"227648840","method":"users.getUsers","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"-902781519","method":"users.getFullUser","params":[{"name":"id","type":"InputUser"}],"type":"UserFull"},{"id":"-995929106","method":"contacts.getStatuses","params":[],"type":"Vector"},{"id":"583445000","method":"contacts.getContacts","params":[{"name":"hash","type":"string"}],"type":"contacts.Contacts"},{"id":"-634342611","method":"contacts.importContacts","params":[{"name":"contacts","type":"Vector"},{"name":"replace","type":"Bool"}],"type":"contacts.ImportedContacts"},{"id":"-847825880","method":"contacts.getSuggested","params":[{"name":"limit","type":"int"}],"type":"contacts.Suggested"},{"id":"-1902823612","method":"contacts.deleteContact","params":[{"name":"id","type":"InputUser"}],"type":"contacts.Link"},{"id":"1504393374","method":"contacts.deleteContacts","params":[{"name":"id","type":"Vector"}],"type":"Bool"},{"id":"858475004","method":"contacts.block","params":[{"name":"id","type":"InputUser"}],"type":"Bool"},{"id":"-448724803","method":"contacts.unblock","params":[{"name":"id","type":"InputUser"}],"type":"Bool"},{"id":"-176409329","method":"contacts.getBlocked","params":[{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"contacts.Blocked"},{"id":"-2065352905","method":"contacts.exportCard","params":[],"type":"Vector"},{"id":"1340184318","method":"contacts.importCard","params":[{"name":"export_card","type":"Vector"}],"type":"User"},{"id":"1109588596","method":"messages.getMessages","params":[{"name":"id","type":"Vector"}],"type":"messages.Messages"},{"id":"-321970698","method":"messages.getDialogs","params":[{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Dialogs"},{"id":"-1834885329","method":"messages.getHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Messages"},{"id":"132772523","method":"messages.search","params":[{"name":"peer","type":"InputPeer"},{"name":"q","type":"string"},{"name":"filter","type":"MessagesFilter"},{"name":"min_date","type":"int"},{"name":"max_date","type":"int"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"messages.Messages"},{"id":"-287800122","method":"messages.readHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"max_id","type":"int"},{"name":"offset","type":"int"},{"name":"read_contents","type":"Bool"}],"type":"messages.AffectedHistory"},{"id":"-185009311","method":"messages.deleteHistory","params":[{"name":"peer","type":"InputPeer"},{"name":"offset","type":"int"}],"type":"messages.AffectedHistory"},{"id":"351460618","method":"messages.deleteMessages","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"682347368","method":"messages.receivedMessages","params":[{"name":"max_id","type":"int"}],"type":"Vector"},{"id":"-1551737264","method":"messages.setTyping","params":[{"name":"peer","type":"InputPeer"},{"name":"action","type":"SendMessageAction"}],"type":"Bool"},{"id":"1289620139","method":"messages.sendMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"message","type":"string"},{"name":"random_id","type":"long"}],"type":"messages.SentMessage"},{"id":"-1547149962","method":"messages.sendMedia","params":[{"name":"peer","type":"InputPeer"},{"name":"media","type":"InputMedia"},{"name":"random_id","type":"long"}],"type":"messages.StatedMessage"},{"id":"1363988751","method":"messages.forwardMessages","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"Vector"}],"type":"messages.StatedMessages"},{"id":"1013621127","method":"messages.getChats","params":[{"name":"id","type":"Vector"}],"type":"messages.Chats"},{"id":"998448230","method":"messages.getFullChat","params":[{"name":"chat_id","type":"int"}],"type":"messages.ChatFull"},{"id":"-1262720843","method":"messages.editChatTitle","params":[{"name":"chat_id","type":"int"},{"name":"title","type":"string"}],"type":"messages.StatedMessage"},{"id":"-662601187","method":"messages.editChatPhoto","params":[{"name":"chat_id","type":"int"},{"name":"photo","type":"InputChatPhoto"}],"type":"messages.StatedMessage"},{"id":"787082910","method":"messages.addChatUser","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"InputUser"},{"name":"fwd_limit","type":"int"}],"type":"messages.StatedMessage"},{"id":"-1010447069","method":"messages.deleteChatUser","params":[{"name":"chat_id","type":"int"},{"name":"user_id","type":"InputUser"}],"type":"messages.StatedMessage"},{"id":"1100847854","method":"messages.createChat","params":[{"name":"users","type":"Vector"},{"name":"title","type":"string"}],"type":"messages.StatedMessage"},{"id":"-304838614","method":"updates.getState","params":[],"type":"updates.State"},{"id":"168039573","method":"updates.getDifference","params":[{"name":"pts","type":"int"},{"name":"date","type":"int"},{"name":"qts","type":"int"}],"type":"updates.Difference"},{"id":"-285902432","method":"photos.updateProfilePhoto","params":[{"name":"id","type":"InputPhoto"},{"name":"crop","type":"InputPhotoCrop"}],"type":"UserProfilePhoto"},{"id":"-720397176","method":"photos.uploadProfilePhoto","params":[{"name":"file","type":"InputFile"},{"name":"caption","type":"string"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"crop","type":"InputPhotoCrop"}],"type":"photos.Photo"},{"id":"-2016444625","method":"photos.deletePhotos","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"-1291540959","method":"upload.saveFilePart","params":[{"name":"file_id","type":"long"},{"name":"file_part","type":"int"},{"name":"bytes","type":"bytes"}],"type":"Bool"},{"id":"-475607115","method":"upload.getFile","params":[{"name":"location","type":"InputFileLocation"},{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"upload.File"},{"id":"-990308245","method":"help.getConfig","params":[],"type":"Config"},{"id":"531836966","method":"help.getNearestDc","params":[],"type":"NearestDc"},{"id":"-938300290","method":"help.getAppUpdate","params":[{"name":"device_model","type":"string"},{"name":"system_version","type":"string"},{"name":"app_version","type":"string"},{"name":"lang_code","type":"string"}],"type":"help.AppUpdate"},{"id":"1862465352","method":"help.saveAppLog","params":[{"name":"events","type":"Vector"}],"type":"Bool"},{"id":"-1532407418","method":"help.getInviteText","params":[{"name":"lang_code","type":"string"}],"type":"help.InviteText"},{"id":"-1209117380","method":"photos.getUserPhotos","params":[{"name":"user_id","type":"InputUser"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"photos.Photos"},{"id":"66319602","method":"messages.forwardMessage","params":[{"name":"peer","type":"InputPeer"},{"name":"id","type":"int"},{"name":"random_id","type":"long"}],"type":"messages.StatedMessage"},{"id":"1102776690","method":"messages.sendBroadcast","params":[{"name":"contacts","type":"Vector"},{"name":"message","type":"string"},{"name":"media","type":"InputMedia"}],"type":"messages.StatedMessages"},{"id":"2132356495","method":"geochats.getLocated","params":[{"name":"geo_point","type":"InputGeoPoint"},{"name":"radius","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Located"},{"id":"-515735953","method":"geochats.getRecents","params":[{"name":"offset","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Messages"},{"id":"1437853947","method":"geochats.checkin","params":[{"name":"peer","type":"InputGeoChat"}],"type":"geochats.StatedMessage"},{"id":"1730338159","method":"geochats.getFullChat","params":[{"name":"peer","type":"InputGeoChat"}],"type":"messages.ChatFull"},{"id":"1284383347","method":"geochats.editChatTitle","params":[{"name":"peer","type":"InputGeoChat"},{"name":"title","type":"string"},{"name":"address","type":"string"}],"type":"geochats.StatedMessage"},{"id":"903355029","method":"geochats.editChatPhoto","params":[{"name":"peer","type":"InputGeoChat"},{"name":"photo","type":"InputChatPhoto"}],"type":"geochats.StatedMessage"},{"id":"-808598451","method":"geochats.search","params":[{"name":"peer","type":"InputGeoChat"},{"name":"q","type":"string"},{"name":"filter","type":"MessagesFilter"},{"name":"min_date","type":"int"},{"name":"max_date","type":"int"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Messages"},{"id":"-1254131096","method":"geochats.getHistory","params":[{"name":"peer","type":"InputGeoChat"},{"name":"offset","type":"int"},{"name":"max_id","type":"int"},{"name":"limit","type":"int"}],"type":"geochats.Messages"},{"id":"146319145","method":"geochats.setTyping","params":[{"name":"peer","type":"InputGeoChat"},{"name":"typing","type":"Bool"}],"type":"Bool"},{"id":"102432836","method":"geochats.sendMessage","params":[{"name":"peer","type":"InputGeoChat"},{"name":"message","type":"string"},{"name":"random_id","type":"long"}],"type":"geochats.StatedMessage"},{"id":"-1192173825","method":"geochats.sendMedia","params":[{"name":"peer","type":"InputGeoChat"},{"name":"media","type":"InputMedia"},{"name":"random_id","type":"long"}],"type":"geochats.StatedMessage"},{"id":"235482646","method":"geochats.createGeoChat","params":[{"name":"title","type":"string"},{"name":"geo_point","type":"InputGeoPoint"},{"name":"address","type":"string"},{"name":"venue","type":"string"}],"type":"geochats.StatedMessage"},{"id":"651135312","method":"messages.getDhConfig","params":[{"name":"version","type":"int"},{"name":"random_length","type":"int"}],"type":"messages.DhConfig"},{"id":"-162681021","method":"messages.requestEncryption","params":[{"name":"user_id","type":"InputUser"},{"name":"random_id","type":"int"},{"name":"g_a","type":"bytes"}],"type":"EncryptedChat"},{"id":"1035731989","method":"messages.acceptEncryption","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"g_b","type":"bytes"},{"name":"key_fingerprint","type":"long"}],"type":"EncryptedChat"},{"id":"-304536635","method":"messages.discardEncryption","params":[{"name":"chat_id","type":"int"}],"type":"Bool"},{"id":"2031374829","method":"messages.setEncryptedTyping","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"typing","type":"Bool"}],"type":"Bool"},{"id":"2135648522","method":"messages.readEncryptedHistory","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"max_date","type":"int"}],"type":"Bool"},{"id":"-1451792525","method":"messages.sendEncrypted","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"}],"type":"messages.SentEncryptedMessage"},{"id":"-1701831834","method":"messages.sendEncryptedFile","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"},{"name":"file","type":"InputEncryptedFile"}],"type":"messages.SentEncryptedMessage"},{"id":"852769188","method":"messages.sendEncryptedService","params":[{"name":"peer","type":"InputEncryptedChat"},{"name":"random_id","type":"long"},{"name":"data","type":"bytes"}],"type":"messages.SentEncryptedMessage"},{"id":"1436924774","method":"messages.receivedQueue","params":[{"name":"max_qts","type":"int"}],"type":"Vector"},{"id":"-562337987","method":"upload.saveBigFilePart","params":[{"name":"file_id","type":"long"},{"name":"file_part","type":"int"},{"name":"file_total_parts","type":"int"},{"name":"bytes","type":"bytes"}],"type":"Bool"},{"id":"1769565673","method":"initConnection","params":[{"name":"api_id","type":"int"},{"name":"device_model","type":"string"},{"name":"system_version","type":"string"},{"name":"app_version","type":"string"},{"name":"lang_code","type":"string"},{"name":"query","type":"!X"}],"type":"X"},{"id":"-1663104819","method":"help.getSupport","params":[],"type":"help.Support"},{"id":"229241832","method":"auth.sendSms","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"}],"type":"Bool"},{"id":"894131138","method":"messages.readMessageContents","params":[{"name":"id","type":"Vector"}],"type":"Vector"},{"id":"655677548","method":"account.checkUsername","params":[{"name":"username","type":"string"}],"type":"Bool"},{"id":"1040964988","method":"account.updateUsername","params":[{"name":"username","type":"string"}],"type":"User"},{"id":"301470424","method":"contacts.search","params":[{"name":"q","type":"string"},{"name":"limit","type":"int"}],"type":"contacts.Found"},{"id":"-623130288","method":"account.getPrivacy","params":[{"name":"key","type":"InputPrivacyKey"}],"type":"account.PrivacyRules"},{"id":"-906486552","method":"account.setPrivacy","params":[{"name":"key","type":"InputPrivacyKey"},{"name":"rules","type":"Vector"}],"type":"account.PrivacyRules"},{"id":"1099779595","method":"account.deleteAccount","params":[{"name":"reason","type":"string"}],"type":"Bool"},{"id":"150761757","method":"account.getAccountTTL","params":[],"type":"AccountDaysTTL"},{"id":"608323678","method":"account.setAccountTTL","params":[{"name":"ttl","type":"AccountDaysTTL"}],"type":"Bool"},{"id":"-627372787","method":"invokeWithLayer","params":[{"name":"layer","type":"int"},{"name":"query","type":"!X"}],"type":"X"},{"id":"200282908","method":"contacts.resolveUsername","params":[{"name":"username","type":"string"}],"type":"User"},{"id":"-1543001868","method":"account.sendChangePhoneCode","params":[{"name":"phone_number","type":"string"}],"type":"account.SentChangePhoneCode"},{"id":"1891839707","method":"account.changePhone","params":[{"name":"phone_number","type":"string"},{"name":"phone_code_hash","type":"string"},{"name":"phone_code","type":"string"}],"type":"User"},{"id":"1418342645","method":"account.getPassword","params":[],"type":"account.Password"},{"id":"-584430193","method":"account.setPassword","params":[{"name":"current_password_hash","type":"bytes"},{"name":"new_salt","type":"bytes"},{"name":"new_password_hash","type":"bytes"},{"name":"hint","type":"string"}],"type":"Bool"},{"id":"174260510","method":"auth.checkPassword","params":[{"name":"password_hash","type":"bytes"}],"type":"auth.Authorization"},{"id":"-1373446075","method":"messages.getStickers","params":[{"name":"emoticon","type":"string"},{"name":"hash","type":"string"}],"type":"messages.Stickers"},{"id":"-1438922648","method":"messages.getAllStickers","params":[{"name":"hash","type":"string"}],"type":"messages.AllStickers"}]}; Config.Schema.API.layer = 22; diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index 5882ebe1..f26139ac 100644 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -734,104 +734,6 @@ angular.module('izhukov.utils', []) }; }) -.service('SearchIndexManager', function () { - var badCharsRe = /[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<\s]+/g, - trimRe = /^\s+|\s$/g; - - return { - createIndex: createIndex, - indexObject: indexObject, - cleanSearchText: cleanSearchText, - search: search - }; - - function createIndex () { - return { - shortIndexes: {}, - fullTexts: {} - } - } - - function cleanSearchText (text) { - text = text.replace(badCharsRe, ' ').replace(trimRe, ''); - text = text.replace(/[^A-Za-z0-9]/g, function (ch) { - return Config.LatinizeMap[ch] || ch; - }); - text = text.toLowerCase(); - - return text; - } - - function indexObject (id, searchText, searchIndex) { - if (searchIndex.fullTexts[id] !== undefined) { - return false; - } - - searchText = cleanSearchText(searchText); - - if (!searchText.length) { - return false; - } - - var shortIndexes = searchIndex.shortIndexes; - - searchIndex.fullTexts[id] = searchText; - - angular.forEach(searchText.split(' '), function(searchWord) { - var len = Math.min(searchWord.length, 3), - wordPart, i; - for (i = 1; i <= len; i++) { - wordPart = searchWord.substr(0, i); - if (shortIndexes[wordPart] === undefined) { - shortIndexes[wordPart] = [id]; - } else { - shortIndexes[wordPart].push(id); - } - } - }); - } - - function search (query, searchIndex) { - var shortIndexes = searchIndex.shortIndexes, - fullTexts = searchIndex.fullTexts; - - query = cleanSearchText(query); - - var queryWords = query.split(' '), - foundObjs = false, - newFoundObjs, i, j, searchText, found; - - for (i = 0; i < queryWords.length; i++) { - newFoundObjs = shortIndexes[queryWords[i].substr(0, 3)]; - if (!newFoundObjs) { - foundObjs = []; - break; - } - if (foundObjs === false || foundObjs.length > newFoundObjs.length) { - foundObjs = newFoundObjs; - } - } - - newFoundObjs = {}; - - for (j = 0; j < foundObjs.length; j++) { - found = true; - searchText = fullTexts[foundObjs[j]]; - for (i = 0; i < queryWords.length; i++) { - if (searchText.indexOf(queryWords[i]) == -1) { - found = false; - break; - } - } - if (found) { - newFoundObjs[foundObjs[j]] = true; - } - } - - return newFoundObjs; - } -}) - .service('ExternalResourcesManager', function ($q, $http) { var urlPromises = {}; diff --git a/app/js/lib/schema.tl.txt b/app/js/lib/schema.tl.txt index 385b6c2c..08ee5c35 100644 --- a/app/js/lib/schema.tl.txt +++ b/app/js/lib/schema.tl.txt @@ -156,8 +156,6 @@ peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents; peerNotifySettingsEmpty#70a68512 = PeerNotifySettings; peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings; -globalPrivacySettings#40f5c53a no_suggestions:Bool hide_contacts:Bool hide_located:Bool hide_last_visit:Bool = GlobalPrivacySettings; - wallPaper#ccb03657 id:int title:string sizes:Vector color:int = WallPaper; userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull; @@ -209,8 +207,6 @@ messages.statedMessage#d07ae726 message:Message chats:Vector users:Vector< messages.sentMessage#d1f4d35c id:int date:int pts:int seq:int = messages.SentMessage; -messages.chat#40e9002a chat:Chat users:Vector = messages.Chat; - messages.chats#8150cbd8 chats:Vector users:Vector = messages.Chats; messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull; @@ -221,6 +217,7 @@ inputMessagesFilterEmpty#57e2f66c = MessagesFilter; inputMessagesFilterPhotos#9609a51c = MessagesFilter; inputMessagesFilterVideo#9fc00e65 = MessagesFilter; inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter; +inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter; inputMessagesFilterDocument#9eddf188 = MessagesFilter; inputMessagesFilterAudio#cfc87522 = MessagesFilter; @@ -228,7 +225,6 @@ updateNewMessage#13abdb3 message:Message pts:int = Update; updateMessageID#4e90bfd6 id:int random_id:long = Update; updateReadMessages#c6649e31 messages:Vector pts:int = Update; updateDeleteMessages#a92bfe26 messages:Vector pts:int = Update; -updateRestoreMessages#d15de04d messages:Vector pts:int = Update; updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update; updateChatUserTyping#9a65ea1f chat_id:int user_id:int action:SendMessageAction = Update; updateChatParticipants#7761198 participants:ChatParticipants = Update; @@ -237,7 +233,6 @@ updateUserName#a7332b73 user_id:int first_name:string last_name:string username: updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update; updateContactRegistered#2575bbb9 user_id:int date:int = Update; updateContactLink#51a48a9a user_id:int my_link:contacts.MyLink foreign_link:contacts.ForeignLink = Update; -updateActivation#6f690963 user_id:int = Update; updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -438,6 +433,11 @@ documentAttributeFilename#15590068 file_name:string = DocumentAttribute; messages.stickersNotModified#f1749a22 = messages.Stickers; messages.stickers#8a8ecd32 hash:string stickers:Vector = messages.Stickers; +stickerPack#12b299d4 emoticon:string documents:Vector = StickerPack; + +messages.allStickersNotModified#e86602c3 = messages.AllStickers; +messages.allStickers#dcef3102 hash:string packs:Vector documents:Vector = messages.AllStickers; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -487,7 +487,6 @@ messages.search#7e9f2ab peer:InputPeer q:string filter:MessagesFilter min_date:i messages.readHistory#eed884c6 peer:InputPeer max_id:int offset:int read_contents:Bool = messages.AffectedHistory; messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory; messages.deleteMessages#14f2dd0a id:Vector = Vector; -messages.restoreMessages#395f9d7e id:Vector = Vector; messages.receivedMessages#28abcb68 max_id:int = Vector; messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool; messages.sendMessage#4cde0aab peer:InputPeer message:string random_id:long = messages.SentMessage; @@ -578,4 +577,5 @@ account.setPassword#dd2a4d8f current_password_hash:bytes new_salt:bytes new_pass auth.checkPassword#a63011e password_hash:bytes = auth.Authorization; -messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers; \ No newline at end of file +messages.getStickers#ae22e045 emoticon:string hash:string = messages.Stickers; +messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers; \ No newline at end of file diff --git a/app/js/lib/utils.js b/app/js/lib/utils.js index f7b2f77d..8d2f66a1 100644 --- a/app/js/lib/utils.js +++ b/app/js/lib/utils.js @@ -58,9 +58,173 @@ function onCtrlEnter (textarea, cb) { }); } +function setFieldSelection(field, from, to) { + field = $(field)[0]; + try { + field.focus(); + if (from === undefined || from === false) { + from = field.value.length; + } + if (to === undefined || to === false) { + to = from; + } + if (field.createTextRange) { + var range = field.createTextRange(); + range.collapse(true); + range.moveEnd('character', to); + range.moveStart('character', from); + range.select(); + } + else if (field.setSelectionRange) { + field.setSelectionRange(from, to); + } + } catch(e) {} +} + +function getFieldSelection (field) { + if (field.selectionStart) { + return field.selectionStart; + } + else if (!document.selection) { + return 0; + } + + var c = "\001", + sel = document.selection.createRange(), + txt = sel.text, + dup = sel.duplicate(), + len = 0; + + try { + dup.moveToElementText(field); + } catch(e) { + return 0; + } + + sel.text = txt + c; + len = dup.text.indexOf(c); + sel.moveStart('character', -1); + sel.text = ''; + + // if (browser.msie && len == -1) { + // return field.value.length; + // } + return len; +} + +function getRichValue(field) { + if (!field) { + return ''; + } + var lines = []; + var line = []; + + getRichElementValue(field, lines, line); + if (line.length) { + lines.push(line.join('')); + } + + return lines.join('\n'); +} + +function getRichValueWithCaret(field) { + if (!field) { + return []; + } + var lines = []; + var line = []; + + var sel = window.getSelection ? window.getSelection() : false; + var selNode, selOffset; + if (sel && sel.rangeCount) { + var range = sel.getRangeAt(0); + if (range.startContainer && + range.startContainer == range.endContainer && + range.startOffset == range.endOffset) { + selNode = range.startContainer; + selOffset = range.startOffset; + } + } + + getRichElementValue(field, lines, line, selNode, selOffset); + + if (line.length) { + lines.push(line.join('')); + } + + var value = lines.join('\n'); + var caretPos = value.indexOf('\001'); + if (caretPos != -1) { + value = value.substr(0, caretPos) + value.substr(caretPos + 1); + } + + return [value, caretPos]; +} + +function getRichElementValue(node, lines, line, selNode, selOffset) { + if (node.nodeType == 3) { // TEXT + if (selNode === node) { + var value = node.nodeValue; + line.push(value.substr(0, selOffset) + '\001' + value.substr(selOffset)); + } else { + line.push(node.nodeValue); + } + return; + } + if (node.nodeType != 1) { // NON-ELEMENT + return; + } + var isBlock = node.tagName == 'DIV' || node.tagName == 'P'; + var curChild; + if (isBlock && line.length || node.tagName == 'BR') { + lines.push(line.join('')); + line.splice(0, line.length); + } + else if (node.tagName == 'IMG') { + if (node.alt) { + line.push(node.alt); + } + } + if (selNode === node) { + line.push('\001'); + } + var curChild = node.firstChild; + while (curChild) { + getRichElementValue(curChild, lines, line, selNode, selOffset); + curChild = curChild.nextSibling; + } + if (isBlock && line.length) { + lines.push(line.join('')); + line.splice(0, line.length); + } +} + +function setRichFocus(field, selectNode) { + field.focus(); + if (window.getSelection && document.createRange) { + var range = document.createRange(); + if (selectNode) { + range.selectNode(selectNode); + } else { + range.selectNodeContents(field); + } + range.collapse(false); + + var sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + } + else if (document.body.createTextRange !== undefined) { + var textRange = document.body.createTextRange(); + textRange.moveToElementText(selectNode || field); + textRange.collapse(false); + textRange.select(); + } +} + function onContentLoaded (cb) { - setTimeout(cb, 0); -}; + setZeroTimeout(cb); +} function tsNow (seconds) { var t = +new Date() + (window.tsOffset || 0); @@ -153,27 +317,129 @@ function calcImageInBox(imageW, imageH, boxW, boxH, noZooom) { } function versionCompare (ver1, ver2) { - if (typeof ver1 !== 'string') { - ver1 = ''; + if (typeof ver1 !== 'string') { + ver1 = ''; + } + if (typeof ver2 !== 'string') { + ver2 = ''; + } + ver1 = ver1.replace(/^\s+|\s+$/g, '').split('.'); + ver2 = ver2.replace(/^\s+|\s+$/g, '').split('.'); + + var a = Math.max(ver1.length, ver2.length), i; + + for (i = 0; i < a; i++) { + if (ver1[i] == ver2[i]) { + continue; } - if (typeof ver2 !== 'string') { - ver2 = ''; + if (ver1[i] > ver2[i]) { + return 1; + } else { + return -1; } - ver1 = ver1.replace(/^\s+|\s+$/g, '').split('.'); - ver2 = ver2.replace(/^\s+|\s+$/g, '').split('.'); + } + + return 0; +} + + +(function (global) { + + var badCharsRe = /[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<\s]+/g, + trimRe = /^\s+|\s$/g; - var a = Math.max(ver1.length, ver2.length), i; + function createIndex () { + return { + shortIndexes: {}, + fullTexts: {} + } + } + + function cleanSearchText (text) { + text = text.replace(badCharsRe, ' ').replace(trimRe, ''); + text = text.replace(/[^A-Za-z0-9]/g, function (ch) { + return Config.LatinizeMap[ch] || ch; + }); + text = text.toLowerCase(); + + return text; + } - for (i = 0; i < a; i++) { - if (ver1[i] == ver2[i]) { - continue; + function indexObject (id, searchText, searchIndex) { + if (searchIndex.fullTexts[id] !== undefined) { + return false; + } + + searchText = cleanSearchText(searchText); + + if (!searchText.length) { + return false; + } + + var shortIndexes = searchIndex.shortIndexes; + + searchIndex.fullTexts[id] = searchText; + + angular.forEach(searchText.split(' '), function(searchWord) { + var len = Math.min(searchWord.length, 3), + wordPart, i; + for (i = 1; i <= len; i++) { + wordPart = searchWord.substr(0, i); + if (shortIndexes[wordPart] === undefined) { + shortIndexes[wordPart] = [id]; + } else { + shortIndexes[wordPart].push(id); + } + } + }); + } + + function search (query, searchIndex) { + var shortIndexes = searchIndex.shortIndexes, + fullTexts = searchIndex.fullTexts; + + query = cleanSearchText(query); + + var queryWords = query.split(' '), + foundObjs = false, + newFoundObjs, i, j, searchText, found; + + for (i = 0; i < queryWords.length; i++) { + newFoundObjs = shortIndexes[queryWords[i].substr(0, 3)]; + if (!newFoundObjs) { + foundObjs = []; + break; } - if (ver1[i] > ver2[i]) { - return 1; - } else { - return -1; + if (foundObjs === false || foundObjs.length > newFoundObjs.length) { + foundObjs = newFoundObjs; } } - return 0; + newFoundObjs = {}; + + for (j = 0; j < foundObjs.length; j++) { + found = true; + searchText = fullTexts[foundObjs[j]]; + for (i = 0; i < queryWords.length; i++) { + if (searchText.indexOf(queryWords[i]) == -1) { + found = false; + break; + } + } + if (found) { + newFoundObjs[foundObjs[j]] = true; + } + } + + return newFoundObjs; } + + global.SearchIndexManager = { + createIndex: createIndex, + indexObject: indexObject, + cleanSearchText: cleanSearchText, + search: search + }; + +})(window); + diff --git a/app/js/message_composer.js b/app/js/message_composer.js new file mode 100644 index 00000000..4929e64b --- /dev/null +++ b/app/js/message_composer.js @@ -0,0 +1,855 @@ +/*! + * Webogram v0.3.9 - messaging web application for MTProto + * https://github.com/zhukov/webogram + * Copyright (C) 2014 Igor Zhukov + * https://github.com/zhukov/webogram/blob/master/LICENSE + */ + +'use strict'; + +/* EmojiHelper */ + +(function (global, emojis, categories, spritesheets) { + + + var emojis = {}; + var shortcuts = {}; + var spritesheetPositions = {}; + var index = false; + + var popular = 'joy,kissing_heart,heart,heart_eyes,blush,grin,+1,relaxed,pensive,smile,sob,kiss,unamused,flushed,stuck_out_tongue_winking_eye,see_no_evil,wink,smiley,cry,stuck_out_tongue_closed_eyes,scream,rage,smirk,disappointed,sweat_smile,kissing_closed_eyes,speak_no_evil,relieved,grinning,yum,laughing,ok_hand,neutral_face,confused'.split(','); + + var i, j, code, shortcut, emoji, row, column, totalColumns; + var len1, len2; + + for (i = 0, len1 = categories.length; i < len1; i++) { + totalColumns = spritesheets[i][1]; + for (j = 0, len2 = categories[i].length; j < len2; j++) { + code = categories[i][j]; + emoji = Config.Emoji[code]; + shortcut = emoji[1][0]; + emojis[code] = [emoji[0], shortcut]; + shortcuts[shortcut] = code; + spritesheetPositions[code] = [i, j, Math.floor(j / totalColumns), j % totalColumns]; + } + } + + function getPopularEmoji (callback) { + ConfigStorage.get('emojis_popular', function (popEmojis) { + var result = []; + if (popEmojis && popEmojis.length) { + for (var i = 0, len = popEmojis.length; i < len; i++) { + result.push({code: popEmojis[i][0], rate: popEmojis[i][1]}); + } + callback(result); + return; + }; + ConfigStorage.get('emojis_recent', function (recentEmojis) { + recentEmojis = recentEmojis || popular || []; + var shortcut, code; + for (var i = 0, len = recentEmojis.length; i < len; i++) { + shortcut = recentEmojis[i]; + if (Array.isArray(shortcut)) { + shortcut = shortcut[0]; + } + if (shortcut.charAt(0) == ':') { + shortcut = shortcut.substr(1, shortcut.length - 2); + } + if (code = shortcuts[shortcut]) { + result.push({code: code, rate: 1}); + } + } + callback(result); + }); + }); + } + + function pushPopularEmoji (code) { + getPopularEmoji(function (popularEmoji) { + var exists = false; + var count = popularEmoji.length; + var result = []; + for (var i = 0; i < count; i++) { + if (popularEmoji[i].code == code) { + exists = true; + popularEmoji[i].rate++; + } + result.push([popularEmoji[i].code, popularEmoji[i].rate]); + } + if (exists) { + result.sort(function (a, b) { + return b[1] - a[1]; + }); + } else { + if (result.length > 41) { + result = result.slice(0, 41); + } + result.push([code, 1]); + } + ConfigStorage.set({emojis_popular: result}); + }); + } + + function indexEmojis () { + if (index === false) { + index = SearchIndexManager.createIndex(); + var shortcut; + for (shortcut in shortcuts) { + if (shortcuts.hasOwnProperty(shortcut)) { + SearchIndexManager.indexObject(shortcuts[shortcut], shortcut, index); + } + } + } + } + + function searchEmojis (q) { + indexEmojis(); + var foundObject = SearchIndexManager.search(q, index); + var foundCodes = []; + var code; + for (code in foundObject) { + if (foundObject.hasOwnProperty(code)) { + foundCodes.push(code); + } + } + return foundCodes; + } + + global.EmojiHelper = { + emojis: emojis, + shortcuts: shortcuts, + spritesheetPositions: spritesheetPositions, + getPopularEmoji: getPopularEmoji, + pushPopularEmoji: pushPopularEmoji, + indexEmojis: indexEmojis, + searchEmojis: searchEmojis + }; + +})(window, Config.Emoji, Config.EmojiCategories, Config.EmojiCategorySpritesheetDimens); + + +function EmojiTooltip (btnEl, options) { + options = options || {}; + var self = this; + + this.btnEl = $(btnEl); + this.onEmojiSelected = options.onEmojiSelected; + this.onStickerSelected = options.onStickerSelected; + this.getStickers = options.getStickers; + + $(this.btnEl).on('mouseenter mouseleave', function (e) { + self.isOverBtn = e.type == 'mouseenter'; + self.createTooltip(); + + if (self.isOverBtn) { + self.onMouseEnter(true); + } else { + self.onMouseLeave(true); + } + }); + $(this.btnEl).on('mousedown', function (e) { + if (!self.shown) { + clearTimeout(self.showTimeout); + delete self.showTimeout; + self.show(); + } else { + clearTimeout(self.hideTimeout); + delete self.hideTimeout; + self.hide(); + } + }); +} + +EmojiTooltip.prototype.onMouseEnter = function (triggerShow) { + if (this.hideTimeout) { + clearTimeout(this.hideTimeout); + delete this.hideTimeout; + } + else if (triggerShow && !this.showTimeout) { + this.showTimeout = setTimeout(this.show.bind(this), 500); + } +}; + +EmojiTooltip.prototype.onMouseLeave = function (triggerUnshow) { + if (!this.hideTimeout) { + var self = this; + this.hideTimeout = setTimeout(function () { + self.hide(); + }, 500); + } + else if (triggerUnshow && this.showTimeout) { + clearTimeout(this.showTimeout); + delete this.showTimeout; + } +}; + + + +EmojiTooltip.prototype.createTooltip = function () { + if (this.tooltipEl) { + return false; + } + + var self = this; + this.tooltipEl = $('
').appendTo(document.body); + + this.tabsEl = $('.composer_emoji_tooltip_tabs', this.tooltip); + this.contentWrapEl = $('.composer_emoji_tooltip_content_wrap', this.tooltip); + this.contentEl = $('.composer_emoji_tooltip_content', this.tooltip); + this.footerEl = $('.composer_emoji_tooltip_footer', this.tooltip); + this.settingsEl = $('.composer_emoji_tooltip_settings', this.tooltip); + + angular.forEach(['recent', 'smile', 'flower', 'bell', 'car', 'grid', 'stickers'], function (tabName, tabIndex) { + $('') + .on('mousedown', function (e) { + self.selectTab(tabIndex); + return cancelEvent(e); + }) + .on('mouseenter mouseleave', function (e) { + clearTimeout(self.selectTabTimeout); + if (e.type == 'mouseenter') { + self.selectTabTimeout = setTimeout(function () { + self.selectTab(tabIndex); + }, 300); + } + }) + .appendTo(self.tabsEl); + }); + + if (!Config.Mobile) { + this.contentWrapEl.nanoScroller({preventPageScrolling: true, tabIndex: -1}); + } + + this.contentEl.on('mousedown', function (e) { + e = e.originalEvent || e; + var target = $(e.target), code, sticker; + if (target.hasClass('emoji') || target.hasClass('composer_sticker_image')) { + target = $(target[0].parentNode); + } + if (code = target.attr('data-code')) { + if (self.onEmojiSelected) { + self.onEmojiSelected(code); + } + EmojiHelper.pushPopularEmoji(code); + } + if (sticker = target.attr('data-sticker')) { + if (self.onStickerSelected) { + self.onStickerSelected(sticker); + } + } + return cancelEvent(e); + }); + + this.tooltipEl.on('mouseenter mouseleave', function (e) { + if (e.type == 'mouseenter') { + self.onMouseEnter(); + } else { + self.onMouseLeave(); + } + }); + + this.selectTab(0); + + return true; +} + + +EmojiTooltip.prototype.selectTab = function (tab) { + if (this.tab === tab) { + return false; + } + $('.active', this.tabsEl).removeClass('active'); + this.tab = tab; + $(this.tabsEl[0].childNodes[tab]).addClass('active'); + + this.updateTabContents(); +}; + +EmojiTooltip.prototype.updateTabContents = function (tab) { + var html = []; + var self = this; + var iconSize = Config.Mobile ? 26 : 20; + + var renderContent = function () { + self.contentEl.html(html.join('')); + + if (!Config.Mobile) { + setTimeout(function () { + self.contentWrapEl.nanoScroller(); + }, 100); + } + } + + if (this.tab == 6) { // Stickers + var renderStickers = function (stickers) { + var sticker, i; + var count = stickers.length; + for (i = 0; i < count; i++) { + sticker = stickers[i]; + html.push(''); + } + renderContent(); + }; + this.getStickers(renderStickers); + } + else if (this.tab > 0) { + var categoryIndex = this.tab - 1; + var emoticonCodes = Config.EmojiCategories[categoryIndex]; + var totalColumns = Config.EmojiCategorySpritesheetDimens[categoryIndex][1]; + var count = emoticonCodes.length; + var emoticonCode, emoticonData, i, x, y; + + for (i = 0; i < count; i++) { + emoticonCode = emoticonCodes[i]; + emoticonData = Config.Emoji[emoticonCode]; + x = iconSize * (i % totalColumns); + y = iconSize * Math.floor(i / totalColumns); + html.push(''); + } + renderContent(); + } + else { + EmojiHelper.getPopularEmoji(function (popularEmoji) { + var emoticonCode, emoticonData, spritesheet, pos, categoryIndex; + var count = popularEmoji.length; + var i, x, y; + + for (i = 0; i < count; i++) { + emoticonCode = popularEmoji[i].code; + if (emoticonData = Config.Emoji[emoticonCode]) { + spritesheet = EmojiHelper.spritesheetPositions[emoticonCode]; + categoryIndex = spritesheet[0]; + pos = spritesheet[1]; + x = iconSize * spritesheet[3]; + y = iconSize * spritesheet[2]; + html.push(''); + } + } + renderContent(); + }); + } +}; + +EmojiTooltip.prototype.updatePosition = function () { + var offset = this.btnEl.offset(); + this.tooltipEl.css({top: offset.top, left: offset.left}); +}; + +EmojiTooltip.prototype.show = function () { + this.updatePosition(); + this.tooltipEl.addClass('composer_emoji_tooltip_shown'); + this.btnEl.addClass('composer_emoji_insert_btn_on'); + delete this.showTimeout; + this.shown = true; +}; + +EmojiTooltip.prototype.hide = function () { + this.tooltipEl.removeClass('composer_emoji_tooltip_shown'); + this.btnEl.removeClass('composer_emoji_insert_btn_on'); + delete this.hideTimeout; + delete this.shown; +}; + + + + +function EmojiPanel (containerEl, options) { + options = options || {}; + var self = this; + + this.containerEl = $(containerEl); + this.onEmojiSelected = options.onEmojiSelected; + + this.containerEl.on('mousedown', function (e) { + e = e.originalEvent || e; + var target = $(e.target), code; + if (target.hasClass('emoji')) { + target = $(target[0].parentNode); + } + if (code = target.attr('data-code')) { + if (self.onEmojiSelected) { + self.onEmojiSelected(code); + } + EmojiHelper.pushPopularEmoji(code); + } + return cancelEvent(e); + }); + + this.update(); +} + +EmojiPanel.prototype.update = function () { + var html = []; + var self = this; + var iconSize = Config.Mobile ? 26 : 20; + + EmojiHelper.getPopularEmoji(function (popularEmoji) { + var emoticonCode, emoticonData, spritesheet, pos, categoryIndex; + var count = popularEmoji.length; + var i, x, y; + + for (i = 0; i < count; i++) { + emoticonCode = popularEmoji[i].code; + if (emoticonData = Config.Emoji[emoticonCode]) { + spritesheet = EmojiHelper.spritesheetPositions[emoticonCode]; + categoryIndex = spritesheet[0]; + pos = spritesheet[1]; + x = iconSize * spritesheet[3]; + y = iconSize * spritesheet[2]; + html.push(''); + } + } + self.containerEl.html(html.join('')); + }); +} + + + + + +function MessageComposer (textarea, options) { + this.textareaEl = $(textarea); + + this.setUpInput(); + + this.autoCompleteEl = $('').appendTo(document.body); + + var self = this; + this.autoCompleteEl.on('mousedown', function (e) { + e = e.originalEvent || e; + var target = $(e.target), code; + if (target.hasClass('emoji') || target.hasClass('composer_emoji_shortcut')) { + target = $(target[0].parentNode); + } + if (code = target.attr('data-code')) { + if (self.onEmojiSelected) { + self.onEmojiSelected(code, true); + } + EmojiHelper.pushPopularEmoji(code); + } + return cancelEvent(e); + }); + + this.isActive = false; + + this.onTyping = options.onTyping; + this.onMessageSubmit = options.onMessageSubmit; + this.getSendOnEnter = options.getSendOnEnter; +} + +MessageComposer.prototype.setUpInput = function () { + if ('contentEditable' in document.body) { + this.setUpRich(); + } else { + this.setUpPlaintext(); + } +} + +MessageComposer.prototype.setUpRich = function () { + this.textareaEl.hide(); + this.richTextareaEl = $('
'); + + this.textareaEl[0].parentNode.insertBefore(this.richTextareaEl[0], this.textareaEl[0]); + + this.richTextareaEl.on('keyup keydown', this.onKeyEvent.bind(this)); + this.richTextareaEl.on('focus blur', this.onFocusBlur.bind(this)); + this.richTextareaEl.on('paste', this.onRichPaste.bind(this)); + this.richTextareaEl.on('DOMNodeInserted', this.onRichPasteNode.bind(this)); + + $(document.body).on('keydown', this.backupSelection.bind(this)); +} + +MessageComposer.prototype.setUpPlaintext = function () { + this.textareaEl.on('keyup keydown', this.onKeyEvent.bind(this)); + this.textareaEl.on('focus blur', this.onFocusBlur.bind(this)); +} + +MessageComposer.prototype.onKeyEvent = function (e) { + var self = this; + if (e.type == 'keyup') { + this.checkAutocomplete(); + + if (this.onTyping) { + var now = tsNow(); + if (now - this.lastTyping > 5000) { + var length = (this.richTextareaEl ? this.richTextareaEl[0].textContent : this.textareaEl[0].value).length; + + if (length != this.lastLength) { + this.lastTyping = now; + this.lastLength = length; + this.onTyping(); + } + } + } + + if (this.richTextareaEl) { + clearTimeout(this.updateValueTO); + var now = tsNow(); + if (this.keyupStarted === undefined) { + this.keyupStarted = now; + } + if (now - this.keyupStarted > 10000) { + this.onChange(); + } + else { + this.updateValueTO = setTimeout(this.onChange.bind(this), 1000); + } + } + + } + if (e.type == 'keydown') { + if (this.autocompleteShown) { + if (e.keyCode == 38 || e.keyCode == 40) { // UP / DOWN + var next = e.keyCode == 40; + var currentSelected = $(this.autoCompleteEl).find('.composer_emoji_option_active'); + + if (currentSelected.length) { + var currentSelectedWrap = currentSelected[0].parentNode; + var nextWrap = currentSelectedWrap[next ? 'nextSibling' : 'previousSibling']; + currentSelected.removeClass('composer_emoji_option_active'); + if (nextWrap) { + $(nextWrap).find('a').addClass('composer_emoji_option_active'); + return cancelEvent(e); + } + } + + var childNodes = this.autoCompleteEl[0].childNodes; + var nextWrap = childNodes[next ? 0 : childNodes.length - 1]; + $(nextWrap).find('a').addClass('composer_emoji_option_active'); + + return cancelEvent(e); + } + + if (e.keyCode == 13) { // ENTER + var currentSelected = $(this.autoCompleteEl).find('.composer_emoji_option_active') || + $(this.autoCompleteEl).childNodes[0].find('a'); + var code = currentSelected.attr('data-code'); + if (code) { + this.onEmojiSelected(code, true); + EmojiHelper.pushPopularEmoji(code); + } + return cancelEvent(e); + } + } + + else if (e.keyCode == 13) { + var submit = false; + var sendOnEnter = true; + if (this.getSendOnEnter && !this.getSendOnEnter()) { + sendOnEnter = false; + } + if (sendOnEnter && !e.shiftKey) { + submit = true; + } else if (!sendOnEnter && (e.ctrlKey || e.metaKey)) { + submit = true; + } + + if (submit) { + this.onMessageSubmit(e); + return cancelEvent(e); + } + } + } +} + +MessageComposer.prototype.backupSelection = function () { + delete this.selection; + + if (!this.isActive) { + return; + } + if (window.getSelection) { + var sel = window.getSelection(); + if (sel.getRangeAt && sel.rangeCount) { + this.selection = sel.getRangeAt(0); + } + } else if (document.selection && document.selection.createRange) { + this.selection = document.selection.createRange(); + } +} + +MessageComposer.prototype.restoreSelection = function () { + if (!this.selection) { + return false; + } + var result = false; + if (window.getSelection) { + var sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(this.selection); + result = true; + } + else if (document.selection && this.selection.select) { + this.selection.select(); + result = true; + } + delete this.selection; + + return result; +} + + + +MessageComposer.prototype.checkAutocomplete = function () { + var pos, value; + if (this.richTextareaEl) { + var textarea = this.richTextareaEl[0]; + var valueCaret = getRichValueWithCaret(textarea); + var value = valueCaret[0]; + var pos = valueCaret[1] >= 0 ? valueCaret[1] : value.length; + } else { + var textarea = this.textareaEl[0]; + var pos = getFieldSelection(textarea); + var value = textarea.value; + } + + value = value.substr(0, pos); + + var matches = value.match(/(?:\s|^):([A-Za-z0-9\-\+\*_]*)$/); + if (matches) { + if (this.previousQuery == matches[0]) { + return; + } + this.previousQuery = matches[0]; + var query = SearchIndexManager.cleanSearchText(matches[1]); + EmojiHelper.getPopularEmoji((function (popular) { + if (query.length) { + var found = EmojiHelper.searchEmojis(query); + if (found.length) { + var popularFound = [], + code, pos; + for (var i = 0, len = popular.length; i < len; i++) { + code = popular[i].code; + pos = found.indexOf(code); + if (pos >= 0) { + popularFound.push(code); + found.splice(pos, 1); + if (!found.length) { + break; + } + } + } + this.showEmojiSuggestions(popularFound.concat(found)); + } else { + this.hideSuggestions(); + } + } else { + this.showEmojiSuggestions(popular); + } + }).bind(this)); + } + else { + delete this.previousQuery; + this.hideSuggestions(); + } +} + +MessageComposer.prototype.onFocusBlur = function (e) { + this.isActive = e.type == 'focus'; + + if (!this.isActive) { + this.hideSuggestions(); + } else { + setTimeout(this.checkAutocomplete.bind(this), 100); + } + if (this.richTextareaEl) { + document.execCommand('enableObjectResizing', !this.isActive, !this.isActive); + } +} + +MessageComposer.prototype.onRichPaste = function (e) { + var cData = (e.originalEvent || e).clipboardData, + items = cData && cData.items || [], + i; + for (i = 0; i < items.length; i++) { + if (items[i].kind == 'file') { + e.preventDefault(); + return true; + } + } + + var text = (e.originalEvent || e).clipboardData.getData('text/plain'); + setZeroTimeout(this.onChange.bind(this), 0); + if (text.length) { + document.execCommand('insertText', false, text); + return cancelEvent(e); + } + return true; +} + +MessageComposer.prototype.onRichPasteNode = function (e) { + var element = (e.originalEvent || e).target, + src = (element || {}).src || '', + remove = false; + + if (src.substr(0, 5) == 'data:') { + remove = true; + var blob = dataUrlToBlob(src); + this.onFilePaste(blob); + setZeroTimeout(function () { + element.parentNode.removeChild(element); + }) + } + else if (src && !src.match(/img\/blank\.gif/)) { + var replacementNode = document.createTextNode(' ' + src + ' '); + setTimeout(function () { + element.parentNode.replaceChild(replacementNode, element); + }, 100); + } +} + + + +MessageComposer.prototype.onEmojiSelected = function (code, autocomplete) { + if (this.richTextareaEl) { + var textarea = this.richTextareaEl[0]; + if (!this.isActive) { + if (!this.restoreSelection()) { + setRichFocus(textarea); + } + } + if (autocomplete) { + var valueCaret = getRichValueWithCaret(textarea); + var fullValue = valueCaret[0]; + var pos = valueCaret[1] >= 0 ? valueCaret[1] : fullValue.length; + var suffix = fullValue.substr(pos); + var prefix = fullValue.substr(0, pos); + var matches = prefix.match(/:([A-Za-z0-9\-\+\*_]*)$/); + var emoji = EmojiHelper.emojis[code]; + + var newValuePrefix; + if (matches && matches[0]) { + newValuePrefix = prefix.substr(0, matches.index) + ':' + emoji[1] + ':'; + } else { + newValuePrefix = prefix + ':' + emoji[1] + ':'; + } + textarea.value = newValue; + + this.selId = (this.selId || 0) + 1; + var html = this.getRichHtml(newValuePrefix) + ' ' + this.getRichHtml(suffix); + + this.richTextareaEl.html(html); + setRichFocus(textarea, $('#composer_sel' + this.selId)[0]); + } else { + document.execCommand('insertHTML', false, this.getEmojiHtml(code)); + } + } + else { + var textarea = this.textareaEl[0]; + var fullValue = textarea.value; + var pos = this.isActive ? getFieldSelection(textarea) : fullValue.length; + var suffix = fullValue.substr(pos); + var prefix = fullValue.substr(0, pos); + var matches = autocomplete && prefix.match(/:([A-Za-z0-9\-\+\*_]*)$/); + var emoji = EmojiHelper.emojis[code]; + + if (matches && matches[0]) { + var newValue = prefix.substr(0, matches.index) + ':' + emoji[1] + ': ' + suffix; + var newPos = matches.index + emoji[1].length + 3; + } else { + var newValue = prefix + ':' + emoji[1] + ': ' + suffix; + var newPos = prefix.length + emoji[1].length + 3; + } + textarea.value = newValue; + setFieldSelection(textarea, newPos); + } + + this.hideSuggestions(); + this.onChange(); +} + +MessageComposer.prototype.onChange = function (e) { + if (this.richTextareaEl) { + delete this.keyupStarted; + this.textareaEl.val(getRichValue(this.richTextareaEl[0])).trigger('change'); + } +} + +MessageComposer.prototype.getEmojiHtml = function (code, emoji) { + emoji = emoji || EmojiHelper.emojis[code]; + var iconSize = 20; + var spritesheet = EmojiHelper.spritesheetPositions[code]; + var categoryIndex = spritesheet[0]; + var pos = spritesheet[1]; + var x = iconSize * spritesheet[3]; + var y = iconSize * spritesheet[2]; + + return ':' + encodeEntities(emoji[1]) + ':'; +} + +MessageComposer.prototype.setValue = function (text) { + if (this.richTextareaEl) { + this.richTextareaEl.html(this.getRichHtml(text)); + this.lastLength = text.length; + } else { + this.textareaEl.val(text); + } +} + +MessageComposer.prototype.getRichHtml = function (text) { + return $('
').text(text).html().replace(/:([A-Za-z0-9\-\+\*_]+?):/gi, (function (all, shortcut) { + var code = EmojiHelper.shortcuts[shortcut]; + if (code !== undefined) { + return this.getEmojiHtml(code); + } + return all; + }).bind(this)); +} + + +MessageComposer.prototype.focus = function () { + if (this.richTextareaEl) { + setZeroTimeout((function () { + setRichFocus(this.richTextareaEl[0]); + }).bind(this)); + } else { + setFieldSelection(this.textareaEl[0]); + } +} + + +MessageComposer.prototype.showEmojiSuggestions = function (codes) { + var html = []; + var iconSize = Config.Mobile ? 26 : 20; + + var emoticonCode, emoticonData, spritesheet, pos, categoryIndex; + var count = Math.min(5, codes.length); + var i, x, y; + + for (i = 0; i < count; i++) { + emoticonCode = codes[i]; + if (emoticonCode.code) { + emoticonCode = emoticonCode.code; + } + if (emoticonData = Config.Emoji[emoticonCode]) { + spritesheet = EmojiHelper.spritesheetPositions[emoticonCode]; + categoryIndex = spritesheet[0]; + pos = spritesheet[1]; + x = iconSize * spritesheet[3]; + y = iconSize * spritesheet[2]; + html.push('
  • :' + encodeEntities(emoticonData[1][0]) + ':
  • '); + } + } + + this.autoCompleteEl.html(html.join('')); + this.autoCompleteEl.show(); + this.updatePosition(); + this.autocompleteShown = true; +} + +MessageComposer.prototype.updatePosition = function () { + var offset = (this.richTextareaEl || this.textareaEl).offset(); + var height = this.autoCompleteEl.outerHeight(); + this.autoCompleteEl.css({top: offset.top - height, left: offset.left}); +} + +MessageComposer.prototype.hideSuggestions = function () { + this.autoCompleteEl.hide(); + delete this.autocompleteShown; +} + +MessageComposer.prototype.resetTyping = function () { + this.lastTyping = 0; + this.lastLength = 0; +} + diff --git a/app/js/services.js b/app/js/services.js index 22f8d739..aba62d09 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -11,7 +11,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) -.service('AppUsersManager', function ($rootScope, $modal, $modalStack, $filter, $q, qSync, MtpApiFileManager, MtpApiManager, RichTextProcessor, SearchIndexManager, ErrorService, Storage, _) { +.service('AppUsersManager', function ($rootScope, $modal, $modalStack, $filter, $q, qSync, MtpApiFileManager, MtpApiManager, RichTextProcessor, ErrorService, Storage, _) { var users = {}, usernames = {}, cachedPhotoLocations = {}, @@ -507,8 +507,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) }) -.service('AppChatsManager', function ($rootScope, $modal, _, MtpApiFileManager, MtpApiManager, AppUsersManager, RichTextProcessor, SearchIndexManager) { +.service('AppChatsManager', function ($rootScope, $modal, _, MtpApiFileManager, MtpApiManager, AppUsersManager, RichTextProcessor) { var chats = {}, + chatsFull = {}, cachedPhotoLocations = {}; function saveApiChats (apiChats) { @@ -687,7 +688,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) } }) -.service('AppMessagesManager', function ($q, $rootScope, $location, $filter, ApiUpdatesManager, AppUsersManager, AppChatsManager, AppPeersManager, AppPhotosManager, AppVideoManager, AppDocsManager, AppAudioManager, MtpApiManager, MtpApiFileManager, RichTextProcessor, NotificationsManager, SearchIndexManager, PeersSelectService, Storage, FileManager, TelegramMeWebService, StatusManager, _) { +.service('AppMessagesManager', function ($q, $rootScope, $location, $filter, ApiUpdatesManager, AppUsersManager, AppChatsManager, AppPeersManager, AppPhotosManager, AppVideoManager, AppDocsManager, AppAudioManager, MtpApiManager, MtpApiFileManager, RichTextProcessor, NotificationsManager, PeersSelectService, Storage, FileManager, TelegramMeWebService, StatusManager, _) { var messagesStorage = {}; var messagesForHistory = {}; @@ -1548,7 +1549,17 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) break; case 'inputMediaPhoto': - media = {photo: AppPhotosManager.getPhoto(inputMedia.id.id)}; + media = { + _: 'messageMediaPhoto', + photo: AppPhotosManager.getPhoto(inputMedia.id.id) + }; + break; + + case 'inputMediaDocument': + media = { + _: 'messageMediaDocument', + 'document': AppDocsManager.getDoc(inputMedia.id.id) + }; break; } @@ -2752,6 +2763,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) }); }; + function getDoc (docID) { + return docs[docID] || {_: 'documentEmpty'}; + } + function wrapForHistory (docID) { if (docsForHistory[docID] !== undefined) { return docsForHistory[docID]; @@ -2911,6 +2926,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) return { saveDoc: saveDoc, + getDoc: getDoc, wrapForHistory: wrapForHistory, updateDocDownloaded: updateDocDownloaded, downloadDoc: downloadDoc, @@ -3024,6 +3040,111 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) } }) +.service('AppStickersManager', function ($q, FileManager, MtpApiManager, MtpApiFileManager, AppDocsManager, Storage) { + + var stickersToEmoji = {}; + var currentStickers = []; + var applied = false; + var started = false; + + return { + start: start, + getStickerEmoji: getStickerEmoji, + getStickers: getStickers, + getStickersImages: getStickersImages + }; + + function start () { + if (!started) { + started = true; + setTimeout(getStickers, 1000); + setInterval(preloadStickers, 900000); + } + } + + function preloadStickers() { + getStickers().then(getStickersImages); + } + + function getStickerEmoji(docID) { + return stickersToEmoji[docID] || false; + } + + function processRawStickers(stickers) { + if (applied !== stickers.hash) { + applied = stickers.hash; + var i, j, len1, len2; + + len1 = stickers.documents.length; + for (i = 0; i < len1; i++) { + AppDocsManager.saveDoc(stickers.documents[i]); + } + + var pack, emoticon, docID; + var doneDocIDs = {}; + stickersToEmoji = {}; + currentStickers = []; + len1 = stickers.packs.length; + for (i = 0; i < len1; i++) { + pack = stickers.packs[i]; + emoticon = pack.emoticon; + len2 = pack.documents.length; + for (j = 0; j < len2; j++) { + docID = pack.documents[j]; + if (stickersToEmoji[docID] === undefined) { + stickersToEmoji[docID] = emoticon; + } + if (doneDocIDs[docID] === undefined) { + doneDocIDs[docID] = true; + currentStickers.push(docID); + } + } + } + } + return currentStickers; + } + + function getStickers () { + return Storage.get('all_stickers').then(function (stickers) { + var layer = Config.Schema.API.layer; + if (stickers.layer != layer) { + stickers = false; + } + if (stickers && stickers.date > tsNow(true)) { + return processRawStickers(stickers); + } + return MtpApiManager.invokeApi('messages.getAllStickers', { + hash: stickers && stickers.hash || '' + }).then(function (newStickers) { + if (newStickers._ == 'messages.allStickersNotModified') { + newStickers = stickers; + } + newStickers.date = tsNow(true) + 3600; + newStickers.layer = layer; + delete newStickers._; + Storage.set({all_stickers: newStickers}); + + return processRawStickers(newStickers); + }); + }) + } + + function getStickersImages () { + var promises = []; + angular.forEach(currentStickers, function (docID) { + var doc = AppDocsManager.getDoc(docID); + var promise = MtpApiFileManager.downloadSmallFile(doc.thumb.location).then(function (blob) { + return { + id: docID, + src: FileManager.getUrl(blob, 'image/webp') + }; + }); + promises.push(promise); + }); + return $q.all(promises); + } +}) + .service('ApiUpdatesManager', function ($rootScope, MtpNetworkerFactory, AppUsersManager, AppChatsManager, AppPeersManager, MtpApiManager) { var isSynchronizing = true, diff --git a/app/partials/desktop/emoji_btn_tooltip.html b/app/partials/desktop/emoji_btn_tooltip.html new file mode 100644 index 00000000..51354a1b --- /dev/null +++ b/app/partials/desktop/emoji_btn_tooltip.html @@ -0,0 +1,26 @@ +
    + +
    +
    + +
    + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + + + +
    \ No newline at end of file diff --git a/app/partials/desktop/im.html b/app/partials/desktop/im.html index 575aca6e..f4d3f1bd 100644 --- a/app/partials/desktop/im.html +++ b/app/partials/desktop/im.html @@ -168,9 +168,8 @@
    -
    - -
    + +
    @@ -188,7 +187,7 @@
    -
    +
    diff --git a/app/partials/mobile/im.html b/app/partials/mobile/im.html index 752cebc0..66812902 100644 --- a/app/partials/mobile/im.html +++ b/app/partials/mobile/im.html @@ -133,9 +133,7 @@ -
    - -
    + diff --git a/app/webogram.appcache b/app/webogram.appcache index a43a10bd..83172322 100644 --- a/app/webogram.appcache +++ b/app/webogram.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 55 +# 59 NETWORK: *