diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Telegram/src/avatars.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp index c5f60605ac..4a08866989 100644 --- a/protocols/Telegram/src/avatars.cpp +++ b/protocols/Telegram/src/avatars.cpp @@ -199,10 +199,11 @@ void CTelegramProto::ProcessFile(TD::updateFile *pObj) dbv.pszVal = (char *)pSlash;
db_event_setJson(F->ofd->hDbEvent, "f", &dbv);
- wszFullName.Truncate(wszFullName.ReverseFind('\\') + 1);
+ wszFullName.Truncate(wszFullName.ReverseFind('\\'));
wszFullName.Append(Utf2T(pSlash));
+ F->ofd->ResetFileName(wszFullName); // resulting ofd->wszPath may differ from wszFullName
- MoveFileW(wszExistingFile, wszFullName);
+ MoveFileW(wszExistingFile, F->ofd->wszPath);
NotifyEventHooks(g_plugin.m_hevEventEdited, 0, F->ofd->hDbEvent);
F->ofd->Finish();
|