summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp79
-rw-r--r--plugins/NewAwaySysMod/src/Client.cpp15
-rw-r--r--plugins/NewAwaySysMod/src/MsgEventAdded.cpp7
-rw-r--r--plugins/NewAwaySysMod/src/SetAwayMsg.cpp20
-rw-r--r--plugins/NewAwaySysMod/src/stdafx.h4
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp45
-rw-r--r--plugins/SimpleStatusMsg/src/stdafx.h7
7 files changed, 7 insertions, 170 deletions
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index 66050a51b1..13b44630cc 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -121,75 +121,6 @@ TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, DWORD UIN, int iSta
return VarParseData.Message = VarParseData.Message.Left(AWAY_MSGDATA_MAX);
}
-
-int StatusMsgReq(WPARAM wParam, LPARAM lParam, CString &szProto)
-{
- _ASSERT(szProto != NULL);
- LogMessage("ME_ICQ_STATUSMSGREQ called. szProto=%s, Status=%d, UIN=%d", (char*)szProto, wParam, lParam);
- // find the contact
- char *szFoundProto;
- MCONTACT hFoundContact = NULL; // if we'll find the contact only on some other protocol, but not on szProto, then we'll use that hContact.
- for (auto &hContact : Contacts()) {
- char *szCurProto = GetContactProto(hContact);
- if (db_get_dw(hContact, szCurProto, "UIN", 0) == lParam) {
- szFoundProto = szCurProto;
- hFoundContact = hContact;
- if (!mir_strcmp(szCurProto, szProto))
- break;
- }
- }
-
- int iMode = ICQStatusToGeneralStatus(wParam);
- if (!hFoundContact)
- hFoundContact = INVALID_CONTACT_ID;
- else if (iMode >= ID_STATUS_ONLINE && iMode <= ID_STATUS_OUTTOLUNCH)
- // don't count xstatus requests
- db_set_w(hFoundContact, MODULENAME, DB_REQUESTCOUNT, db_get_w(hFoundContact, MODULENAME, DB_REQUESTCOUNT, 0) + 1);
-
- MCONTACT hContactForSettings = hFoundContact; // used to take into account not-on-list contacts when getting contact settings, but at the same time allows to get correct contact info for contacts that are in the DB
- if (hContactForSettings != INVALID_CONTACT_ID && db_get_b(hContactForSettings, "CList", "NotOnList", 0))
- hContactForSettings = INVALID_CONTACT_ID; // INVALID_HANDLE_VALUE means the contact is not-on-list
-
- if (g_SetAwayMsgPage.GetWnd()) {
- CallAllowedPS_SETAWAYMSG(szProto, iMode, nullptr); // we can set status messages to NULL here, as they'll be changed again when the SAM dialog closes.
- return 0;
- }
- if (CContactSettings(iMode, hContactForSettings).Ignore) {
- CallAllowedPS_SETAWAYMSG(szProto, iMode, L""); // currently NULL makes ICQ to ignore _any_ further status message requests until the next PS_SETAWAYMSG, so i can't use it here..
- return 0; // move along, sir
- }
-
- if (iMode) // if it's not an xstatus message request
- CallAllowedPS_SETAWAYMSG(szProto, iMode, GetDynamicStatMsg(hFoundContact, szProto, lParam));
-
- // COptPage PopupNotifyData(g_PopupOptPage);
- // PopupNotifyData.DBToMem();
- VarParseData.szProto = szProto;
- VarParseData.UIN = lParam;
- VarParseData.Flags = 0;
- if (!iMode)
- VarParseData.Flags |= VPF_XSTATUS;
-
- return 0;
-}
-
-// Here is an ugly workaround to support multiple ICQ accounts
-// hope 5 icq accounts will be sufficient for everyone ;)
-#define MAXICQACCOUNTS 5
-CString ICQProtoList[MAXICQACCOUNTS];
-#define StatusMsgReqN(N) int StatusMsgReq##N(WPARAM wParam, LPARAM lParam) {return StatusMsgReq(wParam, lParam, ICQProtoList[N - 1]);}
-StatusMsgReqN(1) StatusMsgReqN(2) StatusMsgReqN(3) StatusMsgReqN(4) StatusMsgReqN(5)
-MIRANDAHOOK StatusMsgReqHooks[] = { StatusMsgReq1, StatusMsgReq2, StatusMsgReq3, StatusMsgReq4, StatusMsgReq5 };
-
-int IsAnICQProto(char *szProto)
-{
- for (int i = 0; i < MAXICQACCOUNTS; i++)
- if (ICQProtoList[i] == (const char*)szProto)
- return true;
-
- return false;
-}
-
// wParam = iMode
// lParam = (char*)szProto
@@ -578,16 +509,6 @@ int MirandaLoaded(WPARAM, LPARAM)
InitUpdateMsgs();
g_IconList.ReloadIcons();
- int CurProtoIndex = 0;
- for (auto &pa : Accounts()) {
- HANDLE hHook = HookEvent(CString(pa->szModuleName) + ME_ICQ_STATUSMSGREQ, StatusMsgReqHooks[CurProtoIndex]);
- if (hHook) {
- ICQProtoList[CurProtoIndex++] = pa->szModuleName;
- if (CurProtoIndex >= MAXICQACCOUNTS)
- break;
- }
- }
-
CreateServiceFunction(MS_AWAYSYS_SETCONTACTSTATMSG, SetContactStatMsg);
CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_TOGGLE, ToggleSendOnEvent);
CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_ON, srvAutoreplyOn);
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp
index dbabd5a025..7a2e696aac 100644
--- a/plugins/NewAwaySysMod/src/Client.cpp
+++ b/plugins/NewAwaySysMod/src/Client.cpp
@@ -35,7 +35,7 @@ void __cdecl UpdateMsgsThreadProc(void *)
while (WaitForSingleObject(g_hTerminateUpdateMsgsThread, 0) == WAIT_TIMEOUT && !Miranda_IsTerminated()) {
DWORD MinUpdateTimeDifference = (DWORD)g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_UPDATEMSGSPERIOD) * 1000; // in milliseconds
for (auto &p : Accounts()) {
- if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND && !IsAnICQProto(p->szModuleName)) {
+ if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
int Status = Proto_GetStatus(p->szModuleName);
if (Status < ID_STATUS_OFFLINE || Status > ID_STATUS_OUTTOLUNCH) {
Status = g_ProtoStates[p->szModuleName].m_status;
@@ -146,19 +146,6 @@ int GetRecentGroupID(int iMode)
return -1;
}
-int ICQStatusToGeneralStatus(int bICQStat)
-{
- switch (bICQStat) {
- case MTYPE_AUTOONLINE: return ID_STATUS_ONLINE;
- case MTYPE_AUTOAWAY: return ID_STATUS_AWAY;
- case MTYPE_AUTONA: return ID_STATUS_NA;
- case MTYPE_AUTODND: return ID_STATUS_DND;
- case MTYPE_AUTOBUSY: return ID_STATUS_OCCUPIED;
- case MTYPE_AUTOFFC: return ID_STATUS_FREECHAT;
- default: return 0;
- }
-}
-
TCString VariablesEscape(TCString Str)
{
if (!Str.GetLen()) {
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
index 6840363e3f..7efc0dfde2 100644
--- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
+++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
@@ -204,13 +204,8 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam)
if (AutoreplyOptData.GetValue(IDC_REPLYDLG_ONLYIDLEREPLY) && !g_bIsIdle)
return 0;
- int UIN = 0;
- if (IsAnICQProto(szProto))
- UIN = db_get_dw(hContact, szProto, "UIN", 0);
-
int SendCount = (int)AutoreplyOptData.GetValue(IDC_REPLYDLG_SENDCOUNT);
- if ((AutoreplyOptData.GetValue(IDC_REPLYDLG_DONTSENDTOICQ) && UIN) || // an icq contact
- (SendCount != -1 && g_plugin.getByte(hContact, DB_SENDCOUNT, 0) >= SendCount))
+ if (SendCount != -1 && g_plugin.getByte(hContact, DB_SENDCOUNT, 0) >= SendCount)
return 0;
if ((dbei->eventType == EVENTTYPE_MESSAGE && !AutoreplyOptData.GetValue(IDC_REPLYDLG_EVENTMSG)) ||
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
index 5a6f29d5f6..db8c03f9f8 100644
--- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
@@ -780,22 +780,12 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
}
if (hContact) {
- if (IsAnICQProto(GetContactProto(hContact))) {
- WindowTitle += TranslateT("message for");
- WindowTitle += L" ";
- }
- else {
- WindowTitle += TranslateT("for");
- WindowTitle += L" ";
- }
-
+ WindowTitle += TranslateT("for");
+ WindowTitle += L" ";
WindowTitle += Clist_GetContactDisplayName(hContact);
- if (!IsAnICQProto(GetContactProto(hContact))) {
- WindowTitle += L" ";
- WindowTitle += TranslateT("available autoreply only");
- WindowTitle += L")";
- }
- else WindowTitle += L")";
+ WindowTitle += L" ";
+ WindowTitle += TranslateT("available autoreply only");
+ WindowTitle += L")";
}
else {
if (!szProto) {
diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h
index 47a5bba3c2..bf294af407 100644
--- a/plugins/NewAwaySysMod/src/stdafx.h
+++ b/plugins/NewAwaySysMod/src/stdafx.h
@@ -45,7 +45,6 @@
#include "m_protosvc.h"
#include "m_options.h"
#include "m_netlib.h"
-#include "../../protocols/IcqOscarJ/src/icq_constants.h"
#include "m_skin.h"
#include "m_awaymsg.h"
#include "m_utils.h"
@@ -204,8 +203,6 @@
#define MRM_MAX_GENERATED_TITLE_LEN 35 // maximum length of automatically generated title for recent messages
-int ICQStatusToGeneralStatus(int bICQStat); // TODO: get rid of these protocol-specific functions, if possible
-
#define MS_AWAYSYS_SETCONTACTSTATMSG "AwaySys/SetContactStatMsg"
#define MS_AWAYSYS_AUTOREPLY_TOGGLE "AwaySys/AutoreplyToggle"
@@ -287,7 +284,6 @@ extern int g_bIsIdle;
// AwaySys.cpp
TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto = nullptr, DWORD UIN = 0, int iStatus = 0);
-int IsAnICQProto(char *szProto);
// Client.cpp
void InitUpdateMsgs();
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<CMPlugin>
#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);