Fix issues with GetDialogs

Default value of max_id = 0 returns all dialogs
Should return a class with lists of dialog, messages, chats and users.
Add UserForeignConstructor to list of constructors
Add missing detail to DialogConstructor (PeerNotifySettings)
Unpack datastream completely to avoid issue with Ionic exception causing
problems in userForeign parsing
Use more recent code for Dialog construction
This commit is contained in:
David Woakes 2016-07-19 14:47:08 +01:00
parent b869a4f617
commit 8026bd79dc
4 changed files with 43 additions and 14 deletions

View file

@ -250,13 +250,19 @@ namespace TLSharp.Core
return Tuple.Create(request.type, request.bytes);
}
public async Task<List<Dialog>> GetDialogs(int offset, int limit, int max_id = -1)
public async Task<MessageDialogs> GetDialogs(int offset, int limit, int max_id = 0)
{
var request = new GetDialogsRequest(offset, max_id, limit);
await _sender.Send(request);
await _sender.Recieve(request);
return request.dialogs;
return new MessageDialogs
{
Dialogs = request.dialogs,
Messages = request.messages,
Chats = request.chats,
Users = request.users,
};
}
public async Task<UserFull> GetUserFull(int user_id)