Commit graph

1037 commits

Author SHA1 Message Date
teidesu
ee369a1c83 feat(core): int64 write optimization
this optimization gives about 10x performance boost on systems that support BigInt, and about 2x on those that don't
2021-05-21 22:15:25 +03:00
teidesu
c3fce178b6 feat: only update changed updates state (i.e. dont save pts if it hasnt changed) 2021-05-21 00:24:54 +03:00
teidesu
2660120e8f feat(core): support seq in updates 2021-05-19 21:21:12 +03:00
teidesu
910361ccab feat(core): implemented and exported lru map 2021-05-19 20:30:23 +03:00
teidesu
bdaa571777 feat(client): only send modified channel pts to storage 2021-05-19 17:37:11 +03:00
teidesu
82fb3d7e44 refactor: moved async lock to core and exported it 2021-05-16 23:05:53 +03:00
teidesu
9d8b09c5ff build: fixed node native addon build 2021-05-16 15:50:31 +03:00
teidesu
633f1fdf4d feat(client): editAdminRights method 2021-05-16 14:55:17 +03:00
teidesu
32ef1c59ad fix(client): handle updates in getNearbyChats method 2021-05-16 14:46:40 +03:00
teidesu
9bee00e584 fix(client): sendMediaGroup returns all sent messages 2021-05-16 14:43:23 +03:00
teidesu
e6e28399b0 refactor: prefer switches over ifs when possible 2021-05-16 14:32:36 +03:00
teidesu
f9336841ab feat(client): support inline message media contact 2021-05-16 13:49:32 +03:00
teidesu
d75071c284 refactor(client): made builder methods modify existing object instead of spreading, and also improved docs 2021-05-16 13:44:59 +03:00
teidesu
803daecdf3 feat(dispatcher): deleted messages update 2021-05-16 13:06:26 +03:00
teidesu
6e86ca464a feat(client): getCallbackAnswer method 2021-05-16 12:59:00 +03:00
teidesu
b4f731d831 feat(core): support rpc timeouts (for real) 2021-05-16 12:50:09 +03:00
teidesu
c092347b63 fix(client): fixed game highscore exports 2021-05-16 02:52:51 +03:00
teidesu
4852fe0301 feat(core): support rpc timeouts 2021-05-16 02:52:13 +03:00
teidesu
a6217c682d feat(core): support rpc timeouts 2021-05-16 02:50:43 +03:00
teidesu
fd1897651b feat(client): game high scores related methods 2021-05-16 02:21:59 +03:00
teidesu
b29883116b refactor(client): moved handling of inline messages to a separate method 2021-05-16 02:09:51 +03:00
teidesu
f45b602423 fix(tl): improved bot-only methods detection 2021-05-16 02:07:23 +03:00
teidesu
97ba7652ff refactor: use constructor check instead of instanceof where possible
this might just have introduced a bunch of errors, but ill test later
2021-05-15 21:17:49 +03:00
teidesu
f7e8051a94 refactor(client): made resolvePeer return InputPeer, and removed now redundant normalizeTo calls 2021-05-15 20:25:59 +03:00
teidesu
b634aa01eb feat(client): markChatUnread method
now i might be stupid
2021-05-12 22:37:09 +03:00
teidesu
482c71690d feat(client): markChatUnread method 2021-05-12 22:36:03 +03:00
teidesu
8cf4ce5533 feat(client): readHistory method and related bound methods 2021-05-12 22:31:29 +03:00
teidesu
4f40571455 feat(client): unpinAllMessages method 2021-05-12 22:18:08 +03:00
teidesu
79a8962284 feat(client): chat restrictions related methods 2021-05-12 22:07:00 +03:00
teidesu
30253c83c7 refactor(client): normalized MtCuteTypeAssertionError errors 2021-05-12 18:16:50 +03:00
teidesu
9be7b0d6c9 refactor: prefer switches to else-if chains 2021-05-12 17:58:45 +03:00
teidesu
6879ae945a feat(tl): generate switches instead of OR expressions
switches are WAY faster.
2021-05-11 23:27:09 +03:00
teidesu
f19fdf76b8 refactor(client): improve resolvePeer normalization 2021-05-11 23:21:35 +03:00
teidesu
8b3caeb3d0 feat(client): resolvePeerMany method 2021-05-11 22:43:11 +03:00
teidesu
46973c4830 fix(dispatcher): fixed field names because webstorm sucks 2021-05-11 22:34:13 +03:00
teidesu
5b3d7a3b09 refactor(client): normalized boolean fields 2021-05-11 22:10:14 +03:00
teidesu
d8cd13fd60 refactor(client): use ReadonlyArray for getter return types 2021-05-11 22:02:00 +03:00
teidesu
61778dba8e Merge remote-tracking branch 'origin/master' into master 2021-05-11 21:47:10 +03:00
teidesu
0f1edcfcf7 refactor: use UsersIndex and ChatsIndex types instead of bare record types 2021-05-11 21:46:59 +03:00
es3n1n
d587fcaa4e
fix typo
imagine writing macroses instead of macros
2021-05-10 22:57:09 +02:00
teidesu
0525800133 feat(client): getNearbyChats method 2021-05-10 22:51:35 +03:00
teidesu
f0eb95e4ba feat(client): chat event logs
also added support for chat locations and fixed ts errors
2021-05-10 21:51:25 +03:00
teidesu
4ad562bf06 fix(client): message media and action parsing 2021-05-10 17:57:12 +03:00
teidesu
db0d5f51e4 feat(dispatcher): filtering for service messages, by chat type and for text-only msgs 2021-05-10 17:30:05 +03:00
teidesu
9df635ad92 refactor(client): extract message media to separate type and file 2021-05-10 17:04:46 +03:00
teidesu
fe0f0849a4 refactor(client): extract message action to separate type and file 2021-05-10 16:36:16 +03:00
teidesu
e28ec79110 feat(client): support more service messages 2021-05-10 16:29:33 +03:00
teidesu
977527b78a fix(core): handle concurrent saving for the file
this is very hacky, but idk how to make it better.
2021-05-10 14:28:39 +03:00
teidesu
f3e4a34eab feat(client): deleteUserHistory method, also properly handle messages.affectedHistory
i suppose? this is an incredibly bad hack but i guess it works so who cares?
2021-05-10 14:27:57 +03:00
teidesu
c678a0ef6a fix(client): handle channel difference properly 2021-05-10 14:21:46 +03:00
teidesu
ded667b332 feat(client): chat invite links related methods 2021-05-10 00:35:29 +03:00
teidesu
ac0ddc5c6d feat(client): support seamless login for bots
also slightly improved docs for BotKeyboard
2021-05-09 20:41:54 +03:00
teidesu
cae7f90c57 fix(core): payload size limit 2021-05-09 19:34:25 +03:00
teidesu
df84137391 feat(client): get messages inside message groups 2021-05-09 18:29:33 +03:00
teidesu
87a7df669a feat(client): user related methods 2021-05-09 14:35:58 +03:00
teidesu
192c0f773e feat(client): control 2fa password 2021-05-09 14:35:47 +03:00
teidesu
320f4fdd24 fix(core): empty strings and zero numbers are also included in the flags and serialization 2021-05-09 14:34:52 +03:00
teidesu
0c9dfa172d feat(client): stop geolive messages 2021-05-09 12:03:45 +03:00
teidesu
b845864663 feat(client): sendCopy method 2021-05-08 17:54:18 +03:00
teidesu
cb01d8250e feat(client): renamed inputMediaTl to inputMedia and added it to every kind of media
also fixed imports/exports
2021-05-08 17:53:59 +03:00
teidesu
002d949a13 feat: user status and typing related methods and updates 2021-05-08 16:35:25 +03:00
teidesu
8a0c9984b5 feat(client): closePoll method 2021-05-08 13:19:37 +03:00
teidesu
9df884e667 feat(client): sendVote method 2021-05-08 12:36:15 +03:00
teidesu
d36c1781bd feat(dispatcher): support poll related updates
also fixed a few type and export issues, and changed poll option generation to match tdlib and others
2021-05-07 15:37:17 +03:00
teidesu
6db771e3da feat(client): a lot of changes
- support web documents
 - support previews for locations
 - unify media interfaces, merge everything into sendMedia
 - support invoices, polls, venues (both sending and receiving)
