sochix / TLSharp

Telegram client library implemented in C#
1.01k stars 380 forks source link

Improvements for async methods #903

Closed CheshireCaat closed 4 years ago

CheshireCaat commented 4 years ago

Because there is no more actions from author in PR #883 i decide to create this PR by myself.

@knocte, i tried to do all fixes which you requested from the author. All async methods now contains CancellationToken with default value (CancellationToken.None) And one more fix - i detect that SendAuthenticatetRequestAsync wasn't used in some methods, that need auth. Therefore i changed it and changed private modifier in SendAuthenticatedRequestAsync to internal. It's needed for methods that exists in UploadHelper.cs.

I'm waiting for your review.

CheshireCaat commented 4 years ago

Don't know why AppVeyor says that build failed - i successfuly builded solution and tested it.

UPD: The problem turned out to be that AppVeyor could not accept CancellationToken token = default. Replacing CancellationToken token = default(CancellationToken) fixed the problem.

knocte commented 4 years ago

Haha but now you put everything in one commit. You should have changed it so that the auth-changes stay separate. Anyway, it's not a big deal, leave it like that, however, what is a big deal is that these changes are based on another PR by another contributor, so you should mention him/her on the commit message.