diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-20 13:36:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-20 13:36:00 +0000 |
commit | 5b378496114ec47ffa27d3d9e7bc2a744d9e0a77 (patch) | |
tree | f7550dadde23f61182af6e542101eb5fedfa2d85 | |
parent | 0ba80eef50988ca3e88a16839eaf0a840f1cb139 (diff) |
- 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
37 files changed, 136 insertions, 400 deletions
diff --git a/include/m_icq.h b/include/m_icq.h index 125eeef885..5478c09e00 100644 --- a/include/m_icq.h +++ b/include/m_icq.h @@ -177,81 +177,6 @@ typedef struct { //uin is the UIN of the contact requesting our status message
#define ME_ICQ_STATUSMSGREQ "/StatusMsgReq"
-
-
-/* Custom Status helper API *
- - to set custom status message & title use PS_ICQ_GETCUSTOMSTATUS to obtain
- DB settings and write values to them (UTF-8 strings best). (obsolete)
- - use PS_ICQ_GETCUSTOMSTATUSEX and PS_ICQ_SETCUSTOMSTATUSEX for controling Custom Status
- - custom messages for each user supported - ME_ICQ_STATUSMSGREQ with type MTYPE_SCRIPT_NOTIFY
- */
-#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_MENU 0x0020 // disable default custom status menu, wParam = bEnable
-#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
-
-#if defined(_UNICODE)
- #define CSSF_TCHAR CSSF_UNICODE
-#else
- #define CSSF_TCHAR 0
-#endif
-
-
-typedef struct {
- int cbSize; // size of the structure
- int flags; // combination of CSSF_*
- int *status; // custom status id
- union {
- char *pszName; // buffer for custom status name
- TCHAR *ptszName;
- WCHAR *pwszName;
- };
- union {
- char *pszMessage; // buffer for custom status message
- TCHAR *ptszMessage;
- WCHAR *pwszMessage;
- };
- WPARAM *wParam; // extra params, see flags
- LPARAM *lParam;
-} ICQ_CUSTOM_STATUS;
-
-// Sets owner current custom status (obsolete)
-//wParam = (int)N // custom status id (1-32)
-//lParam = 0
-//return = N (id of status set) or 0 (failed - probably bad params)
-#define PS_ICQ_SETCUSTOMSTATUS "/SetXStatus"
-
-// Sets owner current custom status
-//wParam = 0 // reserved
-//lParam = (ICQ_CUSTOM_STATUS*)pData // contains what to set and new values
-//return = 0 (for success)
-#define PS_ICQ_SETCUSTOMSTATUSEX "/SetXStatusEx"
-
-// Retrieves custom status details for specified hContact
-//wParam = (HANDLE)hContact
-//lParam = (ICQ_CUSTOM_STATUS*)pData // receives details (members must be prepared)
-//return = 0 (for success)
-#define PS_ICQ_GETCUSTOMSTATUSEX "/GetXStatusEx"
-
-#define LR_BIGICON 0x40
-
-// Retrieves specified custom status icon
-//wParam = (int)N // custom status id (1-32), 0 = my current custom status
-//lParam = flags // use LR_SHARED for shared HICON, LR_BIGICON for 32x32 icon
-//return = HICON // custom status icon (use DestroyIcon to release resources if not LR_SHARED)
-#define PS_ICQ_GETCUSTOMSTATUSICON "/GetXStatusIcon"
-
-// Get Custom status DB field names & current owner custom status (obsolete)
-//wParam = (char**)szDBTitle // will receive title DB setting name (do not free)
-//lParam = (char**)szDBMsg // will receive message DB setting name
-//return = N // current custom status id if successful, 0 otherwise
-#define PS_ICQ_GETCUSTOMSTATUS "/GetXStatus"
-
// Request Custom status details (messages) for specified contact
//wParam = hContact // request custom status details for this contact
//lParam = 0
@@ -260,10 +185,4 @@ typedef struct { // -1 delayed (rate control) - sequence unknown
#define PS_ICQ_REQUESTCUSTOMSTATUS "/RequestXStatusDetails"
-// Called from contact list in order to get index of custom status icon in list
-// wParam = hContact
-// lParam = 0
-// rerurn = (int)index of extra contact icon shifted <<16 (the low word will be normal status icon, the high will be xStatus Icon
-#define PS_ICQ_GETADVANCEDSTATUSICON "/GetAdvancedStatusIcon"
-
#endif // M_ICQ_H__
diff --git a/include/m_jabber.h b/include/m_jabber.h index d660528b60..8b5b456ace 100644 --- a/include/m_jabber.h +++ b/include/m_jabber.h @@ -195,53 +195,6 @@ __forceinline IJabberInterface *getJabberApi(const char *szAccount) return NULL;
}
-/* Custom Status helper API *
- DB settings and write values to them (UTF-8 strings best). (obsolete)
- - use JS_GETXSTATUSEX and JS_SETXSTATUSEX for controling Custom Status
- */
-#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_MENU 0x0020 // disable default custom status menu, wParam = bEnable
-#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
-
-#if defined(_UNICODE)
- #define CSSF_TCHAR CSSF_UNICODE
-#else
- #define CSSF_TCHAR 0
-#endif
-
-typedef struct {
- int cbSize; // size of the structure
- int flags; // combination of CSSF_*
- int *status; // custom status id
- union {
- char *pszMessage; // buffer for custom status message
- TCHAR *ptszMessage;
- WCHAR *pwszMessage;
- };
- WPARAM *wParam; // extra params, see flags
- LPARAM *lParam;
-} JABBER_CUSTOM_STATUS;
-
-// Sets owner current custom status
-//wParam = 0 // reserved
-//lParam = (JABBER_CUSTOM_STATUS*)pData // contains what to set and new values
-//return = 0 (for success)
-#define JS_SETXSTATUSEX "/SetXStatusEx"
-
-// Retrieves custom status details for specified hContact
-//wParam = (HANDLE)hContact
-//lParam = (JABBER_CUSTOM_STATUS*)pData // receives details (members must be prepared)
-//return = 0 (for success)
-
-// not needed anymore and therefore commented out
-//#define JS_GETXSTATUSEX "/GetXStatusEx"
-
#endif // __cplusplus
#endif // M_JABBER_H__
diff --git a/plugins/CSList/cslist_10.vcxproj.filters b/plugins/CSList/cslist_10.vcxproj.filters index eb57988f85..57c03ce842 100644 --- a/plugins/CSList/cslist_10.vcxproj.filters +++ b/plugins/CSList/cslist_10.vcxproj.filters @@ -13,9 +13,6 @@ <UniqueIdentifier>{0c22408f-3e3b-4310-970e-525e94308c9d}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
- <Filter Include="Other">
- <UniqueIdentifier>{072cb5e6-88d2-4b64-a2ee-b49ae44f8b49}</UniqueIdentifier>
- </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\cslist.cpp">
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 7c0c4b23b5..9f1a80b810 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -257,8 +257,8 @@ void CSList::setStatus( WORD code, StatusItem* item, char* protoName) int statusToSet = -1;
if (lstrcmpA(pdescr->szProtoName, "ICQ") == 0)
{
- ICQ_CUSTOM_STATUS ics = {0};
- ics.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ CUSTOM_STATUS ics = {0};
+ ics.cbSize = sizeof(CUSTOM_STATUS);
ics.flags = CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_TCHAR;
if (code == IDC_CANCEL)
@@ -278,13 +278,13 @@ void CSList::setStatus( WORD code, StatusItem* item, char* protoName) ics.status = &statusToSet;
char protoService[64];
- mir_snprintf(protoService, SIZEOF(protoService), "%s%s", protoName, PS_ICQ_SETCUSTOMSTATUSEX);
+ mir_snprintf(protoService, SIZEOF(protoService), "%s%s", protoName, PS_SETCUSTOMSTATUSEX);
CallService(protoService, 0, (LPARAM)&ics);
}
if (lstrcmpA(pdescr->szProtoName, "JABBER") == 0)
{
JABBER_CUSTOM_STATUS ics = {0};
- ics.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ ics.cbSize = sizeof(CUSTOM_STATUS);
ics.flags = CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_TCHAR;
if (code == IDC_CANCEL)
diff --git a/plugins/CSList/src/cslist.h b/plugins/CSList/src/cslist.h index ec2e533771..fa66a2c116 100644 --- a/plugins/CSList/src/cslist.h +++ b/plugins/CSList/src/cslist.h @@ -69,7 +69,7 @@ #include <m_icolib.h>
#include <m_protocols.h>
#include <m_protosvc.h>
-#include <m_icq.h>
+#include <m_xstatus.h>
#include <m_jabber.h>
#include <m_options.h>
#include <m_hotkeys.h>
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index 1ffcc2ac76..383ad487d8 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -84,6 +84,7 @@ #include <m_fontservice.h>
#include <m_metacontacts.h>
#include <m_cln_skinedit.h>
+#include <m_xstatus.h>
#include <m_extraicons.h>
#include "extbackg.h"
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 4099b03c08..160bc97112 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -31,7 +31,6 @@ */
#include <commonheaders.h>
-#include <m_icq.h>
extern int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
extern int ( *saveAddInfoItemToGroup )(ClcGroup *group, int flags, const TCHAR *pszText);
@@ -301,10 +300,10 @@ BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto) TCHAR xStatusName[128];
char szServiceName[128];
- mir_snprintf(szServiceName, 128, "%s%s", szProto, PS_ICQ_GETCUSTOMSTATUSEX);
+ mir_snprintf(szServiceName, 128, "%s%s", szProto, PS_GETCUSTOMSTATUSEX);
- ICQ_CUSTOM_STATUS cst = {0};
- cst.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ CUSTOM_STATUS cst = {0};
+ cst.cbSize = sizeof(CUSTOM_STATUS);
cst.flags = CSSF_MASK_STATUS;
cst.status = &xStatus;
if (ServiceExists(szServiceName) && !CallService(szServiceName, (WPARAM)hContact, (LPARAM)&cst) && xStatus > 0) {
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index d39e996e73..c283da5058 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -32,7 +32,6 @@ #include <commonheaders.h>
#include <m_findadd.h>
-#include <m_icq.h>
#include "../cluiframes/cluiframes.h"
#include "../coolsb/coolscroll.h"
@@ -1787,16 +1786,16 @@ buttons_done: mir_snprintf(szBuffer, 128, "%s_conn", pd->RealName);
hIcon = Skin_GetIcon(szBuffer);
} else if (cfg::dat.bShowXStatusOnSbar && status > ID_STATUS_OFFLINE) {
- ICQ_CUSTOM_STATUS cst = {0};
+ CUSTOM_STATUS cst = {0};
char szServiceName[128];
int xStatus;
- mir_snprintf(szServiceName, 128, "%s%s", pd->RealName, PS_ICQ_GETCUSTOMSTATUSEX);
- cst.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ mir_snprintf(szServiceName, 128, "%s%s", pd->RealName, PS_GETCUSTOMSTATUSEX);
+ cst.cbSize = sizeof(CUSTOM_STATUS);
cst.flags = CSSF_MASK_STATUS;
cst.status = &xStatus;
if (ServiceExists(szServiceName) && !CallService(szServiceName, 0, (LPARAM)&cst) && xStatus > 0) {
- hIcon = (HICON)CallProtoService(pd->RealName, PS_ICQ_GETCUSTOMSTATUSICON, 0, LR_SHARED); // get OWN xStatus icon (if set)
+ hIcon = (HICON)CallProtoService(pd->RealName, PS_GETCUSTOMSTATUSICON, 0, LR_SHARED); // get OWN xStatus icon (if set)
} else
hIcon = LoadSkinnedProtoIcon(szProto, status);
} else
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 6bba347513..2d8c2e0db8 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -25,7 +25,6 @@ UNICODE done */
#include <commonheaders.h>
#include "../cluiframes/cluiframes.h"
-#include <m_icq.h>
extern HIMAGELIST hCListImages;
extern ButtonItem *g_ButtonItems;
diff --git a/plugins/KeyboardNotify/src/Common.h b/plugins/KeyboardNotify/src/Common.h index 406f5c14ad..20b2f13d17 100644 --- a/plugins/KeyboardNotify/src/Common.h +++ b/plugins/KeyboardNotify/src/Common.h @@ -51,7 +51,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_contacts.h>
#include <m_message.h>
#include <m_utils.h>
-#include <m_icq.h>
+#include <m_xstatus.h>
#include <m_clc.h>
#include <m_skin.h>
#include <win2k.h>
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 7806e4c69d..02254e11ef 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -451,26 +451,24 @@ BOOL checkGlobalStatus() BOOL checkGlobalXstatus()
{
- ICQ_CUSTOM_STATUS xstatus={0};
- int i, protosSupporting, status=0;
+ int protosSupporting=0, status=0;
- for(i=0, protosSupporting=0; i < ProtoList.protoCount; i++) {
- if (!ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count) continue;
+ for (int i=0; i < ProtoList.protoCount; i++) {
+ if ( !ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count)
+ continue;
protosSupporting++;
// Retrieve xstatus for protocol
- xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ CUSTOM_STATUS xstatus = { sizeof(CUSTOM_STATUS) };
xstatus.flags = CSSF_MASK_STATUS;
xstatus.status = &status;
- CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
+ CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
- if (ProtoList.protoInfo[i].xstatus.enabled[status]) return TRUE;
+ if (ProtoList.protoInfo[i].xstatus.enabled[status])
+ return TRUE;
}
- if (!protosSupporting)
- return TRUE;
- else
- return FALSE;
+ return protosSupporting == 0;
}
@@ -676,7 +674,7 @@ BOOL checkStatus(char *szProto) BOOL checkXstatus(char *szProto)
{
int status=0;
- ICQ_CUSTOM_STATUS xstatus={0};
+ CUSTOM_STATUS xstatus={0};
if (!szProto)
return checkGlobalXstatus();
@@ -686,10 +684,10 @@ BOOL checkXstatus(char *szProto) if (!ProtoList.protoInfo[i].xstatus.count) return TRUE;
// Retrieve xstatus for protocol
- xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ xstatus.cbSize = sizeof(CUSTOM_STATUS);
xstatus.flags = CSSF_MASK_STATUS;
xstatus.status = &status;
- CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
+ CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
return ProtoList.protoInfo[i].xstatus.enabled[status];
}
@@ -962,16 +960,16 @@ void updateXstatusProto(PROTOCOL_INFO *protoInfo) {
unsigned int i;
char szServiceName[MAXMODULELABELLENGTH];
- ICQ_CUSTOM_STATUS xstatus={0};
+ CUSTOM_STATUS xstatus={0};
- mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", protoInfo->szProto, PS_ICQ_GETCUSTOMSTATUSEX);
+ mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", protoInfo->szProto, PS_GETCUSTOMSTATUSEX);
if (!ServiceExists(szServiceName)) return;
// Retrieve xstatus.count
- xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ xstatus.cbSize = sizeof(CUSTOM_STATUS);
xstatus.flags = CSSF_STATUSES_COUNT;
xstatus.wParam = &(protoInfo->xstatus.count);
- CallProtoService(protoInfo->szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
+ CallProtoService(protoInfo->szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
(protoInfo->xstatus.count)++; // Don't forget about xstatus=0 (None)
// Alloc and initiailize xstatus.enabled array
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 7ef9db3380..49a3f3fd89 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -1443,22 +1443,22 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hParent = TreeView_InsertItem(hwndTree, &tvis);
for(j = 0; j < XstatusListAux[i].count; j++) {
TCHAR szDefaultName[1024];
- ICQ_CUSTOM_STATUS xstatus={0};
+ CUSTOM_STATUS xstatus={0};
tvis.hParent = hParent;
tvis.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
if (!j){
tvis.item.pszText = TranslateT("None"); }
else {
- xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ xstatus.cbSize = sizeof(CUSTOM_STATUS);
xstatus.flags = CSSF_MASK_NAME|CSSF_DEFAULT_NAME|CSSF_UNICODE;
xstatus.ptszName = szDefaultName;
xstatus.wParam = &j;
- CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
+ CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
tvis.item.pszText = szDefaultName;
}
tvis.item.lParam = (LPARAM)j;
- tvis.item.iImage = tvis.item.iSelectedImage = j?ImageList_AddIcon(hImageList, hIconAux=(HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSICON, (WPARAM)j, 0)):0;
+ tvis.item.iImage = tvis.item.iSelectedImage = j?ImageList_AddIcon(hImageList, hIconAux=(HICON)CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSICON, (WPARAM)j, 0)):0;
if (hIconAux) DestroyIcon(hIconAux);
TreeView_InsertItem(hwndTree, &tvis);
}
diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h index 36f9fa0a34..29915aa334 100644 --- a/plugins/ListeningTo/src/commons.h +++ b/plugins/ListeningTo/src/commons.h @@ -56,7 +56,7 @@ Boston, MA 02111-1307, USA. #include <m_radio.h>
#include <m_toptoolbar.h>
#include <m_icolib.h>
-#include <m_icq.h>
+#include <m_xstatus.h>
#include <m_variables.h>
#include <m_clui.h>
#include <m_cluiframes.h>
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 538dc8ba89..931270ff1b 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -226,8 +226,7 @@ void RebuildMenu() void RegisterProtocol(char *proto, TCHAR *account)
{
- if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) &&
- !ProtoServiceExists(proto, PS_ICQ_SETCUSTOMSTATUSEX))
+ if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) && !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX))
return;
size_t id = proto_items.size();
@@ -578,13 +577,13 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) if (ProtoServiceExists(proto, PS_SET_LISTENINGTO))
CallProtoService(proto, PS_SET_LISTENINGTO, 0, (LPARAM) lti);
- else if (ProtoServiceExists(proto, PS_ICQ_SETCUSTOMSTATUSEX)) {
+ else if (ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX)) {
if (opts.xstatus_set == IGNORE_XSTATUS)
return;
int status;
- ICQ_CUSTOM_STATUS ics = {0};
- ics.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ CUSTOM_STATUS ics = {0};
+ ics.cbSize = sizeof(CUSTOM_STATUS);
ics.status = &status;
// Set or reset?
@@ -592,7 +591,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) {
// Reset -> only if is still in music xstatus
ics.flags = CSSF_MASK_STATUS;
- if (CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC)
+ if (CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC)
{
if (opts.xstatus_set == SET_XSTATUS)
{
@@ -623,14 +622,14 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.ptszName = name.str;
ics.ptszMessage = msg.str;
- CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
+ CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
}
else if (opts.xstatus_set == CHECK_XSTATUS)
{
status = 0;
ics.flags = CSSF_MASK_STATUS;
- CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
+ CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
}
else
{
@@ -649,7 +648,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.flags = CSSF_MASK_STATUS;
}
- CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
+ CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
if (pi != NULL)
{
@@ -665,20 +664,20 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) if (opts.xstatus_set == CHECK_XSTATUS_MUSIC)
{
ics.flags = CSSF_MASK_STATUS;
- if (CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC)
+ if (CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) || status != XSTATUS_MUSIC)
return;
}
else if (opts.xstatus_set == CHECK_XSTATUS)
{
ics.flags = CSSF_MASK_STATUS;
- if (!CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC && status != 0)
+ if (!CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC && status != 0)
return;
}
else
{
// Store old data
ics.flags = CSSF_MASK_STATUS;
- if (!CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC)
+ if (!CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics) && status != XSTATUS_MUSIC)
{
ProtocolInfo *pi = GetProtoInfo(proto);
if (pi != NULL)
@@ -688,7 +687,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.ptszName = pi->old_xstatus_name;
ics.ptszMessage = pi->old_xstatus_message;
- CallProtoService(proto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
+ CallProtoService(proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
}
}
}
@@ -717,7 +716,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti) ics.ptszName = name.str;
ics.ptszMessage = msg.str;
- CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
+ CallProtoService(proto, PS_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
mir_free(fr[1]);
}
@@ -756,7 +755,7 @@ INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam) else
{
if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) &&
- !ProtoServiceExists(proto, PS_ICQ_SETCUSTOMSTATUSEX) &&
+ !ProtoServiceExists(proto, PS_SETCUSTOMSTATUSEX) &&
!ProtoServiceExists(proto, PS_SETAWAYMSGT)) // by yaho
return 0;
diff --git a/plugins/MyDetails/src/commons.h b/plugins/MyDetails/src/commons.h index 4753c28d70..5d875f8aff 100644 --- a/plugins/MyDetails/src/commons.h +++ b/plugins/MyDetails/src/commons.h @@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. #include <m_variables.h>
#include <m_avatars.h>
#include <m_statusplugins.h>
-#include <m_icq.h>
+#include <m_xstatus.h>
#include <m_icolib.h>
#include "m_cluiframes.h"
#include "m_simpleaway.h"
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index ddd96e920c..930afa2bda 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -130,11 +130,17 @@ int Protocol::GetStatus() data_changed = true;
// check if protocol supports custom status
- if (ProtoServiceExists(name, PS_ICQ_GETCUSTOMSTATUS))
+ CUSTOM_STATUS css = { sizeof(css) };
+ if ( ProtoServiceExists(name, PS_GETCUSTOMSTATUSEX)) {
// check if custom status is set
- custom_status = CallProtoService(name, PS_ICQ_GETCUSTOMSTATUS, (WPARAM) &custom_status_name, (LPARAM) &custom_status_message);
- else
- custom_status = 0;
+ css.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE | CSSF_DEFAULT_NAME;
+ css.status = &custom_status;
+ css.ptszName = status_name;
+ css.ptszMessage = status_message;
+ if ( CallProtoService(name, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&css) != 0)
+ status_message[0] = status_name[0] = 0, custom_status = 0;
+ }
+ else custom_status = 0;
// if protocol supports custom status, but it is not set (custom_status will be -1), show normal status
if (custom_status < 0) custom_status = 0;
@@ -142,35 +148,24 @@ int Protocol::GetStatus() if (custom_status == 0) {
TCHAR *tmp = (TCHAR*) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, status, GSMDF_TCHAR);
lcopystr(status_name, tmp, SIZEOF(status_name));
- } else {
- DBVARIANT dbv;
+ }
+ else {
TCHAR tmp[256]; tmp[0] = 0;
- if (custom_status_name != NULL && custom_status_name[0] != '\0' && !DBGetContactSettingTString(0, name, custom_status_name, &dbv)) {
- if (dbv.ptszVal != NULL && dbv.ptszVal[0] != _T('\0'))
- lstrcpyn(tmp, dbv.ptszVal, SIZEOF(tmp));
- else
- lstrcpyn(tmp, TranslateT("<no status name>"), SIZEOF(tmp));
-
- DBFreeVariant(&dbv);
- } else {
+ if (status_name[0] != '\0')
+ lstrcpyn(tmp, status_name, SIZEOF(tmp));
+ else
lstrcpyn(tmp, TranslateT("<no status name>"), SIZEOF(tmp));
- }
-
- if (custom_status_message != NULL && custom_status_message[0] != '\0' && !DBGetContactSettingTString(0, name, custom_status_message, &dbv)) {
- if (dbv.ptszVal != NULL && dbv.ptszVal[0] != '\0') {
- int len = lstrlen(tmp);
-
- if (len < SIZEOF(tmp))
- lstrcpyn(&tmp[len], _T(": "), SIZEOF(tmp) - len);
- len += 2;
+ if (status_message[0] != '\0') {
+ int len = lstrlen(tmp);
+ if (len < SIZEOF(tmp))
+ lstrcpyn(&tmp[len], _T(": "), SIZEOF(tmp) - len);
- if (len < SIZEOF(tmp))
- lstrcpyn(&tmp[len], dbv.ptszVal, SIZEOF(tmp) - len);
- }
+ len += 2;
- DBFreeVariant(&dbv);
+ if (len < SIZEOF(tmp))
+ lstrcpyn(&tmp[len], status_message, SIZEOF(tmp) - len);
}
lcopystr(status_name, tmp, SIZEOF(status_name));
@@ -450,7 +445,7 @@ TCHAR * Protocol::GetListeningTo() }
lcopystr(listening_to, dbv.ptszVal, SIZEOF(listening_to));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return listening_to;
}
@@ -604,7 +599,7 @@ void ProtocolArray::GetDefaultNick() DBVARIANT dbv;
if ( !DBGetContactSettingTString(0, MODULE_NAME, SETTING_DEFAULT_NICK, &dbv)) {
lstrcpyn(default_nick, dbv.ptszVal, SIZEOF(default_nick));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else default_nick[0] = '\0';
}
@@ -614,7 +609,7 @@ void ProtocolArray::GetDefaultAvatar() DBVARIANT dbv;
if ( !DBGetContactSettingTString(0, "ContactPhoto", "File", &dbv)) {
lstrcpyn(default_avatar_file, dbv.ptszVal, SIZEOF(default_avatar_file));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else default_avatar_file[0] = '\0';
}
diff --git a/plugins/MyDetails/src/data.h b/plugins/MyDetails/src/data.h index 468bc6c590..9eb355e333 100644 --- a/plugins/MyDetails/src/data.h +++ b/plugins/MyDetails/src/data.h @@ -42,9 +42,7 @@ public: TCHAR description[256];
TCHAR nickname[256];
TCHAR status_name[256];
- char *custom_status_name;
TCHAR status_message[1024];
- char *custom_status_message;
TCHAR listening_to[1024];
AVATARCACHEENTRY *ace;
TCHAR avatar_file[1024];
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 690bd84a9d..f2e056082b 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1287,18 +1287,13 @@ void Draw(HWND hwnd, HDC hdc_orig) SelectClipRgn(hdc, rgn);
HICON status_icon;
- if (proto->custom_status != 0 && ProtoServiceExists(proto->name, PS_ICQ_GETCUSTOMSTATUSICON))
- {
- status_icon = (HICON) CallProtoService(proto->name, PS_ICQ_GETCUSTOMSTATUSICON, proto->custom_status, 0);
- }
+ if (proto->custom_status != 0 && ProtoServiceExists(proto->name, PS_GETCUSTOMSTATUSICON))
+ status_icon = (HICON) CallProtoService(proto->name, PS_GETCUSTOMSTATUSICON, proto->custom_status, 0);
else
- {
status_icon = LoadSkinnedProtoIcon(proto->name, proto->status);
- }
- if (status_icon != NULL)
- {
- DrawIconEx(hdc, data->status_icon_rect.left, data->status_icon_rect.top, status_icon,
- ICON_SIZE, ICON_SIZE, 0, NULL, DI_NORMAL);
+
+ if (status_icon != NULL) {
+ DrawIconEx(hdc, data->status_icon_rect.left, data->status_icon_rect.top, status_icon, ICON_SIZE, ICON_SIZE, 0, NULL, DI_NORMAL);
DeleteObject(status_icon);
}
@@ -2668,21 +2663,9 @@ int SettingsChangedHook(WPARAM wParam, LPARAM lParam) if ((HANDLE)wParam == NULL)
{
- Protocol *proto = protocols->Get((const char *) cws->szModule);
-
- if ( !strcmp(cws->szSetting,"Status")
- || ( proto != NULL && proto->custom_status != 0
- && proto->custom_status_name != NULL
- && !strcmp(cws->szSetting, proto->custom_status_name))
- || ( proto != NULL && proto->custom_status != 0
- && proto->custom_status_message != NULL
- && !strcmp(cws->szSetting, proto->custom_status_message)))
- {
- // Status changed
- if (proto != NULL)
- PostMessage(hwnd_frame, MWM_STATUS_CHANGED, (WPARAM) proto->name, 0);
- }
- else if (!strcmp(cws->szSetting,"MyHandle")
+ Protocol *proto = protocols->Get((const char*)cws->szModule);
+
+ if (!strcmp(cws->szSetting,"MyHandle")
|| !strcmp(cws->szSetting,"UIN")
|| !strcmp(cws->szSetting,"Nick")
|| !strcmp(cws->szSetting,"FirstName")
diff --git a/plugins/NewXstatusNotify/src/common.h b/plugins/NewXstatusNotify/src/common.h index e44291ed75..1f988183a1 100644 --- a/plugins/NewXstatusNotify/src/common.h +++ b/plugins/NewXstatusNotify/src/common.h @@ -67,7 +67,7 @@ #include "m_system.h"
#include "m_userinfo.h"
#include "m_utils.h"
-#include "m_icq.h"
+#include "m_xstatus.h"
#include "m_extraicons.h"
#include "m_metacontacts.h"
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index f80caba2f1..bc2bb541e6 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -151,7 +151,7 @@ void ShowPopup(XSTATUSCHANGE *xsc) case TYPE_ICQ_XSTATUS:
{
int statusId = db_get_b(xsc->hContact, xsc->szProto, "XStatusId", 0);
- ppd.lchIcon = (HICON)CallProtoService(xsc->szProto, PS_ICQ_GETCUSTOMSTATUSICON, statusId, LR_SHARED);
+ ppd.lchIcon = (HICON)CallProtoService(xsc->szProto, PS_GETCUSTOMSTATUSICON, statusId, LR_SHARED);
}
}
@@ -367,12 +367,12 @@ TCHAR *GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int buffl TCHAR nameBuff[64];
buff[0] = 0;
- ICQ_CUSTOM_STATUS xstatus = {0};
- xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ CUSTOM_STATUS xstatus = {0};
+ xstatus.cbSize = sizeof(CUSTOM_STATUS);
xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
xstatus.ptszName = nameBuff;
xstatus.wParam = (WPARAM *)&statusID;
- if (!CallProtoService(szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus)) {
+ if (!CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus)) {
_tcsncpy(buff, TranslateTS(nameBuff), bufflen);
buff[bufflen - 1] = 0;
}
diff --git a/plugins/TipperYM/src/common.h b/plugins/TipperYM/src/common.h index 9098589d1c..d66c1bd221 100644 --- a/plugins/TipperYM/src/common.h +++ b/plugins/TipperYM/src/common.h @@ -76,6 +76,7 @@ Boston, MA 02111-1307, USA. #include <m_system.h>
#include <m_timezones.h>
#include <m_utils.h>
+#include <m_xstatus.h>
#include <m_icq.h>
#include "resource.h"
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index a5a9b59bfe..34cf0f596a 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -205,7 +205,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // get advanced status icon
if (pwd->bIsIconVisible[1])
{
- pwd->extraIcons[1].hIcon = (HICON)CallProtoService(pwd->clcit.szProto, PS_ICQ_GETCUSTOMSTATUSICON, 0, 0);
+ pwd->extraIcons[1].hIcon = (HICON)CallProtoService(pwd->clcit.szProto, PS_GETCUSTOMSTATUSICON, 0, 0);
pwd->extraIcons[1].bDestroy = true;
}
}
@@ -413,7 +413,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DBFreeVariant(&dbv);
}
- pwd->extraIcons[i].hIcon = (HICON)CallProtoService(szIconProto, PS_ICQ_GETCUSTOMSTATUSICON, (WPARAM)iXstatus, LR_SHARED);
+ pwd->extraIcons[i].hIcon = (HICON)CallProtoService(szIconProto, PS_GETCUSTOMSTATUSICON, (WPARAM)iXstatus, LR_SHARED);
pwd->extraIcons[i].bDestroy = false;
}
}
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 1fd6e67c39..714c769f2d 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -583,7 +583,7 @@ TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, c TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
TCHAR szDefaultName[1024];
- ICQ_CUSTOM_STATUS xstatus = {0};
+ CUSTOM_STATUS xstatus = {0};
DBVARIANT dbv;
// translate jabber mood
@@ -603,13 +603,13 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons int status = DBGetContactSettingByte(hContact, szModuleName, "XStatusId", 0);
if (!status) return 0;
- if (ProtoServiceExists(szModuleName, PS_ICQ_GETCUSTOMSTATUSEX))
+ if (ProtoServiceExists(szModuleName, PS_GETCUSTOMSTATUSEX))
{
- xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ xstatus.cbSize = sizeof(CUSTOM_STATUS);
xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
xstatus.ptszName = szDefaultName;
xstatus.wParam = (WPARAM *)&status;
- if (CallProtoService(szModuleName, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
+ if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
return 0;
_tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index 441fa4cb6a..8a31f3c1ee 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -45,7 +45,7 @@ static TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* if ( !DBGetContactSettingTString(hContact, module, setting, &dbv))
{
lstrcpyn(out, dbv.ptszVal, (int)len);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
{
@@ -146,7 +146,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) if ( !DBGetContactSettingString(NULL, module, ctrl->setting, &dbv))
{
lstrcpynA(tmp, dbv.pszVal, SIZEOF(tmp));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (tmp[0] != 0)
@@ -281,7 +281,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha DBVARIANT dbv = {0};
if ( !DBGetContactSettingString(NULL, module, ctrl->setting, &dbv)) {
lstrcpynA(tmp, dbv.pszVal, SIZEOF(tmp));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (tmp[0] != 0)
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
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index 72fb6f12a6..f40352c2b4 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -77,6 +77,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_timezones.h>
#include <m_jabber.h>
#include <m_fingerprint.h>
+#include <m_xstatus.h>
#include <m_extraicons.h>
#include <win2k.h>
@@ -246,10 +247,6 @@ enum { #define LR_BIGICON 0x40
#define JS_SENDXML "/SendXML" // Warning: This service is obsolete. Use IJabberNetInterface::SendXmlNode() instead.
-#define JS_GETADVANCEDSTATUSICON "/GetAdvancedStatusIcon"
-#define JS_GETCUSTOMSTATUSICON "/GetXStatusIcon"
-#define JS_GETXSTATUS "/GetXStatus"
-#define JS_SETXSTATUS "/SetXStatus"
#define JS_HTTP_AUTH "/HttpAuthRequest"
#define JS_INCOMING_NOTE_EVENT "/IncomingNoteEvent"
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 12a870ec20..d74ca56df1 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -120,13 +120,11 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) : JCreateService(PS_JOINCHAT, &CJabberProto::OnJoinChat);
JCreateService(PS_LEAVECHAT, &CJabberProto::OnLeaveChat);
- JCreateService(JS_GETCUSTOMSTATUSICON, &CJabberProto::OnGetXStatusIcon);
- JCreateService(JS_GETXSTATUS, &CJabberProto::OnGetXStatus);
- JCreateService(JS_SETXSTATUS, &CJabberProto::OnSetXStatus);
- JCreateService(JS_SETXSTATUSEX, &CJabberProto::OnSetXStatusEx);
-
// not needed anymore and therefore commented out
- // JCreateService(JS_GETXSTATUSEX, &CJabberProto::OnGetXStatusEx);
+ // JCreateService(PS_GETXSTATUSEX, &CJabberProto::OnGetXStatusEx);
+ JCreateService(PS_SETCUSTOMSTATUSEX, &CJabberProto::OnSetXStatusEx);
+ JCreateService(PS_GETCUSTOMSTATUSICON, &CJabberProto::OnGetXStatusIcon);
+ JCreateService(PS_GETADVANCEDSTATUSICON, &CJabberProto::JGetAdvancedStatusIcon);
JCreateService(JS_HTTP_AUTH, &CJabberProto::OnHttpAuthRequest);
JCreateService(JS_INCOMING_NOTE_EVENT, &CJabberProto::OnIncomingNoteEvent);
@@ -137,7 +135,6 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) : JCreateService(PS_SETMYAVATART, &CJabberProto::JabberSetAvatar);
JCreateService(PS_SETMYNICKNAME, &CJabberProto::JabberSetNickname);
- JCreateService(JS_GETADVANCEDSTATUSICON, &CJabberProto::JGetAdvancedStatusIcon);
JCreateService(JS_DB_GETEVENTTEXT_CHATSTATES, &CJabberProto::OnGetEventTextChatStates);
JCreateService(JS_DB_GETEVENTTEXT_PRESENCE, &CJabberProto::OnGetEventTextPresence);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 872f773864..5606a3bfd1 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -956,8 +956,6 @@ struct CJabberProto : public PROTO_INTERFACE, public MZeroedObject INT_PTR __cdecl OnSetListeningTo(WPARAM wParam, LPARAM lParams);
INT_PTR __cdecl OnGetXStatusIcon(WPARAM wParam, LPARAM lParams);
- INT_PTR __cdecl OnGetXStatus(WPARAM wParam, LPARAM lParams);
- INT_PTR __cdecl OnSetXStatus(WPARAM wParam, LPARAM lParams);
INT_PTR __cdecl OnSetXStatusEx(WPARAM wParam, LPARAM lParams);
HICON GetXStatusIcon(int bStatus, UINT flags);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 4f6e625fcd..7a1d656cb7 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1160,19 +1160,6 @@ HICON CJabberProto::GetXStatusIcon(int bStatus, UINT flags) }
/////////////////////////////////////////////////////////////////////////////////////////
-// JabberGetXStatus - gets the extended status info (mood)
-
-INT_PTR __cdecl CJabberProto::OnGetXStatus(WPARAM wParam, LPARAM lParam)
-{
- if ( !m_bJabberOnline || !m_bPepSupported)
- return 0;
-
- if (wParam) *((char**)wParam) = DBSETTING_XSTATUSNAME;
- if (lParam) *((char**)lParam) = DBSETTING_XSTATUSMSG;
- return ((CPepMood *)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD)))->m_mode;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// JabberGetXStatusIcon - Retrieves specified custom status icon
// wParam = (int)N // custom status id, 0 = my current custom status
// lParam = flags // use LR_SHARED for shared HICON
@@ -1366,35 +1353,14 @@ void CJabberProto::XStatusUninit() /////////////////////////////////////////////////////////////////////////////////////////
// JabberSetXStatus - sets the extended status info (mood)
-INT_PTR __cdecl CJabberProto::OnSetXStatus(WPARAM wParam, LPARAM)
-{
- if ( !m_bPepSupported || !m_bJabberOnline)
- return 0;
-
- CPepMood *pepMood = (CPepMood *)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD));
- if ( !wParam) {
- pepMood->m_mode = -1;
- pepMood->Retract();
- return 0;
- }
-
- if (wParam > 0 && wParam < SIZEOF(g_arrMoods)) {
- pepMood->m_mode = wParam;
- pepMood->LaunchSetGui(0);
- return wParam;
- }
-
- return 0;
-}
-
INT_PTR __cdecl CJabberProto::OnSetXStatusEx(WPARAM wParam, LPARAM lParam)
{
- JABBER_CUSTOM_STATUS *pData = (JABBER_CUSTOM_STATUS*)lParam;
+ CUSTOM_STATUS *pData = (CUSTOM_STATUS*)lParam;
if ( !m_bPepSupported || !m_bJabberOnline)
return 1;
- if (pData->cbSize < sizeof(JABBER_CUSTOM_STATUS)) return 1; // Failure
+ if (pData->cbSize < sizeof(CUSTOM_STATUS)) return 1; // Failure
CPepMood *pepMood = (CPepMood *)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD));
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 <m_chat.h>
#include <m_extraicons.h>
#include <m_music.h>
-#include <m_icq.h>
+#include <m_xstatus.h>
#include <m_proto_listeningto.h>
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)
|