Commit Graph

742 Commits

Author SHA1 Message Date
Lonami Exo
81baced12b Support t.me/ links when resolving usernames/joinchat links
Closes #419
2017-11-10 13:27:51 +01:00
Lonami Exo
c4e07cff57 Fix unfinished markdown delimiters being stripped away 2017-11-10 11:44:27 +01:00
Lonami Exo
cb3f20db65 Clean up markdown parsing since tuples aren't used anymore 2017-11-10 11:41:49 +01:00
Lonami Exo
7d75eebdab Make markdown parser use only Telegram's MessageEntity's 2017-11-10 11:07:36 +01:00
Lonami Exo
cad1e883a6 Don't save full entities unless they have access_hash 2017-11-10 09:32:40 +01:00
Lonami Exo
f65322af18 Fix entity database not using the phone on {phone: id}
Closes #412
2017-11-07 10:15:55 +01:00
Lonami Exo
83af705cc8 Add more comments to the markdown parser 2017-11-06 11:32:40 +01:00
Lonami Exo
3a2c3a9497 Fix URL regex for markdown was greedy (fix-up) 2017-11-06 11:22:58 +01:00
Lonami Exo
07ece83aba Fix overlapping markdown entities being skipped 2017-11-06 10:37:22 +01:00
Lonami Exo
4f80429215 Work on byte level when parsing markdown
Reasoning: instead encoding every character one by one as we
encounter them to use half their length as the correct offset,
we can simply encode the whole string at once as utf-16le and
work with that directly.
2017-11-06 10:29:32 +01:00
Lonami Exo
e8248b4b8b Remove now unused Emoji ranges generator 2017-11-06 09:37:07 +01:00
Viktor Oreshkin
49eb281251 Proper offset calculation for markdown (#407)
Dan suca
If Dan shared it with Traitor I'll not have to spend my time on this
Not a, sorry for not letting you sleep
k thx bye
Will this stay in history?
2017-11-06 00:17:22 +01:00
Lonami Exo
f381b26790 Add optional force_sms parameter to .send_code_request() 2017-11-04 20:46:02 +01:00
Lonami Exo
c8a0953f8e Update to v0.15.4 2017-11-04 13:40:56 +01:00
Lonami Exo
1e35c1cfed Update to layer 72 2017-11-04 13:40:43 +01:00
Lonami Exo
1741608f28 Use larger batches for .get_dialogs(limit=None) 2017-11-04 12:35:12 +01:00
Dan
0bfd8ff032 Add much faster integer factorization (#403 related to #199) 2017-11-03 12:59:17 +01:00
Lonami Exo
9a12738f0e Fix .get_message_history not working with limit=0 2017-10-31 13:52:43 +01:00
Lonami Exo
3d6c8915e3 Allow >100 limits when getting message history (implements #290) 2017-10-31 12:52:07 +01:00
Lonami
6c2363acd2
Merge pull request #396 from LonamiWebs/md-parsing
Support markdown again (implements  #118)
2017-10-30 11:19:48 +01:00
Lonami Exo
7e204632e2 Add parse_mode parameter to TelegramClient.send_message() 2017-10-30 11:17:22 +01:00
Lonami Exo
82cac4836c Fix markdown URL parsing using character index instead offset 2017-10-30 11:15:53 +01:00
Lonami Exo
0a14aa1bc6 Remove additional check when calculating emojies length
This special check treated some emojies as 3 characters long but
this shouldn't have actually been done, likely due to the old
regex matching more things as emoji than it should (which would
have count as 2 too, making up for 1+3 from the new is_emoji()).
2017-10-30 10:56:39 +01:00
Lonami Exo
05f7f076d5 Fix InputPeer* with None hash, drop them off database (closes #354) 2017-10-30 10:33:45 +01:00
Lonami Exo
05626c8274 Implement missing .to_dict() and .stringify() on message/container 2017-10-29 20:13:36 +01:00
Lonami Exo
6567f4b567 Clean .download_contact and a wrong indent level 2017-10-29 20:13:36 +01:00
Lonami Exo
2609bd9bd1 Use constants and allow empty URL regex when parsing markdown 2017-10-29 18:21:21 +01:00
Lonami Exo
d47a9f83d0 Fix some special cases which are not treated as emojis (offset 1) 2017-10-29 17:07:37 +01:00
Lonami Exo
bcaa8007a3 Fix inline URL matching swallowing all parse entities 2017-10-29 16:43:30 +01:00
Lonami Exo
f5fafc6a27 Enhance emoji detection 2017-10-29 16:41:30 +01:00
Lonami Exo
368269cb11 Add ability to parse inline URLs 2017-10-29 16:33:10 +01:00
Lonami Exo
9600a9ea0b Fix markdown parsing failing if delimiter was last character 2017-10-28 19:17:18 +02:00
Lonami Exo
5adec2e1ab Initial attempt at parsing Markdown-like syntax 2017-10-28 19:06:41 +02:00
Andrei Fokau
ef794bf75d Fix importing dependencies during installing (#384) 2017-10-28 12:21:07 +02:00
Lonami Exo
e48f15be80 Fix-up af08d59 (missing parenthesis) 2017-10-28 11:11:51 +02:00
Lonami Exo
2f28050cac Fix generated __bytes__ failing with flag indicator but no flags
Likely since the code was ported to get rid of the BinaryWriter,
since the flag calculation was inlined. Some types (only
channelMessages as of layer 71) had a flag indicator but no flag
arguments, so the calculation of which were not None failed.

This special case is now handled correctly.
2017-10-28 11:09:55 +02:00
Tanuj
af08d59cb7 Fix bug with semicolons when downloading contacts (#319) 2017-10-28 11:09:46 +02:00
Tanuj
39a1d5e90d Replace broken auto_replier.py with new code (#389) 2017-10-28 11:06:34 +02:00
Tanuj
403c7bd00a Make pylint happier on print_updates example (#387) 2017-10-26 18:03:24 +02:00
Andrei Fokau
e6ac61c1b9 Add missing __init__.py to telethon_generator package (#382) 2017-10-25 19:48:46 +02:00
Lonami Exo
c6d30ffceb Fix exception when logging exceptions 2017-10-25 13:06:51 +02:00
Lonami Exo
3db13ccdd2 Add a more descriptive error when serializing bytes 2017-10-25 12:43:57 +02:00
Lonami Exo
e427559d4c Fix username invalid error having wrong username regex 2017-10-25 12:22:38 +02:00
Tanuj
9f9da6adda Remove comma (#376) 2017-10-24 22:08:44 +02:00
Tanuj
d707fd1593 Add example script to print out all updates 2017-10-24 21:32:31 +02:00
Lonami Exo
ceb37cd4c5 Move auth_key generation and InitConnection logic to .invoke()
The reasoning behind this is that .connect() should not call
any request at all, it should only connect to the servers
although it currently still calls GetStateRequest.

There were some issues (#291, #360) where the auth_key was None
(possibly due to .connect() returning False), so this may
fix some of the cases where it returned False. This way we also
ensure that we always have an auth_key, or even if it "breaks"
(it's not the right key for the server anymore).

A few additional changes have been introduced to accommodate
this, such as moving InitConnection logic too or importing auths.
2017-10-24 15:40:51 +02:00
Lonami Exo
b3ca68b7d9 Avoid cyclic imports caused by #348 (fix #357) 2017-10-24 10:07:31 +02:00
Lonami Exo
d58c729af0 Add missing InputPeerSelf case to .get_input_user 2017-10-24 09:43:59 +02:00
Lonami Exo
1f1e040af9 Fix setup.py if/elif/else chain 2017-10-22 13:57:02 +02:00
Lonami Exo
b04eed82eb Add new .idle() method to listen for updates from MainThread 2017-10-22 13:16:34 +02:00