summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp10
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h2
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp36
-rw-r--r--protocols/IcqOscarJ/src/icqoscar.h1
4 files changed, 10 insertions, 39 deletions
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 7f1276c628..652ecc6b57 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -147,13 +147,11 @@ cheekySearchId( -1 )
CreateProtoService(PS_GETMYAVATART, &CIcqProto::GetMyAvatar);
CreateProtoService(PS_SETMYAVATART, &CIcqProto::SetMyAvatar);
// Custom Status API
- CreateProtoService(PS_ICQ_SETCUSTOMSTATUS, &CIcqProto::SetXStatus);
- CreateProtoService(PS_ICQ_GETCUSTOMSTATUS, &CIcqProto::GetXStatus);
- CreateProtoService(PS_ICQ_SETCUSTOMSTATUSEX, &CIcqProto::SetXStatusEx);
- CreateProtoService(PS_ICQ_GETCUSTOMSTATUSEX, &CIcqProto::GetXStatusEx);
- CreateProtoService(PS_ICQ_GETCUSTOMSTATUSICON, &CIcqProto::GetXStatusIcon);
+ CreateProtoService(PS_SETCUSTOMSTATUSEX, &CIcqProto::SetXStatusEx);
+ CreateProtoService(PS_GETCUSTOMSTATUSEX, &CIcqProto::GetXStatusEx);
+ CreateProtoService(PS_GETCUSTOMSTATUSICON, &CIcqProto::GetXStatusIcon);
+ CreateProtoService(PS_GETADVANCEDSTATUSICON, &CIcqProto::RequestAdvStatusIconIdx);
CreateProtoService(PS_ICQ_REQUESTCUSTOMSTATUS, &CIcqProto::RequestXStatusDetails);
- CreateProtoService(PS_ICQ_GETADVANCEDSTATUSICON, &CIcqProto::RequestAdvStatusIconIdx);
CreateProtoService(MS_ICQ_ADDSERVCONTACT, &CIcqProto::AddServerContact);
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index a43c2bb36f..2c0d1a12ae 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -115,7 +115,6 @@ struct CIcqProto : public PROTO_INTERFACE, public MZeroedObject
INT_PTR __cdecl GetAvatarInfo(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetMyAvatar(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl GetXStatus(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetXStatusEx(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetXStatusIcon(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GrantAuthorization(WPARAM wParam, LPARAM lParam);
@@ -130,7 +129,6 @@ struct CIcqProto : public PROTO_INTERFACE, public MZeroedObject
INT_PTR __cdecl SetMyAvatar(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl SetNickName(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl SetPassword(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl SetXStatus(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl SetXStatusEx(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl ShowXStatusDetails(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 9802b1dee7..3c293eb48b 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -974,39 +974,13 @@ INT_PTR CIcqProto::ShowXStatusDetails(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR CIcqProto::SetXStatus(WPARAM wParam, LPARAM lParam)
-{
- if (!m_bXStatusEnabled && !m_bMoodsEnabled)
- return 0;
-
- if (wParam >= 0 && wParam <= XSTATUS_COUNT) {
- setXStatusEx((BYTE)wParam, 1);
- return wParam;
- }
- return 0;
-}
-
-INT_PTR CIcqProto::GetXStatus(WPARAM wParam, LPARAM lParam)
-{
- if (!m_bXStatusEnabled && !m_bMoodsEnabled) return 0;
-
- if (!icqOnline()) return 0;
-
- BYTE status = getContactXStatus(NULL);
-
- if (wParam) *((char**)wParam) = m_bXStatusEnabled ? DBSETTING_XSTATUS_NAME : NULL;
- if (lParam) *((char**)lParam) = DBSETTING_XSTATUS_MSG;
-
- return status;
-}
-
INT_PTR CIcqProto::SetXStatusEx(WPARAM wParam, LPARAM lParam)
{
- ICQ_CUSTOM_STATUS *pData = (ICQ_CUSTOM_STATUS*)lParam;
+ CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam;
if (!m_bXStatusEnabled && !m_bMoodsEnabled) return 1;
- if (pData->cbSize < sizeof(ICQ_CUSTOM_STATUS)) return 1; // Failure
+ if (pData->cbSize < sizeof(CUSTOM_STATUS)) return 1; // Failure
if (pData->flags & CSSF_MASK_STATUS) { // set custom status
int status = *pData->status;
@@ -1052,12 +1026,12 @@ INT_PTR CIcqProto::SetXStatusEx(WPARAM wParam, LPARAM lParam)
INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam)
{
- ICQ_CUSTOM_STATUS *pData = (ICQ_CUSTOM_STATUS*)lParam;
+ CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam;
HANDLE hContact = (HANDLE)wParam;
if (!m_bXStatusEnabled && !m_bMoodsEnabled) return 1;
- if (pData->cbSize < sizeof(ICQ_CUSTOM_STATUS)) return 1; // Failure
+ if (pData->cbSize < sizeof(CUSTOM_STATUS)) return 1; // Failure
// fill status member
if (pData->flags & CSSF_MASK_STATUS)
@@ -1066,7 +1040,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam)
// fill status name member
if (pData->flags & CSSF_MASK_NAME) {
if (pData->flags & CSSF_DEFAULT_NAME) {
- int status = *pData->wParam;
+ int status = (pData->wParam == NULL) ? getContactXStatus(hContact) : *pData->wParam;
if (status < 1 || status > XSTATUS_COUNT)
return 1; // Failure
diff --git a/protocols/IcqOscarJ/src/icqoscar.h b/protocols/IcqOscarJ/src/icqoscar.h
index ef0e32a6fd..92ed19550b 100644
--- a/protocols/IcqOscarJ/src/icqoscar.h
+++ b/protocols/IcqOscarJ/src/icqoscar.h
@@ -89,6 +89,7 @@
#include <m_cluiframes.h>
#include <m_ignore.h>
#include <m_avatars.h>
+#include <m_xstatus.h>
#include <win2k.h>
// Project resources