diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/CloudFile/src/srmm.cpp | 13 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 18 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime.cpp | 10 | ||||
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 21 |
4 files changed, 30 insertions, 32 deletions
diff --git a/protocols/CloudFile/src/srmm.cpp b/protocols/CloudFile/src/srmm.cpp index 161ddfffd0..b36211de30 100644 --- a/protocols/CloudFile/src/srmm.cpp +++ b/protocols/CloudFile/src/srmm.cpp @@ -15,17 +15,16 @@ int OnSrmmToolbarLoaded(WPARAM, LPARAM) return 0; } -int OnSrmmWindowOpened(WPARAM, LPARAM lParam) +int OnSrmmWindowOpened(WPARAM uType, LPARAM lParam) { - MessageWindowEventData *ev = (MessageWindowEventData*)lParam; - if (ev->uType == MSG_WINDOW_EVT_OPENING && ev->hContact) { + auto *pDlg = (CSrmmBaseDialog *)lParam; + + if (uType == MSG_WINDOW_EVT_OPENING && pDlg->m_hContact) { BBButton bbd = {}; bbd.pszModuleName = MODULENAME; bbd.dwButtonID = BBB_ID_FILE_SEND; - bbd.bbbFlags = CanSendToContact(ev->hContact) - ? BBSF_RELEASED - : BBSF_DISABLED; - Srmm_SetButtonState(ev->hContact, &bbd); + bbd.bbbFlags = CanSendToContact(pDlg->m_hContact) ? BBSF_RELEASED : BBSF_DISABLED; + Srmm_SetButtonState(pDlg->m_hContact, &bbd); } return 0; diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 715909e915..5c601611b6 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -796,29 +796,29 @@ void CJabberProto::MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item) Srmm_SetIconFlags(hContact, m_szModuleName, 0, item->arResources.getCount() ? 0 : MBF_DISABLED);
}
-int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
+int CJabberProto::OnProcessSrmmEvent(WPARAM uType, LPARAM lParam)
{
- MessageWindowEventData *event = (MessageWindowEventData *)lParam;
+ auto *pDlg = (CSrmmBaseDialog *)lParam;
- if (event->uType == MSG_WINDOW_EVT_OPEN) {
+ if (uType == MSG_WINDOW_EVT_OPEN) {
if (!hDialogsList)
hDialogsList = WindowList_Create();
- WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
+ WindowList_Add(hDialogsList, pDlg->GetHwnd(), pDlg->m_hContact);
- ptrA jid(getUStringA(event->hContact, "jid"));
+ ptrA jid(getUStringA(pDlg->m_hContact, "jid"));
if (jid != nullptr) {
JABBER_LIST_ITEM *pItem = ListGetItemPtr(LIST_ROSTER, jid);
if (pItem && m_ThreadInfo && (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_ARCHIVE_AUTO) && m_bEnableMsgArchive)
- RetrieveMessageArchive(event->hContact, pItem);
+ RetrieveMessageArchive(pDlg->m_hContact, pItem);
}
}
- else if (event->uType == MSG_WINDOW_EVT_CLOSING) {
+ else if (uType == MSG_WINDOW_EVT_CLOSING) {
if (hDialogsList)
- WindowList_Remove(hDialogsList, event->hwndWindow);
+ WindowList_Remove(hDialogsList, pDlg->GetHwnd());
if (m_bJabberOnline) {
char jid[JABBER_MAX_JID_LEN];
- if (GetClientJID(event->hContact, jid, _countof(jid))) {
+ if (GetClientJID(pDlg->m_hContact, jid, _countof(jid))) {
pResourceStatus r(ResourceInfoFromJID(jid));
if (m_bEnableChatStates && (GetResourceCapabilities(jid, r) & JABBER_CAPS_CHATSTATES))
m_ThreadInfo->send(XmlNode("message") << XATTR("to", jid) << XATTR("type", "chat") << XATTRID(SerialNext()) << XCHILDNS("gone", JABBER_FEAT_CHATSTATES));
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index e11388ca86..238f559d6b 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -99,15 +99,15 @@ void __cdecl sttRecvAwayThread(TFakeAckParams *tParam) free(tParam);
}
-int CSametimeProto::OnWindowEvent(WPARAM, LPARAM lParam)
+int CSametimeProto::OnWindowEvent(WPARAM uType, LPARAM lParam)
{
- MessageWindowEventData *mwed = (MessageWindowEventData*)lParam;
+ auto *pDlg = (CSrmmBaseDialog *)lParam;
- if ((mwed == nullptr) || Contact::IsGroupChat(mwed->hContact, m_szModuleName))
+ if (Contact::IsGroupChat(pDlg->m_hContact, m_szModuleName))
return 0;
- if ((mwed->uType == MSG_WINDOW_EVT_CLOSING) || (mwed->uType == MSG_WINDOW_EVT_CLOSE))
- CloseIm(mwed->hContact);
+ if (uType == MSG_WINDOW_EVT_CLOSING || uType == MSG_WINDOW_EVT_CLOSE)
+ CloseIm(pDlg->m_hContact);
return 0;
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index ff3ed307e1..6cd5957735 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -838,25 +838,24 @@ int CVkProto::IsHystoryMessageExist(MCONTACT hContact) return -1;
}
-int CVkProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
+int CVkProto::OnProcessSrmmEvent(WPARAM uType, LPARAM lParam)
{
debugLogA("CVkProto::OnProcessSrmmEvent");
- MessageWindowEventData *event = (MessageWindowEventData *)lParam;
+ auto *pDlg = (CSrmmBaseDialog *)lParam;
-
- CMStringA szProto(Proto_GetBaseAccountName(event->hContact));
+ CMStringA szProto(Proto_GetBaseAccountName(pDlg->m_hContact));
if (szProto.IsEmpty() || szProto != m_szModuleName)
return 0;
- if (event->uType == MSG_WINDOW_EVT_OPENING && !g_bMessageState)
- SetSrmmReadStatus(event->hContact);
+ if (uType == MSG_WINDOW_EVT_OPENING && !g_bMessageState)
+ SetSrmmReadStatus(pDlg->m_hContact);
- if (event->uType == MSG_WINDOW_EVT_OPENING && m_vkOptions.bLoadLastMessageOnMsgWindowsOpen
- && !isChatRoom(event->hContact) && IsHystoryMessageExist(event->hContact) != 1) {
+ if (uType == MSG_WINDOW_EVT_OPENING && m_vkOptions.bLoadLastMessageOnMsgWindowsOpen
+ && !isChatRoom(pDlg->m_hContact) && IsHystoryMessageExist(pDlg->m_hContact) != 1) {
m_bNotifyForEndLoadingHistory = false;
- if (!getBool(event->hContact, "ActiveHistoryTask")) {
- setByte(event->hContact, "ActiveHistoryTask", 1);
- GetServerHistory(event->hContact, 0, MAXHISTORYMIDSPERONE, 0, 0, true);
+ if (!getBool(pDlg->m_hContact, "ActiveHistoryTask")) {
+ setByte(pDlg->m_hContact, "ActiveHistoryTask", 1);
+ GetServerHistory(pDlg->m_hContact, 0, MAXHISTORYMIDSPERONE, 0, 0, true);
}
}
|