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

@ -295,11 +295,18 @@ namespace TLSharp.Core.Network
{
// gzip_packed
byte[] packedData = Serializers.Bytes.read(messageReader);
using (var packedStream = new MemoryStream(packedData, false))
using (var zipStream = new GZipStream(packedStream, CompressionMode.Decompress))
using (var compressedReader = new BinaryReader(zipStream))
using (var ms = new MemoryStream())
{
request.OnResponse(compressedReader);
using (var packedStream = new MemoryStream(packedData, false))
using (var zipStream = new GZipStream(packedStream, CompressionMode.Decompress))
{
zipStream.CopyTo(ms);
ms.Position = 0;
}
using (var compressedReader = new BinaryReader(ms))
{
request.OnResponse(compressedReader);
}
}
}
catch (ZlibException ex)