diff options
author | George Hazan <george.hazan@gmail.com> | 2023-05-25 18:36:42 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-05-25 18:36:42 +0300 |
commit | b7928747cf0f8e53a01ee4628c58559862a9a689 (patch) | |
tree | 73ce33fe7e613afdedc4cfaf5d50d1c5c249fce1 /plugins/NewStory/src | |
parent | a30963d9f0a7561627f499b947caf78d4e6db2e2 (diff) |
NewStory: small fixes
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 17 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.h | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 5 |
3 files changed, 18 insertions, 5 deletions
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; |