From a299c1f9e8ef1f19b69096fff7de306e28a33de4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 23:35:46 +0300 Subject: [PATCH] fixed upload of files --- Telegram/SourceFiles/mtproto/facade.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/facade.h b/Telegram/SourceFiles/mtproto/facade.h index 2c58d4d3f..dfd5f22ad 100644 --- a/Telegram/SourceFiles/mtproto/facade.h +++ b/Telegram/SourceFiles/mtproto/facade.h @@ -122,8 +122,9 @@ namespace internal { // send(req, callbacks, MTP::uplDcId(index)) - for upload shifted dc id // uploading always to the main dc so bareDcId == 0 -inline ShiftedDcId uplDcId(DcId dcId) { - return internal::uploadDcId(dcId, 0); +inline ShiftedDcId uplDcId(int index) { + t_assert(index >= 0 && index < MTPUploadSessionsCount); + return internal::uploadDcId(0, index); }; constexpr bool isUplDcId(ShiftedDcId shiftedDcId) { return (shiftedDcId >= internal::uploadDcId(0, 0)) && (shiftedDcId < internal::uploadDcId(0, MTPUploadSessionsCount - 1) + DCShift);