From 7ac76209b3be21486566f8228924a050fd37c1fb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 25 Dec 2024 13:08:37 +0300 Subject: =?UTF-8?q?fixes=20#4816=20(Telegram:=20=D0=B2=D0=B8=D0=B4=D0=B5?= =?UTF-8?q?=D0=BE=20=D0=B2=D1=81=D0=B5=D0=B3=D0=B4=D0=B0=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20?= =?UTF-8?q?=D0=BA=D0=B0=D0=BA=20=D1=84=D0=B0=D0=B9=D0=BB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/utils.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'protocols/Telegram/src') diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index 4d06f7b807..030805d8ae 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -155,11 +155,12 @@ TG_FILE_REQUEST::Type AutoDetectType(const wchar_t *pwszFilename) if (idx == -1 || path.Find('\\', idx) != -1) return TG_FILE_REQUEST::FILE; - auto wszExt = path.Right(path.GetLength() - idx); + auto wszExt = path.Right(path.GetLength() - idx - 1); wszExt.MakeLower(); if (wszExt == L"mp4" || wszExt == L"webm") return TG_FILE_REQUEST::VIDEO; - else if (wszExt == L"mp3" || wszExt == "ogg" || wszExt == "oga" || wszExt == "wav") + + if (wszExt == L"mp3" || wszExt == "ogg" || wszExt == "oga" || wszExt == "wav") return TG_FILE_REQUEST::VOICE; return TG_FILE_REQUEST::FILE; -- cgit v1.2.3