summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-07 20:55:50 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-07 20:55:50 +0300
commit047bfc1ee1b4574823062dd9a8061f0463f42816 (patch)
treed2940f631e3831fb3bc8a333e36f1c14d0a0a38d
parent59f9df67537382bd0249c4e617fe472a1bf4087a (diff)
fixes #4691 (NewStory: добавить возможность редактировать событие передачи файла)
-rw-r--r--plugins/NewStory/src/history_control.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 4b2082582d..1222ed338f 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -227,8 +227,6 @@ void NewstoryListData::BeginEditItem()
return;
ItemData *item = LoadItem(caret);
- if (item->dbe.eventType != EVENTTYPE_MESSAGE)
- return;
RECT rc; GetClientRect(m_hwnd, &rc);
int height = rc.bottom - rc.top, width = rc.right - rc.left;
@@ -261,6 +259,9 @@ void NewstoryListData::BeginEditItem()
mir_subclassWindow(hwndEditBox, HistoryEditWndProc);
SendMessage(hwndEditBox, WM_SETFONT, (WPARAM)g_fontTable[fontid].hfnt, 0);
SendMessage(hwndEditBox, EM_SETMARGINS, EC_RIGHTMARGIN, 100);
+ if (item->dbe.eventType != EVENTTYPE_MESSAGE)
+ SendMessage(hwndEditBox, EM_SETREADONLY, TRUE, 0);
+
ShowWindow(hwndEditBox, SW_SHOW);
SetFocus(hwndEditBox);
SetForegroundWindow(hwndEditBox);
@@ -1477,7 +1478,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
auto *pItem = data->LoadItem(idx);
pt.y -= pItem->savedTop;
- if (pItem->m_bOfflineFile) {
+ if (pItem->m_bOfflineFile && !pItem->m_bOfflineDownloaded) {
Srmm_DownloadOfflineFile(pItem->dbe.hContact, pItem->dbe.getEvent(), OFD_DOWNLOAD | OFD_RUN);
return 0;
}