Fix infinite recursion on Dispose after downloads (fix #274)

This commit is contained in:
Wizou 2024-08-10 23:29:08 +02:00
parent e5c6086e11
commit a28b984395
2 changed files with 3 additions and 2 deletions

2
.github/dev.yml vendored
View file

@ -1,7 +1,7 @@
pr: none pr: none
trigger: [ master ] trigger: [ master ]
name: 4.1.6-dev.$(Rev:r) name: 4.1.7-dev.$(Rev:r)
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest

View file

@ -49,7 +49,8 @@ namespace WTelegram
/// <summary>Size of chunks when uploading/downloading files. Reduce this if you don't have much memory</summary> /// <summary>Size of chunks when uploading/downloading files. Reduce this if you don't have much memory</summary>
public int FilePartSize { get; set; } = 512 * 1024; public int FilePartSize { get; set; } = 512 * 1024;
/// <summary>Is this Client instance the main or a secondary DC session</summary> /// <summary>Is this Client instance the main or a secondary DC session</summary>
public bool IsMainDC => (_dcSession?.DataCenter?.id - _session.MainDC) is null or 0; public bool IsMainDC => _dcSession?.DataCenter?.flags.HasFlag(DcOption.Flags.media_only) != true
&& (_dcSession?.DataCenter?.id - _session.MainDC) is null or 0;
/// <summary>Has this Client established connection been disconnected?</summary> /// <summary>Has this Client established connection been disconnected?</summary>
public bool Disconnected => _tcpClient != null && !(_tcpClient.Client?.Connected ?? false); public bool Disconnected => _tcpClient != null && !(_tcpClient.Client?.Connected ?? false);
/// <summary>ID of the current logged-in user or 0</summary> /// <summary>ID of the current logged-in user or 0</summary>