Commit graph

243 commits

Author SHA1 Message Date
Paulo Rogerio Panhoto 6836e563ad GetUserDialogsAsync() has new parameter offset so that when a dialogsSlice is received, the continuation can be asked for. 2018-03-12 17:59:42 -03:00
Paulo Rogerio Panhoto 8180ee94f0 sets the _looping flag to true right from the constructor so if Close() is called before the loop starts, the client will never loop for events. 2018-03-08 16:38:30 -03:00
Paulo Rogerio Panhoto 4c112086aa Adds another callback recurrent timed tasks. 2018-03-01 19:50:29 -03:00
Paulo Rogerio Panhoto 8b392f5159 Rethrows BadMessageExceptions when parsing container messages. 2018-03-01 15:01:38 -03:00
Paulo Rogerio Panhoto 9f25a7615e logs exception caught when handling a container message. 2018-03-01 14:45:25 -03:00
Paulo Rogerio Panhoto 01e61f3ea4 New flag to mask event reporting. This is necessary so that Initialisation doesn't get interrupted by any event. 2018-03-01 14:10:03 -03:00
Paulo Rogerio Panhoto b98914ed55 Reports exception to logger where it used to go to console only. 2018-03-01 12:02:22 -03:00
Paulo Rogerio Panhoto aae366d33c Captures all network exceptions in a new module.
Adds a BadMessageException so that it can be better traced.
2018-02-27 18:07:03 -03:00
Paulo Rogerio Panhoto 57b804e15a Adds a function to allow the app to terminate a loop and close the client. 2018-02-27 16:42:10 -03:00
Paulo Rogerio Panhoto f30dc2da43 Disconsider ping delay for purpose of next ping message. 2018-02-22 19:24:29 -03:00
Paulo Rogerio Panhoto b71a72343c * Added logging messages.
* Implemented ping.
2018-02-22 18:14:07 -03:00
Paulo Rogerio Panhoto 2c8ea9c7ec Fixed event waiting with timeout. 2018-02-22 16:09:11 -03:00
Paulo Rogerio Panhoto 083e45585d Fixed buffer "sniffer" 2018-02-22 11:29:14 -03:00
Paulo Rogerio Panhoto 549b831577 Instead of relying on a cancellation token, which caused some confusion on client implementation,
Loop will run within constrained intervals which will be the longer waiting period for a scheduled action to run.
2018-02-22 11:12:32 -03:00
Paulo Rogerio Panhoto a425d142f9 Additional log messages. 2018-02-20 18:43:36 -03:00
Paulo Rogerio Panhoto ef1f961592 Added debug logging to MtProtoSender, so that state machine can be "visible". 2018-02-20 15:25:20 -03:00
Paulo Rogerio Panhoto 3f5adeb3e9 Clears idle handlers after they've been processed. 2018-02-14 17:04:01 -02:00
Paulo Rogerio Panhoto 15163c534f Handles correctly the case of null IdleLoop handler. 2018-01-17 15:41:53 -02:00
Paulo Rogerio Panhoto 4ca8b9568c Merge branch 'master' of https://github.com/ppanhoto78/TLSharp 2018-01-08 16:53:49 -02:00
Paulo Rogerio Panhoto 9ad192c6d6 * Adds a CancellationToken to the "event" API so that it can be interrupted.
* 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.
2018-01-08 16:51:33 -02:00
Paulo Rogerio Panhoto 936a26c6bd * HandleUpdate fixed for the case where there are no subscribers.
* main event loop added to TelegramClient as a single function call.
2018-01-05 11:12:41 -02:00
ppanhoto78 73022fc37c
Update README.md 2018-01-04 19:43:22 -02:00
ppanhoto78 bf20298109
Update README.md 2018-01-04 19:40:50 -02:00
ppanhoto78 42ace63b28
Update README.md
Changed to highlight the changes to the fork.
2018-01-04 19:39:26 -02:00
Paulo Rogerio Panhoto 76362061f6 Updated nuget packages 2018-01-03 19:38:47 -02:00
Paulo Rogerio Panhoto f871597de7 API modified to receive events instead of relying on polling to update chats. 2018-01-02 18:04:21 -02:00
Paulo Rogério Panhoto 017f5ddc1b undone the 'async' changes. 2017-12-29 11:39:50 -02:00
Paulo Rogerio Panhoto cf983474b4 Fixed receive only call.
* Must remove debug message "Msg code:" when feature will get complete.
2017-12-28 19:31:13 -02:00
Paulo Rogerio Panhoto a4a5ae4a2e First update event attempt. 2017-12-28 18:15:13 -02:00
Paulo Rogerio Panhoto a69db6ba27 TelegramClient exposes Session as a property so that TLUser can be retrieved 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 */
		}
