From 69b001f36e1df9bfc80effd0e7fb5333335c2d87 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Mar 2019 18:26:23 +0300 Subject: Notes & Reminders: - ANSI plugin became Unicode and therefore went under standard project templates; - globals.h renamed to stdafx.h, stdafx.cxx added to a project; - old pascal-style lists replaced with LIST<> templates; - massive code cleaning; - version bump --- src/core/stdmsg/src/msgoptions.cpp | 9 ++------- src/mir_app/src/chat_manager.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 432691a177..c45ced4938 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -47,11 +47,6 @@ static const fontOptionsList[] = { LPGENW("Other events"), RGB(90, 90, 160), L"Arial", 0, -12}, }; -static BYTE MsgDlgGetFontDefaultCharset(const wchar_t*) -{ - return DEFAULT_CHARSET; -} - bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) { if (i >= _countof(fontOptionsList)) @@ -88,7 +83,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) mir_wstrncpy(lf->lfFaceName, wszFontFace, _countof(lf->lfFaceName)); mir_snprintf(str, "SRMFont%dSet", i); - lf->lfCharSet = g_plugin.getByte(str, MsgDlgGetFontDefaultCharset(lf->lfFaceName)); + lf->lfCharSet = g_plugin.getByte(str, DEFAULT_CHARSET); } return true; } @@ -114,7 +109,7 @@ void RegisterSRMMFonts(void) fontid.deffontsettings.size = fontOptionsList[i].defSize; fontid.deffontsettings.style = fontOptionsList[i].defStyle; wcsncpy_s(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _TRUNCATE); - fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace); + fontid.deffontsettings.charset = DEFAULT_CHARSET; wcsncpy_s(fontid.backgroundGroup, LPGENW("Message sessions") L"/" LPGENW("Message log"), _TRUNCATE); wcsncpy_s(fontid.backgroundName, LPGENW("Background"), _TRUNCATE); g_plugin.addFont(&fontid); diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 2bedd3c536..2bb9b62b3f 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define WINDOWS_COMMANDS_MAX 30 +static USERINFO* UM_FindUser(SESSION_INFO *si, const wchar_t *pszUID); + static int CompareKeys(const USERINFO *u1, const USERINFO *u2) { return mir_wstrcmp(u1->pszUID, u2->pszUID); @@ -245,7 +247,7 @@ BOOL SM_RemoveUser(const wchar_t *pszID, const char *pszModule, const wchar_t *p if ((pszID && mir_wstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule)) continue; - USERINFO *ui = g_chatApi.UM_FindUser(si, pszUID); + USERINFO *ui = UM_FindUser(si, pszUID); if (ui) { if (g_chatApi.OnRemoveUser) g_chatApi.OnRemoveUser(si, ui); @@ -366,7 +368,7 @@ BOOL SM_ChangeNick(const wchar_t *pszID, const char *pszModule, GCEVENT *gce) for (auto &si : g_arSessions) { if ((!pszID || !mir_wstrcmpi(si->ptszID, pszID)) && !mir_strcmpi(si->pszModule, pszModule)) { - USERINFO *ui = g_chatApi.UM_FindUser(si, gce->pszUID.w); + USERINFO *ui = UM_FindUser(si, gce->pszUID.w); if (ui) { replaceStrW(ui->pszNick, gce->pszText.w); UM_SortUser(si, ui->pszUID); -- cgit v1.2.3