From 228008cd0ceeeec457d83370854510cd8be1d8f8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 26 Dec 2018 23:54:15 +0300 Subject: some hardcoded ICQ constants removed --- plugins/SimpleStatusMsg/src/main.cpp | 45 ------------------------------------ plugins/SimpleStatusMsg/src/stdafx.h | 7 ------ 2 files changed, 52 deletions(-) (limited to 'plugins/SimpleStatusMsg') diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index aac8d8d7bf..a72084c738 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1463,48 +1463,6 @@ static wchar_t* ParseDate(ARGUMENTSINFO *ai) return mir_wstrdup(szStr); } -int ICQMsgTypeToStatus(int iMsgType) -{ - switch (iMsgType) { - case MTYPE_AUTOONLINE: return ID_STATUS_ONLINE; - case MTYPE_AUTOAWAY: return ID_STATUS_AWAY; - case MTYPE_AUTOBUSY: return ID_STATUS_OCCUPIED; - case MTYPE_AUTONA: return ID_STATUS_NA; - case MTYPE_AUTODND: return ID_STATUS_DND; - case MTYPE_AUTOFFC: return ID_STATUS_FREECHAT; - default: return ID_STATUS_OFFLINE; - } -} - -static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) -{ -#ifdef _DEBUG - g_plugin.debugLogA("OnICQStatusMsgRequest(): UIN: %d on %s", (int)lParam, (char *)lMirParam); -#endif - - if (g_plugin.getByte("NoUpdateOnICQReq", 1)) - return 0; - - char *szProto = (char *)lMirParam; - MCONTACT hContact = 0; - - for (auto &cc : Contacts()) { - if (db_get_dw(cc, szProto, "UIN", 0) == (DWORD)lParam) { - hContact = cc; - break; - } - } - if (!hContact) - return 0; - - int iStatus = ICQMsgTypeToStatus(wParam); - wchar_t *tszMsg = GetAwayMessage(iStatus, szProto, TRUE, hContact); - Proto_SetAwayMsgT(szProto, iStatus, tszMsg); - mir_free(tszMsg); - - return 0; -} - static int OnAccListChanged(WPARAM, LPARAM) { #ifdef _DEBUG @@ -1522,9 +1480,6 @@ static int OnAccListChanged(WPARAM, LPARAM) if (!pa->IsEnabled()) continue; - if (!mir_strcmp(pa->szProtoName, "ICQ")) - HookProtoEvent(pa->szModuleName, ME_ICQ_STATUSMSGREQ, OnICQStatusMsgRequest); - accounts->statusFlags |= (CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)); if (CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)) diff --git a/plugins/SimpleStatusMsg/src/stdafx.h b/plugins/SimpleStatusMsg/src/stdafx.h index 4391957015..108697be74 100644 --- a/plugins/SimpleStatusMsg/src/stdafx.h +++ b/plugins/SimpleStatusMsg/src/stdafx.h @@ -59,13 +59,6 @@ struct CMPlugin : public PLUGIN #include "resource.h" #include "version.h" -#define MTYPE_AUTOONLINE 0xE7 // Auto online message (internal only) -#define MTYPE_AUTOAWAY 0xE8 // Auto away message -#define MTYPE_AUTOBUSY 0xE9 // Auto occupied message -#define MTYPE_AUTONA 0xEA // Auto not available message -#define MTYPE_AUTODND 0xEB // Auto do not disturb message -#define MTYPE_AUTOFFC 0xEC // Auto free for chat message - extern UINT_PTR g_uUpdateMsgTimer; extern VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD); extern VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control); -- cgit v1.2.3