Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit 97f0f80

Browse files
committed
Layer 33 draft
1 parent 976b837 commit 97f0f80

10 files changed

Lines changed: 10486 additions & 82 deletions

File tree

‎app/index.html‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
<script type="text/javascript" src="vendor/zlib/gunzip.min.js"></script>
6565
<script type="text/javascript" src="vendor/closure/long.js"></script>
6666
<script type="text/javascript" src="vendor/leemon_bigint/bigint.js"></script>
67-
<script type="text/javascript" src="vendor/libwebpjs/libwebp-0.2.0.min.js"></script>
67+
<!--script type="text/javascript" src="vendor/libwebpjs/libwebp-0.2.0.min.js"></script-->
68+
<script type="text/javascript" src="vendor/libwebpjs/libwebp-0.1.13.js"></script>
6869

6970

7071
<script type="text/javascript" src="js/lib/utils.js"></script>

‎app/js/controllers.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ angular.module('myApp.controllers', ['myApp.i18n'])
160160

161161
function saveAuth (result) {
162162
MtpApiManager.setUserAuth(options.dcID, {
163-
expires: result.expires,
164163
id: result.user.id
165164
});
166165
$timeout.cancel(callTimeout);
@@ -2690,11 +2689,9 @@ angular.module('myApp.controllers', ['myApp.i18n'])
26902689
};
26912690

26922691
$scope.kickFromGroup = function (userID) {
2693-
var user = AppUsersManager.getUser(userID);
2694-
26952692
MtpApiManager.invokeApi('messages.deleteChatUser', {
26962693
chat_id: $scope.chatID,
2697-
user_id: {_: 'inputUserForeign', user_id: userID, access_hash: user.access_hash || '0'}
2694+
user_id: AppUsersManager.getUserInput(userID)
26982695
}).then(onChatUpdated);
26992696
};
27002697

‎app/js/lib/config.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ null#56730bcc = Null;
99

1010
inputPeerEmpty#7f3b18ea = InputPeer;
1111
inputPeerSelf#7da07ec9 = InputPeer;
12-
inputPeerContact#1023dbe8 user_id:int = InputPeer;
13-
inputPeerForeign#9b447325 user_id:int access_hash:long = InputPeer;
1412
inputPeerChat#179be863 chat_id:int = InputPeer;
1513

1614
inputUserEmpty#b98886cf = InputUser;
1715
inputUserSelf#f7c1b13f = InputUser;
18-
inputUserContact#86e94f65 user_id:int = InputUser;
19-
inputUserForeign#655e74ff user_id:int access_hash:long = InputUser;
2016

2117
inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
2218

@@ -70,11 +66,6 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL
7066
fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
7167

7268
userEmpty#200250ba id:int = User;
73-
userSelf#1c60e608 id:int first_name:string last_name:string username:string phone:string photo:UserProfilePhoto status:UserStatus = User;
74-
userContact#cab35e18 id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
75-
userRequest#d9ccc4ef id:int first_name:string last_name:string username:string access_hash:long phone:string photo:UserProfilePhoto status:UserStatus = User;
76-
userForeign#75cf7a8 id:int first_name:string last_name:string username:string access_hash:long photo:UserProfilePhoto status:UserStatus = User;
77-
userDeleted#d6016d7a id:int first_name:string last_name:string username:string = User;
7869

7970
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
8071
userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
@@ -87,7 +78,7 @@ chatEmpty#9ba2d800 id:int = Chat;
8778
chat#6e9c9bc7 id:int title:string photo:ChatPhoto participants_count:int date:int left:Bool version:int = Chat;
8879
chatForbidden#fb0ccc41 id:int title:string date:int = Chat;
8980

90-
chatFull#cade0791 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite = ChatFull;
81+
chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;
9182

9283
chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
9384

@@ -98,7 +89,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto;
9889
chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
9990

10091
messageEmpty#83e5de54 id:int = Message;
101-
message#a7ab1991 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia = Message;
92+
message#c3060325 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia reply_markup:flags.6?ReplyMarkup = Message;
10293
messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message;
10394

10495
messageMediaEmpty#3ded6320 = MessageMedia;
@@ -119,14 +110,14 @@ messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
119110
dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
120111

