mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-05 22:45:38 +00:00
Added Examples\Program_CollectAccessHash
This commit is contained in:
parent
4f9fbfc12c
commit
609e8a6a2d
2 changed files with 77 additions and 2 deletions
|
|
@ -1220,10 +1220,10 @@ namespace WTelegram
|
|||
=> _accessHashes.GetValueOrDefault(typeof(T));
|
||||
/// <summary>Retrieve the access_hash associated with this id (for a TL class)</summary>
|
||||
/// <typeparam name="T">a TL object class. For example User, Channel or Photo</typeparam>
|
||||
public long? GetAccessHashFor<T>(long id) where T : ITLObject
|
||||
public long GetAccessHashFor<T>(long id) where T : ITLObject
|
||||
{
|
||||
lock (_accessHashes)
|
||||
return _accessHashes.GetOrCreate(typeof(T)).TryGetValue(id, out var access_hash) ? access_hash : null;
|
||||
return _accessHashes.GetOrCreate(typeof(T)).TryGetValue(id, out var access_hash) ? access_hash : 0;
|
||||
}
|
||||
public void SetAccessHashFor<T>(long id, long access_hash) where T : ITLObject
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue