From b7928747cf0f8e53a01ee4628c58559862a9a689 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 25 May 2023 18:36:42 +0300 Subject: NewStory: small fixes --- plugins/NewStory/src/history_array.cpp | 17 +++++++++++++---- plugins/NewStory/src/history_array.h | 1 + plugins/NewStory/src/history_control.cpp | 5 ++++- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 51139dd075..0bcb7e8f9b 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -49,7 +49,10 @@ bool Filter::check(ItemData *item) void ItemData::checkCreate(HWND hwnd) { if (data == nullptr) { - data = MTextCreateW(htuLog, Proto_GetBaseAccountName(hContact), ptrW(TplFormatString(getTemplate(), hContact, this))); + if (bRtf) + data = MTextCreateEx(htuLog, this->wtext, MTEXT_FLG_WCHAR | MTEXT_FLG_RTF); + else + data = MTextCreateW(htuLog, Proto_GetBaseAccountName(hContact), ptrW(TplFormatString(getTemplate(), hContact, this))); MTextSetParent(data, hwnd); MTextActivate(data, true); } @@ -124,12 +127,18 @@ void ItemData::load(bool bFullLoad) break; case EVENTTYPE_FILE: - wchar_t buf[MAX_PATH]; - CallService(MS_FILE_GETRECEIVEDFILESFOLDERW, hContact, (LPARAM)buf); { + CMStringW wszFileName; DB::FILE_BLOB blob(dbe); + if (blob.isOffline()) { + wszFileName = Srmm_GetOfflineFileName(hContact); + } + else { + wchar_t buf[MAX_PATH]; + CallService(MS_FILE_GETRECEIVEDFILESFOLDERW, hContact, (LPARAM)buf); - CMStringW wszFileName(buf); + wszFileName = buf; + } wszFileName.Append(blob.getName()); // if a filename contains spaces, URL will be broken diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h index 1df5ee2c76..6401ff1644 100644 --- a/plugins/NewStory/src/history_array.h +++ b/plugins/NewStory/src/history_array.h @@ -8,6 +8,7 @@ struct ItemData bool bSelected; bool bLoaded; + bool bRtf; int savedTop; DB::EventInfo dbe; diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index bcb75402f8..e57b8ac52a 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -119,6 +119,9 @@ struct NewstoryListData : public MZeroedObject } ItemData *item = items[index]; + if (item->dbe.eventType != EVENTTYPE_MESSAGE) + return; + int fontid, colorid; item->getFontColor(fontid, colorid); @@ -946,7 +949,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM void InitNewstoryControl() { - htuLog = MTextRegister("Newstory", MTEXT_FANCY_DEFAULT | MTEXT_SYSTEM_HICONS); + htuLog = MTextRegister("Newstory", MTEXT_FANCY_DEFAULT | MTEXT_SYSTEM_HICONS | MTEXT_FANCY_SMILEYS); WNDCLASS wndclass = {}; wndclass.style = /*CS_HREDRAW | CS_VREDRAW | */CS_DBLCLKS | CS_GLOBALCLASS; -- cgit v1.2.3