diff options
author | George Hazan <george.hazan@gmail.com> | 2023-08-04 18:23:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-08-04 18:23:57 +0300 |
commit | 1cbdcde34f1d6fbcdb80317fa16c3dd8131f542f (patch) | |
tree | d438efaae235298c6498ad83bdfdc1cfbdb0cc82 | |
parent | e215b9e602c3a3e4dd9ee2b9f9d1bb6bad9e4060 (diff) |
for #3530 (Bookmarks)
-rw-r--r-- | include/m_database.h | 3 | ||||
-rw-r--r-- | libs/mTextControl/src/fancy_rtf.cpp | 9 | ||||
-rw-r--r-- | plugins/NewStory/res/resource.rc | 43 | ||||
-rw-r--r-- | plugins/NewStory/res/star.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 19 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.h | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/history_dlg.cpp | 48 | ||||
-rw-r--r-- | plugins/NewStory/src/history_menus.cpp | 10 | ||||
-rw-r--r-- | plugins/NewStory/src/main.cpp | 49 | ||||
-rw-r--r-- | plugins/NewStory/src/options.cpp | 11 | ||||
-rw-r--r-- | plugins/NewStory/src/resource.h | 43 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 63 | ||||
-rw-r--r-- | plugins/Scriver/src/msglog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/proto_interface.cpp | 2 |
16 files changed, 172 insertions, 135 deletions
diff --git a/include/m_database.h b/include/m_database.h index c9eeb2247e..e227badc18 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -178,7 +178,8 @@ struct DBVARIANT #define DBEF_ENCRYPTED 0x0020 // event is encrypted (never reported outside a driver)
#define DBEF_HAS_ID 0x0040 // event has unique server id
#define DBEF_SECURE 0x0080 // event is encrypted
-#define DBEF_SECURE_STRONG 0x0100 // event has unique server id
+#define DBEF_STRONG 0x0100 // event is encrypted by the verified sender
+#define DBEF_BOOKMARK 0x0200 // event is bookmarked
struct DBEVENTINFO
{
diff --git a/libs/mTextControl/src/fancy_rtf.cpp b/libs/mTextControl/src/fancy_rtf.cpp index 18e1232120..d7beb7000c 100644 --- a/libs/mTextControl/src/fancy_rtf.cpp +++ b/libs/mTextControl/src/fancy_rtf.cpp @@ -88,12 +88,11 @@ static bool bbCodeImageFunc(CFormattedTextDraw *ftd, CHARRANGE range, wchar_t *t ts->TxSendMessage(EM_GETOLEINTERFACE, 0, (LPARAM)&RichEditOle, &lResult); td->Freeze(&cnt); - #ifdef _WIN64 - bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi64(txt))); - #else - bool res = InsertBitmap(RichEditOle, CacheIconToEmf((HICON)_wtoi(txt))); - #endif + HICON hIcon; + if (!swscanf(txt, L"%p", &hIcon)) + return false; + bool res = InsertBitmap(RichEditOle, CacheIconToEmf(hIcon)); td->Unfreeze(&cnt); RichEditOle->Release(); return res; diff --git a/plugins/NewStory/res/resource.rc b/plugins/NewStory/res/resource.rc index 9d59a47de1..2fd6cfba4d 100644 --- a/plugins/NewStory/res/resource.rc +++ b/plugins/NewStory/res/resource.rc @@ -26,48 +26,49 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -ICO_NEWSTORY ICON "newstory.ico" +IDI_NEWSTORY ICON "newstory.ico" -ICO_USERINFO ICON "userinfo.ico" +IDI_USERINFO ICON "userinfo.ico" -ICO_USERMENU ICON "usermenu.ico" +IDI_USERMENU ICON "usermenu.ico" -ICO_SEARCH ICON "search.ico" +IDI_SEARCH ICON "search.ico" -ICO_OPTIONS ICON "options.ico" +IDI_OPTIONS ICON "options.ico" -ICO_FILTER ICON "filter.ico" +IDI_FILTER ICON "filter.ico" -ICO_EXPORT ICON "export.ico" +IDI_EXPORT ICON "export.ico" -ICO_COPY ICON "copy.ico" +IDI_COPY ICON "copy.ico" -ICO_SENDMSG ICON "sendmsg.ico" +IDI_SENDMSG ICON "sendmsg.ico" -ICO_MSGIN ICON "msgin.ico" +IDI_MSGIN ICON "msgin.ico" -ICO_MSGOUT ICON "msgout.ico" +IDI_MSGOUT ICON "msgout.ico" -ICO_SIGNIN ICON "signin.ico" +IDI_SIGNIN ICON "signin.ico" -ICO_UNKNOWN ICON "unknown.ico" +IDI_UNKNOWN ICON "unknown.ico" -ICO_FINDPREV ICON "findprev.ico" +IDI_FINDPREV ICON "findprev.ico" -ICO_FINDNEXT ICON "findnext.ico" +IDI_FINDNEXT ICON "findnext.ico" -ICO_CALENDAR ICON "calendar.ico" +IDI_CALENDAR ICON "calendar.ico" -ICO_RESET ICON "reset.ico" +IDI_RESET ICON "reset.ico" -ICO_PREVIEW ICON "reload.ico" +IDI_PREVIEW ICON "reload.ico" -ICO_VARHELP ICON "vars.ico" +IDI_VARHELP ICON "vars.ico" -ICO_TPLGROUP ICON "folder.ico" +IDI_TPLGROUP ICON "folder.ico" -ICO_TIMETREE ICON "timetree.ico" +IDI_TIMETREE ICON "timetree.ico" +IDI_BOOKMARK ICON "star.ico" ///////////////////////////////////////////////////////////////////////////// // diff --git a/plugins/NewStory/res/star.ico b/plugins/NewStory/res/star.ico Binary files differnew file mode 100644 index 0000000000..d9343d938e --- /dev/null +++ b/plugins/NewStory/res/star.ico diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index ec4c670afa..ecbd6d669e 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -428,6 +428,20 @@ void NewstoryListData::SetSelection(int iFirst, int iLast) InvalidateRect(hwnd, 0, FALSE); } +void NewstoryListData::ToggleBookmark() +{ + if (auto *p = GetItem(caret)) { + if (p->dbe.flags & DBEF_BOOKMARK) + p->dbe.flags &= ~DBEF_BOOKMARK; + else + p->dbe.flags |= DBEF_BOOKMARK; + db_event_edit(p->hEvent, &p->dbe); + + p->setText(); + InvalidateRect(hwnd, 0, FALSE); + } +} + void NewstoryListData::ToggleSelection(int iFirst, int iLast) { int start = min(totalCount - 1, iFirst); @@ -749,6 +763,11 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM data->bWasShift = isShift; switch (wParam) { + case 'B': + if (isCtrl) + data->ToggleBookmark(); + break; + case VK_UP: data->LineUp(); break; diff --git a/plugins/NewStory/src/history_control.h b/plugins/NewStory/src/history_control.h index cbcdbc3b3d..4d2b8418e7 100644 --- a/plugins/NewStory/src/history_control.h +++ b/plugins/NewStory/src/history_control.h @@ -105,6 +105,7 @@ struct NewstoryListData : public MZeroedObject void SetCaret(int idx, bool bEnsureVisible); void SetPos(int pos); void SetSelection(int iFirst, int iLast); + void ToggleBookmark(); void ToggleSelection(int iFirst, int iLast); void LineUp() diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp index e97641f381..fb40f3d6a8 100644 --- a/plugins/NewStory/src/history_dlg.cpp +++ b/plugins/NewStory/src/history_dlg.cpp @@ -279,19 +279,19 @@ public: m_timeTree(this, IDC_TIMETREEVIEW), m_histControl(this, IDC_HISTORYCONTROL), edtSearchText(this, IDC_SEARCHTEXT), - btnCopy(this, IDC_COPY, g_plugin.getIcon(ICO_COPY), LPGEN("Copy")), - btnExport(this, IDC_EXPORT, g_plugin.getIcon(ICO_EXPORT), LPGEN("Export...")), + btnCopy(this, IDC_COPY, g_plugin.getIcon(IDI_COPY), LPGEN("Copy")), + btnExport(this, IDC_EXPORT, g_plugin.getIcon(IDI_EXPORT), LPGEN("Export...")), btnDelete(this, IDC_DELETE, Skin_LoadIcon(SKINICON_OTHER_DELETE), LPGEN("Delete...")), - btnFilter(this, IDC_FILTER, g_plugin.getIcon(ICO_FILTER), LPGEN("Filter")), - btnSearch(this, IDC_SEARCH, g_plugin.getIcon(ICO_SEARCH), LPGEN("Search...")), - btnOptions(this, IDC_LOGOPTIONS, g_plugin.getIcon(ICO_OPTIONS), LPGEN("Options")), - btnSendMsg(this, IDC_MESSAGE, g_plugin.getIcon(ICO_SENDMSG), LPGEN("Send message")), - btnCalendar(this, IDC_DATEPOPUP, g_plugin.getIcon(ICO_CALENDAR), LPGEN("Jump to date")), - btnUserInfo(this, IDC_USERINFO, g_plugin.getIcon(ICO_USERINFO), LPGEN("User info")), - btnUserMenu(this, IDC_USERMENU, g_plugin.getIcon(ICO_USERMENU), LPGEN("User menu")), - btnFindNext(this, IDOK, g_plugin.getIcon(ICO_FINDNEXT), LPGEN("Find next")), - btnFindPrev(this, IDC_FINDPREV, g_plugin.getIcon(ICO_FINDPREV), LPGEN("Find previous")), - btnTimeTree(this, IDC_TIMETREE, g_plugin.getIcon(ICO_TIMETREE), LPGEN("Conversations")) + btnFilter(this, IDC_FILTER, g_plugin.getIcon(IDI_FILTER), LPGEN("Filter")), + btnSearch(this, IDC_SEARCH, g_plugin.getIcon(IDI_SEARCH), LPGEN("Search...")), + btnOptions(this, IDC_LOGOPTIONS, g_plugin.getIcon(IDI_OPTIONS), LPGEN("Options")), + btnSendMsg(this, IDC_MESSAGE, g_plugin.getIcon(IDI_SENDMSG), LPGEN("Send message")), + btnCalendar(this, IDC_DATEPOPUP, g_plugin.getIcon(IDI_CALENDAR), LPGEN("Jump to date")), + btnUserInfo(this, IDC_USERINFO, g_plugin.getIcon(IDI_USERINFO), LPGEN("User info")), + btnUserMenu(this, IDC_USERMENU, g_plugin.getIcon(IDI_USERMENU), LPGEN("User menu")), + btnFindNext(this, IDOK, g_plugin.getIcon(IDI_FINDNEXT), LPGEN("Find next")), + btnFindPrev(this, IDC_FINDPREV, g_plugin.getIcon(IDI_FINDPREV), LPGEN("Find previous")), + btnTimeTree(this, IDC_TIMETREE, g_plugin.getIcon(IDI_TIMETREE), LPGEN("Conversations")) { m_timeTree.OnSelChanged = Callback(this, &CHistoryDlg::onSelChanged_TimeTree); @@ -439,25 +439,25 @@ public: m_histControl.SendMsg(NSM_SET_CONTACT, m_hContact, 0); m_histControl.SendMsg(NSM_SEEKEND, 0, 0); - Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(ICO_NEWSTORY)); + Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_NEWSTORY)); - SendMessage(GetDlgItem(m_hwnd, IDC_SEARCHICON), STM_SETICON, (WPARAM)g_plugin.getIcon(ICO_SEARCH), 0); + SendMessage(GetDlgItem(m_hwnd, IDC_SEARCHICON), STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_SEARCH), 0); - SendMessage(ibMessages.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(ICO_SENDMSG), 0); - SendMessage(ibMessages.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); - SendMessage(ibMessages.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); + SendMessage(ibMessages.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(IDI_SENDMSG), 0); + SendMessage(ibMessages.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); + SendMessage(ibMessages.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); SendMessage(ibFiles.hwndIco, STM_SETICON, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_FILE), 0); - SendMessage(ibFiles.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); - SendMessage(ibFiles.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); + SendMessage(ibFiles.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); + SendMessage(ibFiles.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); SendMessage(ibUrls.hwndIco, STM_SETICON, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_URL), 0); - SendMessage(ibUrls.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); - SendMessage(ibUrls.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); + SendMessage(ibUrls.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); + SendMessage(ibUrls.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); - SendMessage(ibTotal.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(ICO_UNKNOWN), 0); - SendMessage(ibTotal.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); - SendMessage(ibTotal.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); + SendMessage(ibTotal.hwndIco, STM_SETICON, (LPARAM)g_plugin.getIcon(IDI_UNKNOWN), 0); + SendMessage(ibTotal.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGIN)); + SendMessage(ibTotal.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_MSGOUT)); ShowHideControls(); TimeTreeBuild(); diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp index 97ee756b9b..5da0cc1070 100644 --- a/plugins/NewStory/src/history_menus.cpp +++ b/plugins/NewStory/src/history_menus.cpp @@ -57,6 +57,10 @@ static INT_PTR NSMenuHelper(WPARAM wParam, LPARAM lParam) SendMessage(pData->hwnd, NSM_DOWNLOAD, 0, OFD_DOWNLOAD); break; + case 7: + pData->ToggleBookmark(); + break; + default: if (auto *pDlg = pData->pMsgDlg) { PostMessage(pDlg->GetHwnd(), WM_MOUSEACTIVATE, 0, 0); @@ -120,7 +124,7 @@ void InitMenus() mi.name.a = LPGEN("User history"); mi.position = 1000090000; mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY; - mi.hIcolibItem = g_plugin.getIconHandle(ICO_NEWSTORY); + mi.hIcolibItem = g_plugin.getIconHandle(IDI_NEWSTORY); hmiHistory = Menu_AddContactMenuItem(&mi); CreateServiceFunction(mi.pszService, svcShowNewstory); @@ -171,6 +175,10 @@ void InitMenus() mi.name.a = LPGEN("Delete"); Menu_AddNewStoryMenuItem(&mi, 3); + mi.position = 200002; + mi.name.a = LPGEN("Toggle bookmark"); + Menu_AddNewStoryMenuItem(&mi, 7); + mi.position = 300000; mi.name.a = LPGEN("Select all"); Menu_AddNewStoryMenuItem(&mi, 4); diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index a50bc01e36..082497a41f 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -49,30 +49,31 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIHIST static IconItem icons[] = { - { LPGEN("Main icon"), "main", ICO_NEWSTORY }, - { LPGEN("User info"), "userinfo", ICO_USERINFO }, - { LPGEN("User menu"), "usermenu", ICO_USERMENU }, - { LPGEN("Search"), "search", ICO_SEARCH }, - { LPGEN("Options"), "options", ICO_OPTIONS }, - { LPGEN("Filter"), "filter", ICO_FILTER }, - { LPGEN("Export"), "export", ICO_EXPORT }, - { LPGEN("Copy"), "copy", ICO_COPY }, - { LPGEN("Send message"), "message", ICO_SENDMSG }, - - { LPGEN("Incoming message"), "msgin", ICO_MSGIN }, - { LPGEN("Outgoing message"), "msgout", ICO_MSGOUT }, - { LPGEN("User signed in"), "signin", ICO_SIGNIN }, - { LPGEN("Unknown event"), "unknown", ICO_UNKNOWN }, - - { LPGEN("Find previous"), "findprev", ICO_FINDPREV }, - { LPGEN("Find next"), "findnext", ICO_FINDNEXT }, - { LPGEN("Jump to date"), "calendar", ICO_CALENDAR }, - { LPGEN("Conversations"), "timetree", ICO_TIMETREE }, - - { LPGEN("Template group"), "tplgroup", ICO_TPLGROUP }, - { LPGEN("Cancel edit"), "reset", ICO_RESET }, - { LPGEN("Update preview"), "preview", ICO_PREVIEW }, - { LPGEN("Help"), "varhelp", ICO_VARHELP } + { LPGEN("Main icon"), "main", IDI_NEWSTORY }, + { LPGEN("User info"), "userinfo", IDI_USERINFO }, + { LPGEN("User menu"), "usermenu", IDI_USERMENU }, + { LPGEN("Search"), "search", IDI_SEARCH }, + { LPGEN("Options"), "options", IDI_OPTIONS }, + { LPGEN("Filter"), "filter", IDI_FILTER }, + { LPGEN("Export"), "export", IDI_EXPORT }, + { LPGEN("Copy"), "copy", IDI_COPY }, + { LPGEN("Bookmark"), "bookmark", IDI_BOOKMARK }, + { LPGEN("Send message"), "message", IDI_SENDMSG }, + + { LPGEN("Incoming message"), "msgin", IDI_MSGIN }, + { LPGEN("Outgoing message"), "msgout", IDI_MSGOUT }, + { LPGEN("User signed in"), "signin", IDI_SIGNIN }, + { LPGEN("Unknown event"), "unknown", IDI_UNKNOWN }, + + { LPGEN("Find previous"), "findprev", IDI_FINDPREV }, + { LPGEN("Find next"), "findnext", IDI_FINDNEXT }, + { LPGEN("Jump to date"), "calendar", IDI_CALENDAR }, + { LPGEN("Conversations"), "timetree", IDI_TIMETREE }, + + { LPGEN("Template group"), "tplgroup", IDI_TPLGROUP }, + { LPGEN("Cancel edit"), "reset", IDI_RESET }, + { LPGEN("Update preview"), "preview", IDI_PREVIEW }, + { LPGEN("Help"), "varhelp", IDI_VARHELP } }; static int evtEventAdded(WPARAM hContact, LPARAM lParam) diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index 4e7e6372be..b315ac78c3 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -83,9 +83,9 @@ public: preview(this, IDC_PREVIEW), gpreview(this, IDC_GPREVIEW), btnReset(this, IDC_RESET, Skin_LoadIcon(SKINICON_OTHER_UNDO), LPGEN("Reset to default")), - btnDiscard(this, IDC_DISCARD, g_plugin.getIcon(ICO_RESET), LPGEN("Cancel edit")), - bthVarHelp(this, IDC_VARHELP, g_plugin.getIcon(ICO_VARHELP), LPGEN("Variables help")), - btnPreview(this, IDC_UPDATEPREVIEW, g_plugin.getIcon(ICO_PREVIEW), LPGEN("Update preview")) + btnDiscard(this, IDC_DISCARD, g_plugin.getIcon(IDI_RESET), LPGEN("Cancel edit")), + bthVarHelp(this, IDC_VARHELP, g_plugin.getIcon(IDI_VARHELP), LPGEN("Variables help")), + btnPreview(this, IDC_UPDATEPREVIEW, g_plugin.getIcon(IDI_PREVIEW), LPGEN("Update preview")) { btnReset.OnClick = Callback(this, &CTemplateOptsDlg::onClick_Reset); btnDiscard.OnClick = Callback(this, &CTemplateOptsDlg::onClick_Discard); @@ -100,7 +100,7 @@ public: HIMAGELIST himgTree = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 1, 1); m_tree.SetImageList(himgTree, TVSIL_NORMAL); - ImageList_AddIcon(himgTree, g_plugin.getIcon(ICO_TPLGROUP)); + ImageList_AddIcon(himgTree, g_plugin.getIcon(IDI_TPLGROUP)); m_hContact = db_add_contact(); Proto_AddToContact(m_hContact, META_PROTO); @@ -111,7 +111,8 @@ public: DBEVENTINFO dbei = {}; dbei.pBlob = (uint8_t *)Translate("The quick brown fox jumps over the lazy dog."); dbei.cbBlob = (uint32_t)strlen((char *)dbei.pBlob); - dbei.flags = DBEF_TEMPORARY; + dbei.flags = DBEF_TEMPORARY | DBEF_BOOKMARK; + dbei.szModule = MODULENAME; dbei.eventType = EVENTTYPE_MESSAGE; dbei.timestamp = time(0); m_hDbEVent = db_event_add(m_hContact, &dbei); diff --git a/plugins/NewStory/src/resource.h b/plugins/NewStory/src/resource.h index 13bc660309..4a07545c30 100644 --- a/plugins/NewStory/src/resource.h +++ b/plugins/NewStory/src/resource.h @@ -7,27 +7,28 @@ #define IDD_OPT_ADVANCED 103 #define IDD_CALENDARTOOL 104 #define IDR_POPUPS 105 -#define ICO_NEWSTORY 107 -#define ICO_USERINFO 108 -#define ICO_USERMENU 109 -#define ICO_SEARCH 110 -#define ICO_OPTIONS 111 -#define ICO_FILTER 112 -#define ICO_EXPORT 113 -#define ICO_COPY 114 -#define ICO_SENDMSG 115 -#define ICO_MSGIN 116 -#define ICO_MSGOUT 117 -#define ICO_SIGNIN 118 -#define ICO_UNKNOWN 121 -#define ICO_FINDPREV 122 -#define ICO_FINDNEXT 123 -#define ICO_CALENDAR 124 -#define ICO_TPLGROUP 125 -#define ICO_RESET 126 -#define ICO_PREVIEW 127 -#define ICO_VARHELP 128 -#define ICO_TIMETREE 129 +#define IDI_BOOKMARK 106 +#define IDI_NEWSTORY 107 +#define IDI_USERINFO 108 +#define IDI_USERMENU 109 +#define IDI_SEARCH 110 +#define IDI_OPTIONS 111 +#define IDI_FILTER 112 +#define IDI_EXPORT 113 +#define IDI_COPY 114 +#define IDI_SENDMSG 115 +#define IDI_MSGIN 116 +#define IDI_MSGOUT 117 +#define IDI_SIGNIN 118 +#define IDI_UNKNOWN 121 +#define IDI_FINDPREV 122 +#define IDI_FINDNEXT 123 +#define IDI_CALENDAR 124 +#define IDI_TPLGROUP 125 +#define IDI_RESET 126 +#define IDI_PREVIEW 127 +#define IDI_VARHELP 128 +#define IDI_TIMETREE 129 #define IDC_USERINFO 1000 #define IDC_USERMENU 1001 #define IDC_MESSAGE 1002 diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 9f01361462..ee0375e595 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -160,28 +160,33 @@ void vfEvent(int, TemplateVars *vars, MCONTACT, ItemData *item) // %I: Icon switch (item->dbe.eventType) { case EVENTTYPE_MESSAGE: - hIcon = g_plugin.getIcon(ICO_SENDMSG); + hIcon = g_plugin.getIcon(IDI_SENDMSG); break; case EVENTTYPE_FILE: hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE); break; case EVENTTYPE_STATUSCHANGE: - hIcon = g_plugin.getIcon(ICO_SIGNIN); + hIcon = g_plugin.getIcon(IDI_SIGNIN); break; default: - hIcon = g_plugin.getIcon(ICO_UNKNOWN); + hIcon = g_plugin.getIcon(IDI_UNKNOWN); break; } - mir_snwprintf(buf, L"[$hicon=%d$]", hIcon); + mir_snwprintf(buf, L"[$hicon=%p$]", hIcon); vars->SetVar('I', buf, true); + if (item->dbe.flags & DBEF_BOOKMARK) { + mir_snwprintf(buf, L"[$hicon=%p$]", g_plugin.getIcon(IDI_BOOKMARK)); + vars->SetVar('B', buf, true); + } + // %i: Direction icon if (item->dbe.flags & DBEF_SENT) - hIcon = g_plugin.getIcon(ICO_MSGOUT); + hIcon = g_plugin.getIcon(IDI_MSGOUT); else - hIcon = g_plugin.getIcon(ICO_MSGIN); + hIcon = g_plugin.getIcon(IDI_MSGIN); - mir_snwprintf(buf, L"[$hicon=%d$]", hIcon); + mir_snwprintf(buf, L"[$hicon=%p$]", hIcon); vars->SetVar('i', buf, true); // %D: direction symbol @@ -297,40 +302,40 @@ HICON TemplateInfo::getIcon() const TemplateInfo templates[TPL_COUNT] = { - { "tpl/interface/title", LPGENW("Interface"), ICO_NEWSTORY, LPGENW("Window title"), + { "tpl/interface/title", LPGENW("Interface"), IDI_NEWSTORY, LPGENW("Window title"), LPGENW("%N - history [%c messages total]"), 0, 0, { vfGlobal, vfContact, 0, 0, 0 } }, - { "tpl/msglog/msg", LPGENW("Message log"), ICO_SENDMSG, LPGENW("Messages"), - L"%I%i[b][color=red]%N[/color], %t:[/b]\x0d\x0a%M", 0, 0, + { "tpl/msglog/msg", LPGENW("Message log"), IDI_SENDMSG, LPGENW("Messages"), + L"%I%i%B[b][color=red]%N[/color], %t:[/b]\x0d\x0a%M", 0, 0, { vfGlobal, vfContact, vfEvent, vfMessage, 0 } }, - { "tpl/msglog/msg_grp", LPGENW("Message log"), ICO_SENDMSG, LPGENW("Grouped messages"), - L"%I%i[b]%t:[/b] %M", 0, 0, + { "tpl/msglog/msg_grp", LPGENW("Message log"), IDI_SENDMSG, LPGENW("Grouped messages"), + L"%I%i%B[b]%t:[/b] %M", 0, 0, { vfGlobal, vfContact, vfEvent, vfMessage, 0 } }, { "tpl/msglog/file", LPGENW("Message log"), -SKINICON_EVENT_FILE, LPGENW("Files"), - L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, + L"%I%i%B[b]%N, %t:[/b]%n%M", 0, 0, { vfGlobal, vfContact, vfEvent, vfFile, 0 } }, - { "tpl/msglog/status", LPGENW("Message log"), ICO_SIGNIN, LPGENW("Status changes"), - L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, + { "tpl/msglog/status", LPGENW("Message log"), IDI_SIGNIN, LPGENW("Status changes"), + L"%I%i%B[b]%N, %t:[/b]%n%M", 0, 0, { vfGlobal, vfContact, vfEvent, vfSign, 0 } }, - { "tpl/msglog/presense", LPGENW("Message log"), ICO_UNKNOWN, LPGENW("Presence requests"), - L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, + { "tpl/msglog/presense", LPGENW("Message log"), IDI_UNKNOWN, LPGENW("Presence requests"), + L"%I%i%B[b]%N, %t:[/b]%n%M", 0, 0, { vfGlobal, vfContact, vfEvent, vfPresence, 0 } }, - { "tpl/msglog/other", LPGENW("Message log"), ICO_UNKNOWN, LPGENW("Other events"), - L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, + { "tpl/msglog/other", LPGENW("Message log"), IDI_UNKNOWN, LPGENW("Other events"), + L"%I%i%B[b]%N, %t:[/b]%n%M", 0, 0, { vfGlobal, vfContact, vfEvent, vfOther, 0 } }, - { "tpl/msglog/authrq", LPGENW("Message log"), ICO_UNKNOWN, LPGENW("Authorization requests"), + { "tpl/msglog/authrq", LPGENW("Message log"), IDI_UNKNOWN, LPGENW("Authorization requests"), L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, { vfGlobal, vfEvent, vfSystem, vfAuth, 0 } }, - { "tpl/msglog/added", LPGENW("Message log"), ICO_UNKNOWN, LPGENW("'You were added' events"), + { "tpl/msglog/added", LPGENW("Message log"), IDI_UNKNOWN, LPGENW("'You were added' events"), L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, { vfGlobal, vfEvent, vfSystem, vfAdded, 0 } }, - { "tpl/msglog/deleted", LPGENW("Message log"), ICO_UNKNOWN, LPGENW("'You were deleted' events"), + { "tpl/msglog/deleted", LPGENW("Message log"), IDI_UNKNOWN, LPGENW("'You were deleted' events"), L"%I%i[b]%N, %t:[/b]%n%M", 0, 0, { vfGlobal, vfEvent, vfSystem, vfDeleted, 0 } }, - { "tpl/copy/msg", LPGENW("Clipboard"), ICO_SENDMSG, LPGENW("Messages"), + { "tpl/copy/msg", LPGENW("Clipboard"), IDI_SENDMSG, LPGENW("Messages"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfContact, vfEvent, vfMessage, 0 } }, { "tpl/copy/file", LPGENW("Clipboard"), -SKINICON_EVENT_FILE, LPGENW("Files"), @@ -339,23 +344,23 @@ TemplateInfo templates[TPL_COUNT] = { "tpl/copy/url", LPGENW("Clipboard"), -SKINICON_EVENT_URL, LPGENW("URLs"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfContact, vfEvent, vfUrl, 0 } }, - { "tpl/copy/status", LPGENW("Clipboard"), ICO_SIGNIN, LPGENW("Status changes"), + { "tpl/copy/status", LPGENW("Clipboard"), IDI_SIGNIN, LPGENW("Status changes"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfContact, vfEvent, vfSign, 0 } }, - { "tpl/copy/presence", LPGENW("Clipboard"), ICO_UNKNOWN, LPGENW("Presence requests"), + { "tpl/copy/presence", LPGENW("Clipboard"), IDI_UNKNOWN, LPGENW("Presence requests"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfContact, vfEvent, vfPresence, 0 } }, - { "tpl/copy/other", LPGENW("Clipboard"), ICO_UNKNOWN, LPGENW("Other events"), + { "tpl/copy/other", LPGENW("Clipboard"), IDI_UNKNOWN, LPGENW("Other events"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfContact, vfEvent, vfOther, 0 } }, - { "tpl/copy/authrq", LPGENW("Clipboard"), ICO_UNKNOWN, LPGENW("Authorization requests"), + { "tpl/copy/authrq", LPGENW("Clipboard"), IDI_UNKNOWN, LPGENW("Authorization requests"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfEvent, vfSystem, vfAuth, 0 } }, - { "tpl/copy/added", LPGENW("Clipboard"), ICO_UNKNOWN, LPGENW("'You were added' events"), + { "tpl/copy/added", LPGENW("Clipboard"), IDI_UNKNOWN, LPGENW("'You were added' events"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfEvent, vfSystem, vfAdded, 0 } }, - { "tpl/copy/deleted", LPGENW("Clipboard"), ICO_UNKNOWN, LPGENW("'You were deleted' events"), + { "tpl/copy/deleted", LPGENW("Clipboard"), IDI_UNKNOWN, LPGENW("'You were deleted' events"), L"%N, %t:\x0d\x0a%M%n", 0, 0, { vfGlobal, vfEvent, vfSystem, vfDeleted, 0 } } }; diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 4901a9f1fb..c653e4f93a 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -451,7 +451,7 @@ public: switch (dbei.eventType) {
case EVENTTYPE_MESSAGE:
- if (dbei.flags & (DBEF_SECURE | DBEF_SECURE_STRONG))
+ if (dbei.flags & (DBEF_SECURE | DBEF_STRONG))
i = (dbei.flags & DBEF_SECURE) ? LOGICON_MSG_SECURE : LOGICON_MSG_STRONG;
else if (dbei.flags & DBEF_SENT)
i = LOGICON_MSG_OUT;
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index b5fc4ca97a..aa049add8b 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -741,7 +741,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe if (dwEffectiveFlags & MWF_LOG_SHOWICONS) {
int icon;
if ((dwEffectiveFlags & MWF_LOG_INOUTICONS) && dbei.eventType == EVENTTYPE_MESSAGE) {
- if (dbei.flags & (DBEF_SECURE | DBEF_SECURE_STRONG))
+ if (dbei.flags & (DBEF_SECURE | DBEF_STRONG))
icon = (dbei.flags & DBEF_SECURE) ? LOGICON_SECURE : LOGICON_STRONG;
else
icon = isSent ? LOGICON_OUT : LOGICON_IN;
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 7daad7b64e..620f637f29 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -305,7 +305,7 @@ public: buf.Append("\\f0\\fs14");
buf.Append(pLogIconBmpBits[i]);
- if ((dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_FILE) && dbei.flags & (DBEF_SECURE | DBEF_SECURE_STRONG)) {
+ if ((dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_FILE) && dbei.flags & (DBEF_SECURE | DBEF_STRONG)) {
buf.Append("\\f0\\fs14");
buf.Append(pLogIconBmpBits[dbei.flags & DBEF_SECURE ? 3 : 4]);
}
diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp index b4621cf918..db4da573d8 100644 --- a/src/mir_app/src/proto_interface.cpp +++ b/src/mir_app/src/proto_interface.cpp @@ -228,7 +228,7 @@ MEVENT PROTO_INTERFACE::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) if (pre->flags & PREF_ENCRYPTED)
dbei.flags |= DBEF_SECURE;
if (pre->flags & PREF_ENCRYPTED_STRONG)
- dbei.flags |= DBEF_SECURE_STRONG;
+ dbei.flags |= DBEF_STRONG;
// if it's possible to find an existing event by its id, do that
if ((GetCaps(PFLAGNUM_4) & PF4_SERVERMSGID) && pre->szMsgId != nullptr) {
|