mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
New flag to mask event reporting. This is necessary so that Initialisation doesn't get interrupted by any event.
This commit is contained in:
parent
b98914ed55
commit
01e61f3ea4
|
|
@ -262,7 +262,7 @@ namespace TLSharp.Core.Network
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
logger.Error($"HandleUpdate failed: {ex}");
|
logger.Debug($"HandleUpdate failed: {ex}");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ namespace TLSharp.Core
|
||||||
|
|
||||||
public Session Session { get { return _session; } }
|
public Session Session { get { return _session; } }
|
||||||
|
|
||||||
|
public volatile bool AllowEvents = false;
|
||||||
|
|
||||||
public TelegramClient(int apiId, string apiHash,
|
public TelegramClient(int apiId, string apiHash,
|
||||||
Session session = null, string sessionUserId = "session", TcpClientConnectionHandler handler = null)
|
Session session = null, string sessionUserId = "session", TcpClientConnectionHandler handler = null)
|
||||||
{
|
{
|
||||||
|
|
@ -158,7 +160,8 @@ namespace TLSharp.Core
|
||||||
|
|
||||||
private void _sender_UpdatesEvent (TLAbsUpdates updates)
|
private void _sender_UpdatesEvent (TLAbsUpdates updates)
|
||||||
{
|
{
|
||||||
Updates?.Invoke (this, updates);
|
if (AllowEvents && Updates != null)
|
||||||
|
Updates(this, updates);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RequestWithDcMigration(TLMethod request)
|
private async Task RequestWithDcMigration(TLMethod request)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue