diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/MirLua/src/Modules/m_chat.cpp | 10 | ||||
-rw-r--r-- | plugins/MirandaG15/src/CAppletManager.cpp | 38 | ||||
-rw-r--r-- | plugins/RecentContacts/src/RecentContacts.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_tools.cpp | 14 | ||||
-rw-r--r-- | plugins/TabSRMM/src/muchighlight.cpp | 12 | ||||
-rw-r--r-- | plugins/XSoundNotify/src/xsn_main.cpp | 6 |
6 files changed, 42 insertions, 42 deletions
diff --git a/plugins/MirLua/src/Modules/m_chat.cpp b/plugins/MirLua/src/Modules/m_chat.cpp index c1a2a65d9b..8611b6bc08 100644 --- a/plugins/MirLua/src/Modules/m_chat.cpp +++ b/plugins/MirLua/src/Modules/m_chat.cpp @@ -11,15 +11,15 @@ LUAMOD_API int luaopen_m_chat(lua_State *L) MT<GCEVENT>(L, "GCEVENT") .Field(&GCEVENT::pszModule, "Module", LUA_TSTRINGA) - .Field(&GCEVENT::ptszID, "Id", LUA_TSTRINGW) + .Field(&GCEVENT::pszID, "Id", LUA_TSTRINGW) .Field(&GCEVENT::iType, "Type", LUA_TINTEGER) .Field(&GCEVENT::time, "Timestamp", LUA_TINTEGER) .Field(&GCEVENT::time, "IsMe", LUA_TINTEGER) .Field(&GCEVENT::time, "Flags", LUA_TINTEGER) - .Field(&GCEVENT::ptszNick, "Nick", LUA_TSTRINGW) - .Field(&GCEVENT::ptszUID, "Uid", LUA_TSTRINGW) - .Field(&GCEVENT::ptszStatus, "Status", LUA_TSTRINGW) - .Field(&GCEVENT::ptszText, "Text", LUA_TSTRINGW); + .Field(&GCEVENT::pszNick, "Nick", LUA_TSTRINGW) + .Field(&GCEVENT::pszUID, "Uid", LUA_TSTRINGW) + .Field(&GCEVENT::pszStatus, "Status", LUA_TSTRINGW) + .Field(&GCEVENT::pszText, "Text", LUA_TSTRINGW); return 1; } diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 58cc434bc0..da2980fe03 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -1078,7 +1078,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) return 0; } - TRACE(L"<< [%s:%s] event %04X\n", toTstring(gce->pszModule).c_str(), gce->ptszID, gce->iType); + TRACE(L"<< [%s:%s] event %04X\n", toTstring(gce->pszModule).c_str(), gce->pszID.w, gce->iType); // get the matching irc connection entry CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(toTstring(gce->pszModule)); @@ -1105,13 +1105,13 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) Event.hValue = lParam; CIRCHistory *pHistory = nullptr; - if (gce->ptszID) { - tstring strChannel = toTstring(gce->ptszID); + if (gce->pszID.w) { + tstring strChannel = toTstring(gce->pszID.w); tstring::size_type pos = strChannel.find('-'); if (pos != tstring::npos) strChannel = strChannel.substr(0, pos - 1); else { - if (mir_wstrcmpi(gce->ptszID, L"Network log")) + if (mir_wstrcmpi(gce->pszID.w, L"Network log")) TRACE(L"\t WARNING: ignoring unknown event!\n"); return 0; } @@ -1120,7 +1120,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) if (gce->iType == GC_EVENT_JOIN) { pHistory = CAppletManager::GetInstance()->CreateIRCHistoryByName(pIRCCon->strProtocol, strChannel); if (pHistory) - pHistory->LUsers.push_back(toTstring(gce->ptszNick)); + pHistory->LUsers.push_back(toTstring(gce->pszNick.w)); } return 0; } @@ -1134,17 +1134,17 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) Event.hContact = NULL; // Ignore events from hidden chatrooms, except for join events - if (gce->ptszID != nullptr && db_get_b(Event.hContact, "CList", "Hidden", 0)) { + if (gce->pszID.w != nullptr && db_get_b(Event.hContact, "CList", "Hidden", 0)) { if (gce->iType == GC_EVENT_JOIN && pHistory) - pHistory->LUsers.push_back(toTstring(gce->ptszNick)); + pHistory->LUsers.push_back(toTstring(gce->pszNick.w)); TRACE(L"\t Chatroom is hidden, skipping event!\n"); return 0; } - tstring strText = StripIRCFormatting(toTstring(gce->ptszText)); - tstring strNick = toTstring(gce->ptszNick); - tstring strStatus = toTstring(gce->ptszStatus); + tstring strText = StripIRCFormatting(toTstring(gce->pszText.w)); + tstring strNick = toTstring(gce->pszNick.w); + tstring strStatus = toTstring(gce->pszStatus.w); if (CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strNick = strNick.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + L"..."; @@ -1174,7 +1174,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) break; case GC_EVENT_JOIN: // Add the user to the list - pHistory->LUsers.push_back(toTstring(gce->ptszNick)); + pHistory->LUsers.push_back(toTstring(gce->pszNick.w)); if (CConfig::GetBoolSetting(NOTIFY_IRC_USERS)) Event.bNotification = true; @@ -1188,7 +1188,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) { if (CConfig::GetBoolSetting(NOTIFY_IRC_USERS)) Event.bNotification = true; - tstring strFullNick = toTstring(gce->ptszNick); + tstring strFullNick = toTstring(gce->pszNick.w); Event.strValue = TranslateString(strText.empty() ? L"%s has left" : L"%s has left: %s", strNick.c_str(), strText.c_str()); if (pHistory) { // Remove the user from the list @@ -1217,7 +1217,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) { if (CConfig::GetBoolSetting(NOTIFY_IRC_USERS)) Event.bNotification = true; - tstring strFullNick = toTstring(gce->ptszNick); + tstring strFullNick = toTstring(gce->pszNick.w); if (CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strText.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strText = strText.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + L"..."; @@ -1248,7 +1248,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) { if (CConfig::GetBoolSetting(NOTIFY_IRC_STATUS)) Event.bNotification = true; - tstring strNick2 = toTstring(gce->ptszStatus); + tstring strNick2 = toTstring(gce->pszStatus.w); if (CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick2.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strNick2 = strNick2.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + L"..."; @@ -1259,7 +1259,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) { if (CConfig::GetBoolSetting(NOTIFY_IRC_STATUS)) Event.bNotification = true; - tstring strNick2 = toTstring(gce->ptszStatus); + tstring strNick2 = toTstring(gce->pszStatus.w); if (CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick2.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strNick2 = strNick2.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + L"..."; @@ -1270,7 +1270,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) TRACE(L"OK!\n"); return 0; } - if (gce->bIsMe || gce->ptszID == nullptr) + if (gce->bIsMe || gce->pszID.w == nullptr) Event.bNotification = false; // set the event's timestamp @@ -1291,8 +1291,8 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) if (pHistory->LMessages.size() > CConfig::GetIntSetting(SESSION_LOGSIZE)) pHistory->LMessages.pop_front(); } - else if (gce->ptszNick && gce->iType == GC_EVENT_QUIT) { - strNick = toTstring(gce->ptszNick); + else if (gce->pszNick.w && gce->iType == GC_EVENT_QUIT) { + strNick = toTstring(gce->pszNick.w); if (!CAppletManager::GetInstance()->m_LIRCHistorys.empty()) { list<CIRCHistory*>::iterator iter = CAppletManager::GetInstance()->m_LIRCHistorys.begin(); @@ -1323,7 +1323,7 @@ int CAppletManager::HookChatInbound(WPARAM, LPARAM lParam) TRACE(L"OK!\n"); return 0; } - else if (gce->ptszID != nullptr) { + else if (gce->pszID.w != nullptr) { TRACE(L"OK!\n"); return 0; } diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 6512b02690..2cdd83d937 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -455,7 +455,7 @@ static int OnGCInEvent(WPARAM, LPARAM lParam) {
GCEVENT *gce = (GCEVENT*)lParam;
if (gce->iType == GC_EVENT_MESSAGE) {
- SESSION_INFO *si = g_chatApi.SM_FindSession(gce->ptszID, gce->pszModule);
+ SESSION_INFO *si = g_chatApi.SM_FindSession(gce->pszID.w, gce->pszModule);
if (si && si->hContact) {
// skip old events
if (gce->time && gce->time <= GetLastUsedTimeStamp(si->hContact))
@@ -470,7 +470,7 @@ static int OnGCOutEvent(WPARAM, LPARAM lParam) {
GCEVENT *gce = (GCEVENT*)lParam;
if (gce->iType == GC_USER_MESSAGE) {
- SESSION_INFO *si = g_chatApi.SM_FindSession(gce->ptszID, gce->pszModule);
+ SESSION_INFO *si = g_chatApi.SM_FindSession(gce->pszID.w, gce->pszModule);
if (si && si->hContact)
SaveLastUsedTimeStamp(si->hContact);
}
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;
}
}
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index be0e1ef411..9b0da63ff9 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -143,13 +143,13 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) if (gce->iType != GC_EVENT_MESSAGE)
return 0;
- MCONTACT hContact = g_chatApi.FindRoom(gce->pszModule, gce->ptszID);
+ MCONTACT hContact = g_chatApi.FindRoom(gce->pszModule, gce->pszID.w);
if (hContact != 0) {
ptrW nick(db_get_wsa(hContact, gce->pszModule, "MyNick"));
- if (nick == NULL || gce->ptszText == nullptr)
+ if (nick == NULL || gce->pszText.w == nullptr)
return 0;
- if (wcsstr(gce->ptszText, nick)) {
+ if (wcsstr(gce->pszText.w, nick)) {
isIgnoreSound = g_plugin.getByte(hContact, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !g_plugin.getWString(hContact, SETTINGSKEY, &dbv)) {
|