2021-05-07 14:26:29 +03:00
teidesu
169d95d6ed fix(core): lowercase usernames index 2021-05-07 12:41:06 +03:00
teidesu
90e1e018f5 feat(core): functions to (de-)serialize TL JSON 2021-05-06 15:20:23 +03:00
teidesu
b157b52ff6 feat(client): setStickerSetThumb method 2021-05-06 12:11:09 +03:00
teidesu
09064bb084 fix(client): sticker set negative indexes 2021-05-06 11:54:10 +03:00
teidesu
bbb8b20420 feat(client): sticker set methods for bots, and overall better sticker support 2021-05-05 23:26:28 +03:00
teidesu
5ea2ed67d7 fix(client): support for external media for uploadMedia in normalizeInputMedia 2021-05-05 19:59:08 +03:00
teidesu
b409292497 fix(client): support for uploaded media in editInlineMessage
thanks to @pacificescape for pointing out messages.uploadMedia method
2021-05-05 18:43:02 +03:00
teidesu
d841188149 fix(core): only switch dc for primary connection 2021-05-05 18:24:16 +03:00
teidesu
00c308dca7 feat(dispatcher): support more types in regex filter, inline filter for callback queries 2021-05-05 02:05:27 +03:00
teidesu
1fb7057866 feat: support callback queries 2021-05-05 01:50:04 +03:00
teidesu
95f6515340 fix(dispatcher/codegem): added @internal mark, also removed console log call 2021-05-05 00:45:09 +03:00
teidesu
1c1aed147a refactor(dispatcher): codegen for update types
i'm just too lazy to be bothered with pasting that. also, i forgot to implement builder for editMessage, teehee~
2021-05-05 00:43:35 +03:00
teidesu
fd92121b14 fix(core): do not rename in case of an error while writing 2021-05-04 14:13:06 +03:00
teidesu
23dcc4c1e5 feat: support for chosen inline query results 2021-05-04 14:07:40 +03:00
teidesu
97cbf10d3d fix(client): do not catch up after first update is received 2021-05-04 13:11:41 +03:00
teidesu
2226428164 docs(tl): added missing venue provider 2021-05-04 13:09:22 +03:00
teidesu
d469b81a85 feat(client): support all possible inline results and messages 2021-05-04 13:08:20 +03:00
teidesu
03bf248658 feat(client): edit media and schedule date in the message 2021-05-03 14:30:12 +03:00
teidesu
8bd81adacc feat: node native addon for faster aes ige 2021-05-01 21:22:20 +03:00
teidesu
f4c0c1bd31 fix(core): properly handle resending of pending rpc calls 2021-05-01 21:19:07 +03:00
teidesu
2034ae8b28 feat(client): support downloading from file ids 2021-05-01 21:10:49 +03:00
teidesu
9303d0841a feat(client): sendMediaGroup method 2021-05-01 00:30:53 +03:00
teidesu
a67c4ae85e refactor(client): extracted input file and media normalization to own methods, merged sendPhoto and sendMedia methods 2021-04-30 23:57:24 +03:00
teidesu
0eb0ac91eb feat(client): support file:* for simpler file uploads by path
holy shit code for handling file is getting more and more ridiculous. i wonder if i could refactor it somehow...
2021-04-30 22:44:17 +03:00
teidesu
f6d229f250 feat(client): added fileId field for documents 2021-04-30 20:52:16 +03:00
teidesu
3bb9a61ac7 feat(client): support file ids in sendMedia, sendPhoto and sendChatPhoto methods 2021-04-30 20:51:50 +03:00
teidesu
c0b72018fb feat(client): fileId and uniqueFileId fields for Thumbnail 2021-04-30 00:04:25 +03:00
teidesu
d3b320eea0 feat(file-id): option to pass a reduced set of fields to toUniqueId 2021-04-30 00:03:47 +03:00
teidesu
8b5060d2cd feat: file-id package to parse, serialize and manipulate tdlib-compatible file ids 2021-04-29 22:30:36 +03:00
teidesu
1da905ab3d feat(core): export BinaryReader and BinaryWriter 2021-04-29 22:29:59 +03:00
teidesu
3336f295ee feat: basic inline queries support (only articles for now) 2021-04-28 23:00:51 +03:00
teidesu
8bb23cd464 feat(dispatcher): chatMemberSelf filter 2021-04-27 20:42:23 +03:00
teidesu
fa3c719312 feat(dispatcher): support chat member updates 2021-04-27 20:31:04 +03:00
teidesu
7e9f255fdc feat(client): chat invite link class 2021-04-27 20:30:20 +03:00
teidesu
85671f6e6a refactor(client): type assertion inside User constructor 2021-04-26 23:26:57 +03:00
teidesu
5fee1d0660 fix(client): better storage handling
i suppose?? i mean, it's definitely better than randomly losing updates state and entities, but this might be much slower?
2021-04-26 23:26:29 +03:00
teidesu
b4a26c6f5b fix(client): disable catch up by default, also save storage after catching up 2021-04-26 22:41:19 +03:00
teidesu
a4f6c42bf5 feat(client): custom filtering for getDialogs 2021-04-25 21:47:44 +03:00
teidesu
bfcea5a80d feat(client): isAdmin and adminRights getters for Chat 2021-04-25 17:32:35 +03:00
teidesu
39236c94c2 feat(client): contacts related methods 2021-04-25 17:10:37 +03:00
teidesu
2fc8a90edf feat(client): better support for sticker sets, getInstalledStickers and getStickerSet methods 2021-04-25 15:39:42 +03:00
teidesu
68ce10d292 fix(chat): support display name for deleted users 2021-04-25 14:24:28 +03:00
teidesu
d26a2965d6 fix(chat): support chatForbidden and channelForbidden 2021-04-25 14:05:22 +03:00
teidesu
3aa53c7830 fix(markdown): fixed escape regex 2021-04-25 13:57:01 +03:00
teidesu
9545e9e24a feat(chat): expose chat user as a User 2021-04-25 13:40:36 +03:00
teidesu
960f994660 fix(user): support deleted accounts 2021-04-25 13:40:04 +03:00
teidesu
756e43c56a fix(updates): stupid no-dispatch related error 2021-04-25 13:39:07 +03:00
teidesu
1657090e33 fix(entities): replace user mentions with input user mentions after parsing 2021-04-25 13:38:56 +03:00
teidesu
dea02c9c39 fix(parse-modes): negative access hashes for permanent mentions 2021-04-25 13:34:06 +03:00
teidesu
f55d099b5f fix(markdown): escape closing square bracket 2021-04-25 13:26:43 +03:00
teidesu
64d860cc4c feat(client): support takeout session 2021-04-24 21:11:34 +03:00
teidesu
77ab185493 fix(core): properly handle WORKER_BUSY_TOO_LONG_RETRY error 2021-04-24 20:13:36 +03:00
teidesu
3ca8f847e6 fix(client): do not catch up id disableUpdates is used 2021-04-24 20:02:40 +03:00
teidesu
df2d77ec90 fix(client): limit number of messages in forwardMessages method 2021-04-24 19:56:09 +03:00
teidesu
cf29ffe31d feat(client): findFolder method, also ability to pass folder name in editFolder 2021-04-24 19:27:14 +03:00
teidesu
a51c1ae48c fix(client): stupid parse modes related bug 2021-04-24 19:26:23 +03:00
teidesu
0d3490ad7b feat(client): forwarding messages 2021-04-24 19:00:11 +03:00
teidesu
007343fb09 fix(client): proper handling of *TooLong updates 2021-04-24 18:51:59 +03:00
teidesu
fa7669f65e fix(core): support min entities from replies and updates difference 2021-04-24 18:25:15 +03:00
teidesu
3b88ac0bab fix(client/codegen): better handling of overloads 2021-04-24 18:01:35 +03:00
teidesu
63471115ae feat(core): safe file write, and also cleanup function using exit-hook package 2021-04-24 17:20:01 +03:00
teidesu
48d328f486 feat(client): run method that wraps start() 2021-04-24 16:33:06 +03:00
teidesu
c863e7a854 fix(client): better updates handling, also emit updates returned by RPC methods 2021-04-24 16:23:30 +03:00
teidesu
58f4356d58 fix(client): use 6-digit codes for test phone numbers 2021-04-24 16:08:43 +03:00
teidesu
b28e85ca0a feat(client): support for forwarding already uploaded media (for photos and documents) 2021-04-23 22:36:00 +03:00
teidesu
70c01a62a3 refactor(updates): extracted dispatcher to own package, fixed various update related bugs 2021-04-23 22:35:37 +03:00
teidesu
3d8094b69f fix(lock): properly handle multiple concurrent acquires 2021-04-20 21:58:50 +03:00
teidesu
878c0e35e4 feat(client/codegen): slightly changed code generation to avoid creating redundant wrapper functions 2021-04-18 16:59:05 +03:00
teidesu
87481c9a32 rewrite(client): improved updates handling, added support for min entities 2021-04-18 16:23:25 +03:00
teidesu
bcc5321cee refactor(client): use _saveStorage instead of storage.save 2021-04-17 19:00:46 +03:00
teidesu
0b361d0b8d refactor(core): moved storage load&save to methods to allow overriding logic in subclasses 2021-04-17 18:56:51 +03:00
teidesu
95069d0120 feat(client): startTest method
test numbers dont seem to work currently though.
2021-04-17 10:05:31 +03:00
teidesu
d8c2ef91c4 feat(client): folders 2021-04-16 00:12:07 +03:00
teidesu
69270a66a2 feat(core): websocket transport
untested in browser (yet). also had to slightly refactor stuff
2021-04-15 19:45:01 +03:00
teidesu
9e681cb13f fix(core): continuous aes ctr 2021-04-15 19:39:41 +03:00
teidesu
afa679cef4 fix(core): hopefully fixed issue with json file session randomly disappearing when using debugger 2021-04-15 12:18:50 +03:00
teidesu
874ea6c0a2 fix(tl-ref): layout and content preprocessing fixes 2021-04-15 09:50:07 +03:00
teidesu
ad511546ca fix(tl-ref): usage count for arrays in return types 2021-04-14 23:11:37 +03:00
teidesu
c286570500 refactor: made all packages private and changed main to typescript file 2021-04-14 22:53:10 +03:00
teidesu
c949709de2 fix(tl): added generate-errors script to generate-code 2021-04-14 22:50:29 +03:00
teidesu
73312e2809 feat(tl-ref): bold names of required parameters 2021-04-14 22:10:43 +03:00
teidesu
c318c059f8 fix(tl-ref): fixed arrays and core types for return types 2021-04-14 21:54:52 +03:00
teidesu
e6dd822644 feat(client): methods for dialogs, also added support for drafts and clearing them 2021-04-14 21:31:51 +03:00
teidesu
7a463f22a3 feat(tl-ref): find usages in array arguments 2021-04-14 20:00:14 +03:00
teidesu
14dc62e912 feat(client): getChatMembers and iterChatMembers methods 2021-04-14 19:43:05 +03:00
teidesu
958dd60c75 feat: tl reference web application
available at https://mt.tei.su/tl/
2021-04-14 18:08:53 +03:00
teidesu
eae2c7f459 feat(tl): additional descriptions for types and parameters without one
also updated to layer 126
2021-04-11 23:33:01 +03:00
teidesu
a6f9c02ef7 fix(tl): renamed errors.json to raw-errors.json to avoid confusion with js/ts files 2021-04-11 19:41:39 +03:00
teidesu
dd6e90bef6 feat(tl/codegen): made generate-errors emit errors list as a json file 2021-04-11 19:40:26 +03:00
teidesu
cdd01d43fc feat(client): setChatUsername method 2021-04-11 16:32:10 +03:00
teidesu
4371e9b63a feat(client): pinMessage and unpinMessage methods, pin and unpin bound methods for Message 2021-04-11 16:25:17 +03:00
teidesu
e3ff2b9041 feat(client): setChatDefaultPermissions and setSlowMode methods 2021-04-11 16:11:28 +03:00
teidesu
a06c03eda9 feat(client): setChatTitle and setChatDescription methods 2021-04-11 15:32:38 +03:00
teidesu
173647dda6 feat(client): setChatPhoto and deleteChatPhoto methods 2021-04-11 15:22:48 +03:00
teidesu
89dafa570b feat(client): getChatMember method and ChatMember class 2021-04-11 14:56:34 +03:00
teidesu
75dc961d65 feat(client): createGroup, deleteGroup, deleteHistory and leaveChat methods 2021-04-11 00:37:12 +03:00
teidesu
eb9b004b44 fix(client/codegen): fix rare crash when parsing default arguments
i have no idea why having .parent makes it crash but whatever lol.
2021-04-10 23:12:07 +03:00
teidesu
9edaa438fd feat(client): createSupergroup method 2021-04-10 21:08:04 +03:00
teidesu
f81329eecf fix(client): removed "broadcast groups"
that was my misunderstanding of docs 🤷
2021-04-10 21:07:33 +03:00
teidesu
02975b3793 feat(client): createChannel, deleteChannel, deleteSupergroup methods
intentionally no bound method for Chat because it would be way too easy to accidentally delete some chat.
2021-04-10 20:56:09 +03:00
teidesu
c0103441d3 feat(client/codegen): aliases for methods 2021-04-10 20:51:45 +03:00
teidesu
8acad15d7c fix(client): archiveChats & unarchiveChats and respective bound methods for Chat 2021-04-10 20:30:28 +03:00
teidesu
d592e55294 fix(client): force save session in checkPassword 2021-04-10 20:09:28 +03:00
teidesu
f0cf8a50a1 feat(client): addChatMembers method and related bound method for Chat 2021-04-10 20:06:33 +03:00
teidesu
f4907639b5 feat(client): output parameters with defaults as optional and include their default value in docs 2021-04-10 18:33:05 +03:00
teidesu
383f133292 feat(client): chats and chat joining related methods, bound methods and classes 2021-04-10 17:11:25 +03:00
teidesu
6911d7d756 feat(client): replyPhoto, replyMedia, replyDice, replyLocation bound methods for Message 2021-04-10 16:03:33 +03:00
teidesu
97cbfd4840 feat(client): sendLocation method 2021-04-10 15:23:27 +03:00
teidesu
0f2744b997 feat(client): sendDice method 2021-04-10 15:10:34 +03:00
teidesu
7e4142a572 feat(client): sending document-like media (files, audios, videos, gifs, voices) 2021-04-10 13:28:02 +03:00
teidesu
0901f97e0d refactor(client): removed type modification from sendText and sendPhoto return types 2021-04-10 11:54:31 +03:00
teidesu
97e6eb1403 refactor(client): renamed MediaLike to InputFileLike 2021-04-10 11:51:17 +03:00
teidesu
465a875460 feat(client): editMessage method
also .edit and .editText bound methods for Message
2021-04-09 23:19:58 +03:00
teidesu
e17ab84c37 feat(client): searchGlobal method
also small limit-related fix for searchMessages
2021-04-09 13:08:32 +03:00
teidesu
3a2537cd1a feat(client): searchMessages method
also added an object for search filters
2021-04-08 22:56:40 +03:00
teidesu
451fdd0cfc feat(client): iterHistory method
also fixed a few issues with getHistory
2021-04-08 21:40:04 +03:00
teidesu
4f62b98b5e feat(client): getHistory and deleteMessage methods
also bound .delete() method for Message
2021-04-08 20:25:15 +03:00
teidesu
8fc2f02a13 fix(client/message): hide link property from inspect 2021-04-08 20:24:14 +03:00
teidesu
91dbba948e refactor(client): extracted users/chats index creation to function 2021-04-08 20:23:23 +03:00
teidesu
35dc5561a1 refactor(api): extracted date parameters normalization to utils 2021-04-08 16:17:59 +03:00
teidesu
974ce8c136 fix(markdown/readme): typos 2021-04-08 12:29:06 +03:00
teidesu
cd8ec8309f Initial commit 2021-04-08 12:19:38 +03:00