From 5b378496114ec47ffa27d3d9e7bc2a744d9e0a77 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 20 Nov 2012 13:36:00 +0000 Subject: - all xstatus services moved to m_xstatus.h - old obsoleted services PS_GETXSTATUS & PS_SETXSTATUS removed git-svn-id: http://svn.miranda-ng.org/main/trunk@2390 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/Mra.h | 2 +- protocols/MRA/src/MraConstans.h | 9 --------- protocols/MRA/src/MraProto.cpp | 22 ++++++++++------------ protocols/MRA/src/MraProto.h | 2 -- protocols/MRA/src/Mra_svcs.cpp | 41 ++++++++++------------------------------- 5 files changed, 21 insertions(+), 55 deletions(-) (limited to 'protocols/MRA/src') diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index 38d02d62c1..bcd8a3817d 100644 --- a/protocols/MRA/src/Mra.h +++ b/protocols/MRA/src/Mra.h @@ -65,7 +65,7 @@ #include #include #include -#include +#include #include diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h index d5e0ea5ebd..b0fbb07f26 100644 --- a/protocols/MRA/src/MraConstans.h +++ b/protocols/MRA/src/MraConstans.h @@ -251,15 +251,6 @@ static const LPSTR lpcszMailRuDomains[] = #define DBSETTING_BLOGSTATUS "BlogStatus" #define DBSETTING_BLOGSTATUSMUSIC "ListeningTo" -#define CSSF_MASK_STATUS 0x0001 // status member valid for set/get -#define CSSF_MASK_NAME 0x0002 // pszName member valid for set/get -#define CSSF_MASK_MESSAGE 0x0004 // pszMessage member valid for set/get -#define CSSF_DISABLE_UI 0x0040 // disable default custom status UI, wParam = bEnable -#define CSSF_DEFAULT_NAME 0x0080 // only with CSSF_MASK_NAME and get API to get default custom status name (wParam = status) -#define CSSF_STATUSES_COUNT 0x0100 // returns number of custom statuses in wParam, only get API -#define CSSF_STR_SIZES 0x0200 // returns sizes of custom status name & message (wParam & lParam members) in chars -#define CSSF_UNICODE 0x1000 // strings are in UCS-2 - extern const LPSTR lpcszStatusUri[]; extern const LPWSTR lpcszXStatusNameDef[]; diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 4d98c17a49..05a592fa25 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -21,21 +21,19 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : MraMPopSessionQueueInitialize(&hMPopSessionQueue); MraAvatarsQueueInitialize(&hAvatarsQueueHandle); - CreateObjectSvc(PS_ICQ_SETCUSTOMSTATUS, &CMraProto::MraSetXStatus); - CreateObjectSvc(PS_ICQ_SETCUSTOMSTATUSEX, &CMraProto::MraSetXStatusEx); - CreateObjectSvc(PS_ICQ_GETCUSTOMSTATUS, &CMraProto::MraGetXStatus); - CreateObjectSvc(PS_ICQ_GETCUSTOMSTATUSEX, &CMraProto::MraGetXStatusEx); - CreateObjectSvc(PS_ICQ_GETCUSTOMSTATUSICON, &CMraProto::MraGetXStatusIcon); + CreateObjectSvc(PS_SETCUSTOMSTATUSEX, &CMraProto::MraSetXStatusEx); + CreateObjectSvc(PS_GETCUSTOMSTATUSEX, &CMraProto::MraGetXStatusEx); + CreateObjectSvc(PS_GETCUSTOMSTATUSICON, &CMraProto::MraGetXStatusIcon); - CreateObjectSvc(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo); + CreateObjectSvc(PS_SET_LISTENINGTO, &CMraProto::MraSetListeningTo); - CreateObjectSvc(PS_CREATEACCMGRUI, &CMraProto::MraCreateAccMgrUI); - CreateObjectSvc(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps); - CreateObjectSvc(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo); - CreateObjectSvc(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar); + CreateObjectSvc(PS_CREATEACCMGRUI, &CMraProto::MraCreateAccMgrUI); + CreateObjectSvc(PS_GETAVATARCAPS, &CMraProto::MraGetAvatarCaps); + CreateObjectSvc(PS_GETAVATARINFOT, &CMraProto::MraGetAvatarInfo); + CreateObjectSvc(PS_GETMYAVATART, &CMraProto::MraGetMyAvatar); - CreateObjectSvc(MS_ICQ_SENDSMS, &CMraProto::MraSendSMS); - CreateObjectSvc(MRA_SEND_NUDGE, &CMraProto::MraSendNudge); + CreateObjectSvc(MS_ICQ_SENDSMS, &CMraProto::MraSendSMS); + CreateObjectSvc(MRA_SEND_NUDGE, &CMraProto::MraSendNudge); if ( ServiceExists(MS_NUDGE_SEND)) heNudgeReceived = CreateHookableEvent(MS_NUDGE); diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index fca74708d9..4555f28463 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -146,9 +146,7 @@ struct CMraProto : public PROTO_INTERFACE, public MZeroedObject return DB_GetContactSettingBlob(hContact, m_szModuleName, lpszValueName, lpbRet, dwRetBuffSize, pdwRetBuffSize); } // ====| Services |==================================================================== - INT_PTR __cdecl MraSetXStatus(WPARAM, LPARAM); INT_PTR __cdecl MraSetXStatusEx(WPARAM, LPARAM); - INT_PTR __cdecl MraGetXStatus(WPARAM, LPARAM); INT_PTR __cdecl MraGetXStatusEx(WPARAM, LPARAM); INT_PTR __cdecl MraGetXStatusIcon(WPARAM, LPARAM); INT_PTR __cdecl MraXStatusMenu(WPARAM, LPARAM, LPARAM param); diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index d61098201a..a845a88d89 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -794,24 +794,13 @@ DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus) return dwOldStatusMode; } -// obsolete (TODO: remove in next version) -INT_PTR CMraProto::MraSetXStatus(WPARAM wParam, LPARAM lParam) -{ - INT_PTR iRet = 0; - if ( IsXStatusValid(wParam) || wParam == MRA_MIR_XSTATUS_NONE) { - MraSetXStatusInternal(wParam); - iRet = wParam; - } - return iRet; -} - INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam) { INT_PTR iRet = 1; DWORD dwXStatus; - ICQ_CUSTOM_STATUS *pData = (ICQ_CUSTOM_STATUS*)lParam; + CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam; - if (pData->cbSize >= sizeof(ICQ_CUSTOM_STATUS)) { + if (pData->cbSize >= sizeof(CUSTOM_STATUS)) { iRet = 0; if (pData->flags & CSSF_MASK_STATUS) { @@ -884,24 +873,13 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM wParam, LPARAM lParam) return iRet; } -INT_PTR CMraProto::MraGetXStatus(WPARAM wParam, LPARAM lParam) -{ - if (m_bLoggedIn) { - if (wParam) *((CHAR**)wParam) = DBSETTING_XSTATUSNAME; - if (lParam) *((CHAR**)lParam) = DBSETTING_XSTATUSMSG; - return m_iXStatus; - } - - return 0; -} - INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam) { INT_PTR iRet = 1; HANDLE hContact = (HANDLE)wParam; - ICQ_CUSTOM_STATUS *pData = (ICQ_CUSTOM_STATUS*)lParam; + CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam; - if (pData->cbSize >= sizeof(ICQ_CUSTOM_STATUS)) { + if (pData->cbSize >= sizeof(CUSTOM_STATUS)) { DWORD dwXStatus; iRet = 0; @@ -913,11 +891,10 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam) // fill status name member if (pData->flags & CSSF_MASK_NAME) { if (pData->flags & CSSF_DEFAULT_NAME) { - dwXStatus = (*pData->wParam); + dwXStatus = (pData->wParam == NULL) ? m_iXStatus : *pData->wParam; if ( IsXStatusValid(dwXStatus)) { - if (pData->flags & CSSF_UNICODE) { + if (pData->flags & CSSF_UNICODE) lstrcpynW(pData->pwszName, lpcszXStatusNameDef[dwXStatus], (STATUS_TITLE_MAX+1)); - } else { size_t dwStatusTitleSize = lstrlenW( lpcszXStatusNameDef[dwXStatus] ); if (dwStatusTitleSize>STATUS_TITLE_MAX) dwStatusTitleSize = STATUS_TITLE_MAX; @@ -938,10 +915,12 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM wParam, LPARAM lParam) // fill status message member if (pData->flags & CSSF_MASK_MESSAGE) { + char szSetting[100]; + mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dMsg", m_iXStatus); if (pData->flags & CSSF_UNICODE) - mraGetStaticStringW(hContact, DBSETTING_XSTATUSMSG, pData->pwszMessage, (STATUS_DESC_MAX+1), NULL); + mraGetStaticStringW(hContact, szSetting, pData->pwszMessage, (STATUS_DESC_MAX+1), NULL); else - mraGetStaticStringA(hContact, DBSETTING_XSTATUSMSG, pData->pszMessage, (STATUS_DESC_MAX+1), NULL); + mraGetStaticStringA(hContact, szSetting, pData->pszMessage, (STATUS_DESC_MAX+1), NULL); } if (pData->flags & CSSF_DISABLE_UI) -- cgit v1.2.3