summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-06 18:24:25 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-06 18:24:25 +0300
commita149741d7691a9f698d54e1a08c4e4e47777fe70 (patch)
tree88de2351de5dcc3ece63349d0a42f48747258703 /src/mir_app
parent16cc6235dd3861cf9ee59f921d95d14b4592456f (diff)
a crutch for PS_GETSTATUS for old protocols
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/proto_interface.cpp5
-rw-r--r--src/mir_app/src/proto_internal.cpp5
-rw-r--r--src/mir_app/src/protocols.cpp5
5 files changed, 14 insertions, 3 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index db4932e80a..8244257bb2 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -49,6 +49,7 @@ Button_SetSkin_IcoLib @24
?GetCaps@PROTO_INTERFACE@@UAEHHI@Z @49 NONAME
?GetInfo@PROTO_INTERFACE@@UAEHIH@Z @50 NONAME
?GetProtoInterface@CProtoIntDlgBase@@QAEPAUPROTO_INTERFACE@@XZ @51 NONAME
+?GetStatus@PROTO_INTERFACE@@UAEHXZ @52 NONAME
?OnProtoActivate@CProtoIntDlgBase@@MAEXIJ@Z @53 NONAME
?OnProtoCheckOnline@CProtoIntDlgBase@@MAEXIJ@Z @54 NONAME
?OnProtoRefresh@CProtoIntDlgBase@@MAEXIJ@Z @55 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index e3de66bb95..f87aca41a0 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -49,6 +49,7 @@ Button_SetSkin_IcoLib @24
?GetCaps@PROTO_INTERFACE@@UEAA_JHI@Z @49 NONAME
?GetInfo@PROTO_INTERFACE@@UEAAHIH@Z @50 NONAME
?GetProtoInterface@CProtoIntDlgBase@@QEAAPEAUPROTO_INTERFACE@@XZ @51 NONAME
+?GetStatus@PROTO_INTERFACE@@UEAAHXZ @52 NONAME
?OnProtoActivate@CProtoIntDlgBase@@MEAAX_K_J@Z @53 NONAME
?OnProtoCheckOnline@CProtoIntDlgBase@@MEAAX_K_J@Z @54 NONAME
?OnProtoRefresh@CProtoIntDlgBase@@MEAAX_K_J@Z @55 NONAME
diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp
index edb4c85e76..8aabb11acd 100644
--- a/src/mir_app/src/proto_interface.cpp
+++ b/src/mir_app/src/proto_interface.cpp
@@ -244,6 +244,11 @@ int PROTO_INTERFACE::SendMsg(MCONTACT, MEVENT, const char*)
return 0; // error
}
+int PROTO_INTERFACE::GetStatus()
+{
+ return m_iStatus;
+}
+
int PROTO_INTERFACE::SetStatus(int)
{
return 1; // you better declare it
diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp
index 50fa594489..dd1225a5d2 100644
--- a/src/mir_app/src/proto_internal.cpp
+++ b/src/mir_app/src/proto_internal.cpp
@@ -215,6 +215,11 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
}
+ int GetStatus() override
+ {
+ return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, 0, 0);
+ }
+
int SetStatus(int iNewStatus) override
{
return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp
index baef7ff563..3aa9f1e888 100644
--- a/src/mir_app/src/protocols.cpp
+++ b/src/mir_app/src/protocols.cpp
@@ -67,11 +67,11 @@ static TServiceListItem serviceItems[] =
{ PSS_CONTACTS, 23 },
{ PSS_FILE, 24 },
{ PSS_MESSAGE, 25 },
+ { PS_GETSTATUS, 26 },
{ PS_SETSTATUS, 27 },
{ PS_GETAWAYMSG, 28 },
{ PS_SETAWAYMSG, 29 },
{ PSS_USERISTYPING, 30 },
- { PS_GETSTATUS, 31 },
};
//------------------------------------------------------------------------------------
@@ -423,12 +423,11 @@ INT_PTR CallContactServiceInt(MCONTACT hContact, const char *szModule, const cha
}
return msgId;
}
+ case 26: return (INT_PTR)ppi->GetStatus();
case 27: return (INT_PTR)ppi->SetStatus(wParam);
case 28: return (INT_PTR)ppi->GetAwayMsg(hContact);
case 29: return (INT_PTR)ppi->SetAwayMsg(wParam, (wchar_t *)lParam);
case 30: return (INT_PTR)ppi->UserIsTyping(wParam, lParam);
- case 31:
- return ppi->m_iStatus;
}
}