Fix: ReactorError wasn't always triggered correctly on connection lost

This commit is contained in:
Wizou 2024-05-28 00:37:58 +02:00
parent 37b8f6c054
commit c8a0882587
3 changed files with 4 additions and 4 deletions

View file

@ -620,7 +620,7 @@ namespace WTelegram
chats = (await this.Messages_GetChats(chat.chat_id)).chats };
case InputPeerChannel channel:
return await this.Channels_EditAdmin(channel, user,
new ChatAdminRights { flags = is_admin ? (ChatAdminRights.Flags)0x8BF : 0 }, null);
new ChatAdminRights { flags = is_admin ? (ChatAdminRights.Flags)0x1E8BF : 0 }, null);
default:
throw new ArgumentException(OnlyChatChannel);
}

View file

@ -366,7 +366,7 @@ namespace WTelegram
lock (_pendingRpcs) // abort all pending requests
{
foreach (var rpc in _pendingRpcs.Values)
rpc.tcs.SetException(ex);
rpc.tcs.TrySetException(ex);
_pendingRpcs.Clear();
_bareRpc = null;
}
@ -879,9 +879,9 @@ namespace WTelegram
if (defaultDc != 0) _dcSession ??= _session.DCSessions.GetValueOrDefault(defaultDc);
_dcSession ??= new() { Id = Helpers.RandomLong() };
_dcSession.Client = this;
_dcSession.DataCenter = null;
Helpers.Log(2, $"Connecting to {endpoint}...");
tcpClient = await TcpHandler(endpoint.Address.ToString(), endpoint.Port);
_dcSession.DataCenter = null;
}
}
}

View file

@ -16,7 +16,7 @@
<Description>Telegram Client API (MTProto) library written 100% in C# and .NET Standard | Latest API layer: 179&#10;&#10;Release Notes:&#10;$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</Description>
<Copyright>Copyright © Olivier Marcoux 2021-2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/wiz0u/WTelegramClient</PackageProjectUrl>
<PackageProjectUrl>https://wiz0u.github.io/WTelegramClient</PackageProjectUrl>
<PackageIcon>logo.png</PackageIcon>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/wiz0u/WTelegramClient.git</RepositoryUrl>