diff options
Diffstat (limited to 'protocols/Telegram/src/utils.cpp')
-rw-r--r-- | protocols/Telegram/src/utils.cpp | 5 |
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;
|