2017-12-27 17:32:27 -02:00
Paulo Rogerio Panhoto a8a82f39a5 Modifications to Session and TelegramClient to allow a customised Session object
to be passed on to Telegram Client and modify, in example, IP address and port.
2017-12-26 15:27:05 -02:00
Andres G. Aragoneses 687eca968a
Merge pull request #659 from PROger4ever/master
Make Session constructor public for custom ISessionStore imlementations
2017-12-18 00:09:43 +08:00
PROger4ever 7cbc40a090 Make Session constructor public for custom ISessionStore implementations
Load() method in ISessionStore requires public constructor of class Session in some cases.
E.g., loading session from a db or a key-value store, manual loading from text-file, JSON/XML and so on.
2017-12-17 21:04:11 +05:00
Robert Massa 0940d3d982 Prepare requests for re-sending after a DC migration
Fixes #608.
2017-11-21 21:02:51 +08:00
Andres G. Aragoneses b55b28fa5d
Merge pull request #629 from aarani/master
Handle Import & Export Authorization While Reconnecting
2017-11-16 19:16:46 +08:00
Afshin Arani d15d87833e Remove Old FileMigrationException Handler
this catch block could never be reached anymore because of changes
proposed in #622
2017-11-16 14:04:24 +03:30
Afshin Arani 1877c9061c Handle Import & Export Authorization While Reconnecting
closes #624
2017-11-16 14:03:31 +03:30
Afshin Arani 659becfd51 Make TLVector implement IList 2017-11-09 20:10:22 +08:00
Afshin Arani d769dd3c2f Generator Must Respect MS .NET API guidelines 2017-11-09 19:37:09 +08:00
Robert Massa 3ba3ea53fd Handle DataCenterMigration exceptions in all methods exposed by TelegramClient
This handles the data center migration in more cases.
Fixes bugs like mentioned in #599.
2017-11-08 09:54:05 +08:00
Daniel Vygolov 0015cf494b Added new type of DataCenterMigrateException - NetworkMigrateException
Now we catch not only PhoneMigrateException but all DataCenterMigrationExceptions and reconnect
Fixes #568
2017-09-29 01:09:48 +08:00
Afshin Arani 133b9fdf6c TL-Layer: Update To Layer 66 (#519)
* TL-Layer: Update To Layer 66
2017-07-20 10:07:24 +08:00
AmiNadim 0d55940c12 Added while loop to MakeAuthAsync method. (#477)
fix PhoneMigrationException by reconnecting to DC on the error .
(fix for #458)
2017-05-18 21:06:33 +08:00
Ilya Pirozhenko 97a593e25e Update README.md 2017-05-04 18:01:13 +03:00
salarcode c5187ae12b Implementing IsConnected
Closes #460
2017-04-26 13:18:17 +08:00
Ilya Pirozhenko 1697db9d7f Update README.md 2017-02-28 16:45:20 +03:00
Barsham Sotoudeh 26aa35b88a Add missing "offset" parameter in catch block of the GetFile method (#402)
This offset optional parameter was added in a753a1ab13
2017-02-17 23:16:55 +08:00
Ilya Pirozhenko f6ef04ed01 Update README.md 2017-01-29 17:06:22 +03:00
Andres G. Aragoneses fbe8c9bf84 Merge pull request #373 from Starli0n/master
Http proxy authentication
2017-01-27 20:23:44 +08:00
Starli0n 48077961ae Custom TCP hanlder to allow HTTP proxy auth 2017-01-27 10:58:47 +01:00