Fix unencrypted message sending issue after switch to Intermediate protocol

This commit is contained in:
Wizou 2021-09-17 15:09:12 +02:00
parent 37974c70b7
commit f66872cb32

View file

@ -368,7 +368,7 @@ namespace WTelegram
writer.Write(0); // int32 message_data_length (to be patched)
var typeName = func(writer); // bytes message_data
Helpers.Log(1, $"Sending {typeName}...");
BinaryPrimitives.WriteInt32LittleEndian(memStream.GetBuffer().AsSpan(24), (int)memStream.Length - 28); // patch message_data_length
BinaryPrimitives.WriteInt32LittleEndian(memStream.GetBuffer().AsSpan(20), (int)memStream.Length - 24); // patch message_data_length
}
else
{