summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/src/avatars.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp
index 22121ccabe..de4d74f2ee 100644
--- a/protocols/Telegram/src/avatars.cpp
+++ b/protocols/Telegram/src/avatars.cpp
@@ -189,21 +189,18 @@ void CTelegramProto::ProcessFile(TD::updateFile *pObj)
CMStringW wszFullName(F->ofd->wszPath);
- // let's replace fake file name with the real one
- if (F->m_type != F->FILE) {
- auto *pSlash = strrchr(pFile->local_->path_.c_str(), '\\');
- if (!pSlash)
- pSlash = pFile->local_->path_.c_str();
- else
- pSlash++;
-
- dbv.type = DBVT_UTF8;
- dbv.pszVal = (char *)pSlash;
- db_event_setJson(F->ofd->hDbEvent, "f", &dbv);
-
- wszFullName.Truncate(wszFullName.ReverseFind('\\') + 1);
- wszFullName.Append(Utf2T(pSlash));
- }
+ auto *pSlash = strrchr(pFile->local_->path_.c_str(), '\\');
+ if (!pSlash)
+ pSlash = pFile->local_->path_.c_str();
+ else
+ pSlash++;
+
+ dbv.type = DBVT_UTF8;
+ dbv.pszVal = (char *)pSlash;
+ db_event_setJson(F->ofd->hDbEvent, "f", &dbv);
+
+ wszFullName.Truncate(wszFullName.ReverseFind('\\') + 1);
+ wszFullName.Append(Utf2T(pSlash));
MoveFileW(wszExistingFile, wszFullName);
NotifyEventHooks(g_plugin.m_hevEventEdited, 0, F->ofd->hDbEvent);