-
Notifications
You must be signed in to change notification settings - Fork 378
Conversation
…sion object to be passed on to Telegram Client and modify, in example, IP address and port.
…trieved by application in case the sign in process is bypassed. Example code: if (client.IsUserAuthorized()) user = client.Session.TLUser; else { /* sign in or sign up */ }
* Must remove debug message "Msg code:" when feature will get complete.
Changed to highlight the changes to the fork.
* main event loop added to TelegramClient as a single function call.
README.md
Outdated
[](https://ci.appveyor.com/project/sochix/tlsharp) | ||
[](https://badge.fury.io/nu/TLSharp) | ||
<a href="https://github.com/sochix/telegram-tools"><img src=https://img.shields.io/badge/Telegram%20Tools-1.0.0-blue.svg /></a> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you removing this?
…rupted. * There's also a new event that allows a client app to know whether it's safe to do requests without interfering with the event loop.
+1 Thank you |
TLSharp.Core/TelegramClient.cs
Outdated
@@ -128,7 +128,7 @@ public class TelegramClient : IDisposable | |||
} | |||
finally | |||
{ | |||
IdleLoop(this); | |||
IdleLoop?.Invoke(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ppanhoto78 can you propose this commit as a separate pull request please?
@ruben0909 well, it seems @ppanhoto78 has mixed many changes in this PR which are unrelated to the task at hand (such as changing the README file). If you want to speed up this process, you could import his changes in a fork of yours, and create a new PR. |
…on on client implementation, Loop will run within constrained intervals which will be the longer waiting period for a scheduled action to run.
* Implemented ping.
Adds a BadMessageException so that it can be better traced.
…ation doesn't get interrupted by any event.
I run this code whit @ppanhoto78 sample but don't receive updates!
` |
…() is called before the loop starts, the client will never loop for events.
@ppanhoto78 man, if you keep pushing to your branch, we always get notified... Any chance you can separate this contribution properly? |
I'm really sorry for that. This was my first pull request ever and I went through a lot of trouble after that first release. Some serious problems came from the command/event interaction: if a command is issued and an event comes in between and another command is issue as an action for that processed event. That corrupted the internal state horribly and took me quite a while to figure out how those interactions broke. Of course, I had to add logging in order to figure that out. The ScheduledTasks event was my best shot to keep the cohesion of request/reply nature of the API with events that could intrude in between. Every action in response to an event must be scheduled for a time the API is idle for sure. IdleTasks appeared because Ping messages are needed from time to time or the server will drop the client. The blocking receive() are a product of my inability to control async receive() for very short periods. There's one more thing: large channels and groups do not report messages as events, those must be polled anyway. I'm open to suggestions on how I could break all my lessons learned in small patches that could be easily integrated. Thank you for your patience. |
…Slice is received, the continuation can be asked for.
Hi, Does this PR will be merged? it seems to be a nice contribution! and maybe it fixes #891 PS: I advise you to use GitHub's actions! |
Hello guys, anyone tried that pr? If it works i can fix and repull it, i need events too in my app |
@merqlove please try it and tell us if it works for you |
I agree with @merqlove if we can have updates subscriptions it could be great! |
This lib works fine for updates: https://github.com/OpenTl/OpenTl.ClientApi/wiki/Quick-Start |
@knocte i’ll try, after local merge i see that this pr is outdated. As i see we don’t need updates for json and testing deps., as it presence in this pr? |
Not sure what you mean. |
This pr have updates for dependencies in projects, if you look inside the files. I think such updates must be extracted |
I don't think those updates are needed for just the purpose of receiving updates without polling. Clearly what happened here is that the original contributor created the initial PR out of his master branch and then went ahead to evolve his own fork on top of the updates-with-no-polling feature. |
I did review of the pr & current proj. Sorry i’ve selected python analog which have all needed features inside & works well out of the box, because current project have no support of netstandard 2.x., for me is too much of time to port it first. |
Everybody claims "anyone can do it", but in the end no one does it. Thanks for nothing. |
Like I said, this library works fine: #679 (comment) |
pr updates amended pr review changes resolved merge conflicts updates from last night before rebase update on message test now passing removed nlog references and usage resolve conflicts from HEAD Reapply Events PR sochix#679 update on message test now passing removed nlog references and usage
On this branch, it is introduced a feature that allows the API to receive updates from the server without polling by subscribing an event (simply called Updates) and leaving the application on a receive loop rather than simply waiting to poll again.