summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-12-25 13:08:37 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-12-25 13:08:37 +0300
commit7ac76209b3be21486566f8228924a050fd37c1fb (patch)
tree655041a9fcebdb2bd03ea525ce698b99cc1d2088 /protocols/Telegram/src/utils.cpp
parentb699ab413cc20014e29783e79f9b214961a8ce0b (diff)
fixes #4816 (Telegram: видео всегда отправляется как файл)
Diffstat (limited to 'protocols/Telegram/src/utils.cpp')
-rw-r--r--protocols/Telegram/src/utils.cpp5
1 files changed, 3 insertions, 2 deletions
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;