121112
photoEmpty#2331b22d id:long = Photo;
122-
photo#c3838076 id:long access_hash:long user_id:int date:int geo:GeoPoint sizes:Vector<PhotoSize> = Photo;
113+
photo#690cc3a6 id:long access_hash:long sizes:Vector<PhotoSize> = Photo;
123114

124115
photoSizeEmpty#e17e23c type:string = PhotoSize;
125116
photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize;
126117
photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize;
127118

128119
videoEmpty#c10658a8 id:long = Video;
129-
video#ee9f4a4d id:long access_hash:long user_id:int date:int duration:int size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
120+
video#954cc1cc id:long access_hash:long duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video;
130121

131122
geoPointEmpty#1117dd5f = GeoPoint;
132123
geoPoint#2049d70c long:double lat:double = GeoPoint;
@@ -135,7 +126,7 @@ auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone;
135126

136127
auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
137128

138-
auth.authorization#f6b673a4 expires:int user:User = auth.Authorization;
129+
auth.authorization#ff036af1 user:User = auth.Authorization;
139130

140131
auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
141132

@@ -157,7 +148,7 @@ peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool event
157148

158149
wallPaper#ccb03657 id:int title:string sizes:Vector<PhotoSize> color:int = WallPaper;
159150

160-
userFull#771095da user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool real_first_name:string real_last_name:string = UserFull;
151+
userFull#5a89ac5b user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool bot_info:BotInfo = UserFull;
161152

162153
contact#f911c994 user_id:int mutual:Bool = Contact;
163154

@@ -206,6 +197,7 @@ inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;
206197
inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter;
207198
inputMessagesFilterDocument#9eddf188 = MessagesFilter;
208199
inputMessagesFilterAudio#cfc87522 = MessagesFilter;
200+
inputMessagesFilterAudioDocuments#5afbf764 = MessagesFilter;
209201

210202
updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
211203
updateMessageID#4e90bfd6 id:int random_id:long = Update;
@@ -240,7 +232,7 @@ photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
240232

241233
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
242234

243-
dcOption#2ec2a43c id:int hostname:string ip_address:string port:int = DcOption;
235+
dcOption#5d8c6cc flags:# id:int ip_address:string port:int = DcOption;
244236

245237
config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
246238

@@ -335,10 +327,10 @@ inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation;
335327
inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation;
336328

337329
audioEmpty#586988d8 id:long = Audio;
338-
audio#c7ac6496 id:long access_hash:long user_id:int date:int duration:int mime_type:string size:int dc_id:int = Audio;
330+
audio#a5e11d9c id:long access_hash:long duration:int mime_type:string size:int dc_id:int = Audio;
339331

340332
documentEmpty#36f8c871 id:long = Document;
341-
document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
333+
document#902db111 id:long access_hash:long mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector<DocumentAttribute> = Document;
342334

343335
help.support#17c6b5f6 phone_number:string user:User = help.Support;
344336

@@ -405,7 +397,7 @@ documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
405397
documentAttributeAnimated#11b58939 = DocumentAttribute;
406398
documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute;
407399
documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute;
408-
documentAttributeAudio#51448e5 duration:int = DocumentAttribute;
400+
documentAttributeAudio#ded218e0 duration:int title:string performer:string = DocumentAttribute;
409401
documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
410402

411403
messages.stickersNotModified#f1749a22 = messages.Stickers;
@@ -414,7 +406,7 @@ messages.stickers#8a8ecd32 hash:string stickers:Vector<Document> = messages.Stic
414406
stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
415407

416408
messages.allStickersNotModified#e86602c3 = messages.AllStickers;
417-
messages.allStickers#5ce352ec hash:string packs:Vector<StickerPack> sets:Vector<StickerSet> documents:Vector<Document> = messages.AllStickers;
409+
messages.allStickers#d51dafdb hash:string sets:Vector<StickerSet> = messages.AllStickers;
418410

419411
disabledFeature#ae636f24 feature:string description:string = DisabledFeature;
420412

@@ -469,10 +461,29 @@ inputStickerSetEmpty#ffb62b95 = InputStickerSet;
469461
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
470462
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
471463

472-
stickerSet#a7a43b17 id:long access_hash:long title:string short_name:string = StickerSet;
464+
stickerSet#cd303b41 flags:# id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;
473465

474466
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
475467

