From eccbb5307a048e70ac4adb0d3fd333be28245fa8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 28 Mar 2017 14:21:33 +0300 Subject: massive cleanup of useless cbSize fields --- protocols/FacebookRM/src/json.cpp | 3 --- protocols/FacebookRM/src/proto.cpp | 1 - protocols/JabberG/src/jabber_menu.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 2 +- protocols/MSN/src/msn_misc.cpp | 7 ++----- protocols/MSN/src/msn_proto.h | 6 ------ protocols/MSN/src/msn_svcs.cpp | 32 -------------------------------- protocols/Omegle/src/communication.cpp | 2 -- protocols/VKontakte/src/misc.cpp | 1 - protocols/VKontakte/src/vk_chats.cpp | 10 ---------- protocols/WhatsApp/src/utils.cpp | 1 - 11 files changed, 4 insertions(+), 63 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 2491db2d94..3c1602d593 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -836,10 +836,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vectorarResources.getCount() ? 0 : MBF_DISABLED; Srmm_ModifyIcon(hContact, &sid); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 19813ac138..8960a70166 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -216,7 +216,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) HookProtoEvent(ME_GC_EVENT, &CJabberProto::JabberGcEventHook); HookProtoEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook); - StatusIconData sid = { sizeof(sid) }; + StatusIconData sid = {}; sid.szModule = m_szModuleName; sid.hIcon = LoadIconEx("main"); sid.flags = MBF_HIDDEN; diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 615524ec03..637ef68518 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -1308,11 +1308,8 @@ bool CMsnProto::MSN_IsMeByContact(MCONTACT hContact, char* szEmail) bool MSN_MsgWndExist(MCONTACT hContact) { - MessageWindowInputData msgWinInData = - { sizeof(MessageWindowInputData), hContact, MSG_WINDOW_UFLAG_MSG_BOTH }; - MessageWindowData msgWinData = { 0 }; - msgWinData.cbSize = sizeof(MessageWindowData); - + MessageWindowData msgWinData = {}; + MessageWindowInputData msgWinInData = { hContact, MSG_WINDOW_UFLAG_MSG_BOTH }; bool res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0; res = res || msgWinData.hwndWindow; if (res) { diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index e210889035..9aeb60b56b 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -88,8 +88,6 @@ struct CMsnProto : public PROTO INT_PTR __cdecl GetUnreadEmailCount(WPARAM wParam, LPARAM lParam); - INT_PTR __cdecl ManageAccount(WPARAM wParam, LPARAM lParam); - INT_PTR __cdecl OnLeaveChat(WPARAM wParam, LPARAM lParam); //====| Events |====================================================================== @@ -102,10 +100,6 @@ struct CMsnProto : public PROTO int __cdecl OnPreShutdown(WPARAM wParam,LPARAM lParam); int __cdecl OnContactDoubleClicked(WPARAM wParam,LPARAM lParam); int __cdecl OnDbSettingChanged(WPARAM wParam,LPARAM lParam); - int __cdecl OnUserInfoInit(WPARAM wParam,LPARAM lParam); -#ifdef OBSOLETE - int __cdecl OnWindowEvent(WPARAM wParam, LPARAM lParam); -#endif int __cdecl OnWindowPopup(WPARAM wParam, LPARAM lParam); //====| Data |======================================================================== diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 76eeb339ac..b0be81b0f1 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -523,38 +523,6 @@ int CMsnProto::OnIdleChanged(WPARAM, LPARAM lParam) return 0; } -#ifdef OBSOLETE -///////////////////////////////////////////////////////////////////////////////////////// -// OnWindowEvent - creates session on window open - -int CMsnProto::OnWindowEvent(WPARAM, LPARAM lParam) -{ - MessageWindowEventData* msgEvData = (MessageWindowEventData*)lParam; - - if (msgEvData->uType == MSG_WINDOW_EVT_OPENING) { - if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_INVISIBLE) - return 0; - - if (!MSN_IsMyContact(msgEvData->hContact)) return 0; - - char tEmail[MSN_MAX_EMAIL_LEN]; - if (MSN_IsMeByContact(msgEvData->hContact, tEmail)) return 0; - - int netId = Lists_GetNetId(tEmail); - if (netId != NETID_MSN && netId != NETID_LCS) return 0; - - if (Lists_IsInList(LIST_BL, tEmail)) return 0; - - bool isOffline; - ThreadData* thread = MSN_StartSB(tEmail, isOffline); - - if (thread == NULL && !isOffline) - MsgQueue_Add(tEmail, 'X', NULL, 0); - } - return 0; -} -#endif - ///////////////////////////////////////////////////////////////////////////////////////// // OnWindowEvent - creates session on window open diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index 827560e378..527a42705f 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -553,7 +553,6 @@ bool Omegle_client::events() SkinPlaySound("StrangerTyp"); StatusTextData st = { 0 }; - st.cbSize = sizeof(st); st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on")); ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger")); @@ -566,7 +565,6 @@ bool Omegle_client::events() SkinPlaySound("StrangerTypStop"); StatusTextData st = { 0 }; - st.cbSize = sizeof(st); st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off")); ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger")); diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 3ae47bcf21..975e3c141a 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -737,7 +737,6 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact) _free_locale(locale); StatusTextData st = { 0 }; - st.cbSize = sizeof(st); st.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_READMSG)); mir_snwprintf(st.tszText, TranslateT("Message read: %s"), ttime); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 484602e265..725e48d25f 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -842,9 +842,7 @@ void CVkProto::ChatContactTypingThread(void *p) m_ChatsTyping.insert(param); StatusTextData st = { 0 }; - st.cbSize = sizeof(st); mir_snwprintf(st.tszText, TranslateT("%s is typing a message..."), cu->m_wszNick); - CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); } @@ -874,18 +872,10 @@ void CVkProto::StopChatContactTyping(int iChatId, int iUserId) m_ChatsTyping.remove(cp); StatusTextData st = { 0 }; - st.cbSize = sizeof(st); mir_snwprintf(st.tszText, L" "); - - // CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, NULL) clears statusbar very slowly. - // (1-10 sec(!!!) for me on tabSRMM O_o) - // So I call MS_MSG_SETSTATUSTEXT with st.wszText = " " for cleaning of "... is typing a message..." string. - // It works instantly! - CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); // After that I call standard cleaning procedure: - CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact); } } diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp index c131dda0f8..c0bfdfc558 100644 --- a/protocols/WhatsApp/src/utils.cpp +++ b/protocols/WhatsApp/src/utils.cpp @@ -49,7 +49,6 @@ void utils::setStatusMessage(MCONTACT hContact, const wchar_t *ptszMessage) { if (ptszMessage != NULL) { StatusTextData st = { 0 }; - st.cbSize = sizeof(st); st.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); wcsncpy_s(st.tszText, ptszMessage, _TRUNCATE); CallService(MS_MSG_SETSTATUSTEXT, hContact, (LPARAM)&st); -- cgit v1.2.3