diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ExternalAPI/m_text.h | 7 | ||||
-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 |
4 files changed, 22 insertions, 8 deletions
diff --git a/plugins/ExternalAPI/m_text.h b/plugins/ExternalAPI/m_text.h index 2039de8ba1..1c231c2fd2 100644 --- a/plugins/ExternalAPI/m_text.h +++ b/plugins/ExternalAPI/m_text.h @@ -42,17 +42,18 @@ enum // text object flags
MTEXT_FLG_CHAR = 0x00000000,
MTEXT_FLG_WCHAR = 0x00000001,
- MTEXT_FLG_BIDI_RTL = 0x00000002
+ MTEXT_FLG_BIDI_RTL = 0x00000002,
+ MTEXT_FLG_RTF = 0x00000004,
};
// subscribe to MText services
-MTEXTCONTROL_DLL(HANDLE) MTextRegister(const char *userTitle, DWORD options);
+MTEXTCONTROL_DLL(HANDLE) MTextRegister(const char *userTitle, uint32_t options);
// allocate text object (unicode)
MTEXTCONTROL_DLL(HText) MTextCreateW(HANDLE userHandle, const char *szProto, const wchar_t *text);
// allocate text object (advanced)
-MTEXTCONTROL_DLL(HText) MTextCreateEx(HANDLE userHandle, void *text, DWORD flags);
+MTEXTCONTROL_DLL(HText) MTextCreateEx(HANDLE userHandle, void *text, uint32_t flags);
// destroys text object
MTEXTCONTROL_DLL(int) MTextDestroy(HText text);
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; |