468+
user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User;
469+
470+
botCommand#c27ac8c7 command:string description:string = BotCommand;
471+
472+
botInfoEmpty#bb2e37ce = BotInfo;
473+
botInfo#9cf585d user_id:int version:int share_text:string description:string commands:Vector<BotCommand> = BotInfo;
474+
475+
keyboardButton#a2fa4880 text:string = KeyboardButton;
476+
477+
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
478+
479+
replyKeyboardHide#a03e5b85 flags:# = ReplyMarkup;
480+
replyKeyboardForceReply#f4108aa0 flags:# = ReplyMarkup;
481+
replyKeyboardMarkup#3502758c flags:# rows:Vector<KeyboardButtonRow> = ReplyMarkup;
482+
483+
inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;
484+
485+
inputUser#d8292816 user_id:int access_hash:long = InputUser;
486+
476487
---functions---
477488

478489
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -524,8 +535,8 @@ messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHis
524535
messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
525536
messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
526537
messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
527-
messages.sendMessage#9add8f26 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long = messages.SentMessage;
528-
messages.sendMedia#2d7923b1 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long = Updates;
538+
messages.sendMessage#fc55e6b5 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup = messages.SentMessage;
539+
messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;
529540
messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates;
530541
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
531542
messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
@@ -551,7 +562,7 @@ help.getAppUpdate#c812ac7e device_model:string system_version:string app_version
551562
help.saveAppLog#6f02f748 events:Vector<InputAppEvent> = Bool;
552563
help.getInviteText#a4a95186 lang_code:string = help.InviteText;
553564

554-
photos.getUserPhotos#b7ee553c user_id:InputUser offset:int max_id:int limit:int = photos.Photos;
565+
photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;
555566

556567
messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates;
557568
messages.sendBroadcast#bf73f4da contacts:Vector<InputUser> random_id:Vector<long> message:string media:InputMedia = Updates;
@@ -613,6 +624,8 @@ messages.getAllStickers#aa3bc868 hash:string = messages.AllStickers;
613624

614625
account.updateDeviceLocked#38df3532 period:int = Bool;
615626

627+
auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
628+
616629
messages.getWebPagePreview#25223e24 message:string = MessageMedia;
617630

618631
account.getAuthorizations#e320c158 = account.Authorizations;
@@ -631,5 +644,6 @@ messages.exportChatInvite#7d885289 chat_id:int = ExportedChatInvite;
631644
messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
632645
messages.importChatInvite#6c50051c hash:string = Updates;
633646
messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
634-
messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool;
635-
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
647+
messages.installStickerSet#7b30c3a6 stickerset:InputStickerSet disabled:Bool = Bool;
648+
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
649+
messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates;

‎app/js/lib/utils.js‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,18 +463,30 @@ function versionCompare (ver1, ver2) {
463463
image.onerror = function () {
464464
nativeWebpSupport = false;
465465
};
466-
image.src = 'data:image/webp;base64,UklGRjIAAABXRUJQVlA4ICYAAACyAgCdASoCAAEALmk0mk0iIiIiIgBoSygABc6zbAAA/v56QAAAAA==';
466+
// image.src = 'data:image/webp;base64,UklGRjIAAABXRUJQVlA4ICYAAACyAgCdASoCAAEALmk0mk0iIiIiIgBoSygABc6zbAAA/v56QAAAAA==';
467467

468468
var canvas, context;
469469

470+
function convertBinaryToArray (a) {
471+
var b = new Array();
472+
var c = a.length;
473+
for (i = 0; i < c; ++i) b.push(a.charCodeAt(i));
474+
return b
475+
}
476+
470477

471478
function getPngUrlFromData(data) {
479+
console.log(data);
480+
data = convertBinaryToArray(data);
481+
482+
472483
var start = tsNow();
473484

474485
var decoder = new WebPDecoder();
475486

476487
var config = decoder.WebPDecoderConfig;
477-
var buffer = config.j;
488+
var buffer = config.output;
489+
// var buffer = config.j;
478490
var bitstream = config.input;
479491

480492
if (!decoder.WebPInitDecoderConfig(config)) {
@@ -490,6 +502,7 @@ function versionCompare (ver1, ver2) {
490502
}
491503

492504
var mode = decoder.WEBP_CSP_MODE;
505+
buffer.colorspace = mode.MODE_RGBA;
493506
buffer.J = 4;
494507

495508
try {

0 commit comments

Comments
 (0)