summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-18 18:55:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-18 18:55:17 +0300
commitc62b3ef92f0499f00bd72581f2acc8f128e82ebb (patch)
tree1fb2e376aa74c817ae0e62512473b72652abed32 /src/mir_app
parent3c5a1a6af8e6cfbd53d0dacffc74819cb1eba2c9 (diff)
code cleaning
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/srmm_log_rtf.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mir_app/src/srmm_log_rtf.cpp b/src/mir_app/src/srmm_log_rtf.cpp
index 75290337af..27ebb7d127 100644
--- a/src/mir_app/src/srmm_log_rtf.cpp
+++ b/src/mir_app/src/srmm_log_rtf.cpp
@@ -201,11 +201,14 @@ INT_PTR CRtfLogWindow::Notify(WPARAM, LPARAM lParam)
GetTempPathW(_countof(tszTempPath), tszTempPath);
CMStringW tszFilePath(FORMAT, L"%s%s", tszTempPath, blob.getName());
- if (_waccess(tszFilePath, 0)) {
+ struct _stat st = {};
+ _wstat(tszFilePath, &st);
+ if (st.st_size && st.st_size == blob.getSize() && st.st_size == blob.getTransferred())
+ ShellExecute(nullptr, L"open", tszFilePath.c_str(), nullptr, nullptr, SW_SHOWDEFAULT);
+ else {
OFDTHREAD *dt = new OFDTHREAD(hDbEvent, tszFilePath);
CallProtoService(dbei.szModule, PS_OFFLINEFILE, (WPARAM)dt, 0);
}
- else ShellExecute(nullptr, L"open", tszFilePath.c_str(), nullptr, nullptr, SW_SHOWDEFAULT);
return TRUE;
}