mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-05 14:35:43 +00:00
More helpers (reordered), notably UserOrChat
This commit is contained in:
parent
08ba766e5c
commit
c9ccaf2d17
5 changed files with 318 additions and 123 deletions
|
|
@ -76,14 +76,14 @@ if (dialogsBase is Messages_Dialogs dialogs)
|
|||
while (dialogs.dialogs.Length != 0)
|
||||
{
|
||||
foreach (var dialog in dialogs.dialogs)
|
||||
switch (dialogs.GetUserOrChat(dialog))
|
||||
switch (dialogs.UserOrChat(dialog))
|
||||
{
|
||||
case UserBase user when user.IsActive: Console.WriteLine("User " + user); break;
|
||||
case ChatBase chat when chat.IsActive: Console.WriteLine(chat); break;
|
||||
}
|
||||
var lastDialog = dialogs.dialogs[^1];
|
||||
var lastMsg = dialogs.messages.LastOrDefault(m => m.Peer.ID == lastDialog.Peer.ID && m.ID == lastDialog.TopMessage);
|
||||
var offsetPeer = dialogs.GetUserOrChat(lastDialog).ToInputPeer();
|
||||
var offsetPeer = dialogs.UserOrChat(lastDialog).ToInputPeer();
|
||||
dialogs = (Messages_Dialogs)await client.Messages_GetDialogs(lastMsg?.Date ?? default, lastDialog.TopMessage, offsetPeer, 500, 0);
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue