diff options
author | George Hazan <george.hazan@gmail.com> | 2024-02-06 18:24:25 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-02-06 18:24:25 +0300 |
commit | a149741d7691a9f698d54e1a08c4e4e47777fe70 (patch) | |
tree | 88de2351de5dcc3ece63349d0a42f48747258703 | |
parent | 16cc6235dd3861cf9ee59f921d95d14b4592456f (diff) |
a crutch for PS_GETSTATUS for old protocols
-rw-r--r-- | include/m_protoint.h | 1 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 291214 -> 291510 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 290960 -> 291260 bytes | |||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/proto_interface.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/proto_internal.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/protocols.cpp | 5 |
8 files changed, 15 insertions, 3 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h index 4f34c94be8..444b64e64c 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -242,6 +242,7 @@ public: virtual HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *msg);
+ virtual int GetStatus();
virtual int SetStatus(int iNewStatus);
virtual HANDLE GetAwayMsg(MCONTACT hContact);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex d1e8f8ec70..8fef540280 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 80461ade47..31676ae0b1 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib 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;
}
}
|