mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-04 22:17:43 +00:00
CollectUsersChats helper for your dictionaries (min-aware). CollectAccessHash won't collect 'min' access_hash.
This commit is contained in:
parent
0667d36ed8
commit
4e07c03a0b
5 changed files with 42 additions and 5 deletions
|
|
@ -29,8 +29,7 @@ namespace WTelegramClientTest
|
|||
if (dialogsBase is Messages_Dialogs dialogs)
|
||||
while (dialogs.dialogs.Length != 0)
|
||||
{
|
||||
foreach (var (id, user) in dialogs.users) _users[id] = user;
|
||||
foreach (var (id, chat) in dialogs.chats) _chats[id] = chat;
|
||||
dialogs.CollectUsersChats(_users, _chats);
|
||||
var lastDialog = dialogs.dialogs[^1];
|
||||
var lastMsg = dialogs.messages.LastOrDefault(m => m.Peer.ID == lastDialog.Peer.ID && m.ID == lastDialog.TopMessage);
|
||||
var offsetPeer = dialogs.UserOrChat(lastDialog).ToInputPeer();
|
||||
|
|
@ -50,8 +49,7 @@ namespace WTelegramClientTest
|
|||
private static void Client_Update(IObject arg)
|
||||
{
|
||||
if (arg is not UpdatesBase updates) return;
|
||||
foreach (var (id, user) in updates.Users) _users[id] = user;
|
||||
foreach (var (id, chat) in updates.Chats) _chats[id] = chat;
|
||||
updates.CollectUsersChats(_users, _chats);
|
||||
foreach (var update in updates.UpdateList)
|
||||
switch (update)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue