diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-25 21:02:11 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-25 21:02:11 +0300 |
commit | 45bf5f51cc788cb8f19e1b8fcd5b8818dc7a2e00 (patch) | |
tree | 40a087f36b75b4c1fb7218bd06052df2968bf2d2 /plugins/TabSRMM/src | |
parent | 8ba9e423e683d570702476dd93571cea26a27c1a (diff) |
GCEVENT::GCEF_UTF8 - flag for direct communication with utf8-encoded chat events (UTF16LE by default)
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/chat_tools.cpp | 14 | ||||
-rw-r--r-- | plugins/TabSRMM/src/muchighlight.cpp | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index da5f904b30..cac75f3c7e 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -193,7 +193,7 @@ passed: if (iNewEvent == GC_EVENT_MESSAGE) {
ShowPopup(si->hContact, si, g_chatApi.hIcons[ICON_MESSAGE], si->pszModule, si->ptszName, clr ? clr : g_chatApi.aFonts[9].color,
- TranslateT("%s%s says:%s %s"), bbStart, gce->ptszNick, bbEnd, g_chatApi.RemoveFormatting(gce->ptszText));
+ TranslateT("%s%s says:%s %s"), bbStart, gce->pszNick.w, bbEnd, g_chatApi.RemoveFormatting(gce->pszText.w));
}
else oldDoPopup(si, gce);
@@ -556,17 +556,17 @@ bool IsHighlighted(SESSION_INFO *si, GCEVENT *gce) GCEVENT evTmp = *gce;
int dwMask = 0;
- if (gce->ptszText != nullptr)
+ if (gce->pszText.w != nullptr)
dwMask |= CMUCHighlight::MATCH_TEXT;
- if (gce->ptszNick != nullptr) {
+ if (gce->pszNick.w != nullptr) {
dwMask |= CMUCHighlight::MATCH_NICKNAME;
if (si && g_Settings.bLogClassicIndicators) {
- size_t len = mir_wstrlen(gce->ptszNick) + 1;
+ size_t len = mir_wstrlen(gce->pszNick.w) + 1;
wchar_t *tmp = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1));
- *tmp = GetIndicator(si, gce->ptszNick, nullptr);
- mir_wstrcpy(tmp + 1, gce->ptszNick);
- evTmp.ptszNick = tmp;
+ *tmp = GetIndicator(si, gce->pszNick.w, nullptr);
+ mir_wstrcpy(tmp + 1, gce->pszNick.w);
+ evTmp.pszNick.w = tmp;
}
}
return g_Settings.Highlight->match(&evTmp, si, dwMask);
diff --git a/plugins/TabSRMM/src/muchighlight.cpp b/plugins/TabSRMM/src/muchighlight.cpp index bf60e719a5..d69b6c7393 100644 --- a/plugins/TabSRMM/src/muchighlight.cpp +++ b/plugins/TabSRMM/src/muchighlight.cpp @@ -118,7 +118,7 @@ bool CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dw return false;
if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != nullptr) {
- wchar_t *p = g_chatApi.RemoveFormatting(pgce->ptszText);
+ wchar_t *p = g_chatApi.RemoveFormatting(pgce->pszText.w);
p = NEWWSTR_ALLOCA(p);
if (p == nullptr)
return false;
@@ -164,12 +164,12 @@ bool CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dw skip_textpatterns:
// optionally, match the nickname against the list of nicks to highlight
- if ((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->ptszNick && m_iNickPatterns > 0) {
+ if ((m_dwFlags & MATCH_NICKNAME) && (dwFlags & MATCH_NICKNAME) && pgce->pszNick.w && m_iNickPatterns > 0) {
for (UINT i = 0; i < m_iNickPatterns && !nResult; i++) {
- if (pgce->ptszNick)
- nResult = wildcmpw(pgce->ptszNick, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
- if ((m_dwFlags & MATCH_UIN) && pgce->ptszUserInfo)
- nResult = wildcmpw(pgce->ptszUserInfo, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
+ if (pgce->pszNick.w)
+ nResult = wildcmpw(pgce->pszNick.w, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
+ if ((m_dwFlags & MATCH_UIN) && pgce->pszUserInfo.w)
+ nResult = wildcmpw(pgce->pszUserInfo.w, m_NickPatterns[i]) ? MATCH_NICKNAME : 0;
}
}
|