summaryrefslogtreecommitdiff
path: root/plugins/AVS
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/AVS
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (diff)
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AVS')
-rw-r--r--plugins/AVS/src/acc.cpp4
-rw-r--r--plugins/AVS/src/acc.h2
-rw-r--r--plugins/AVS/src/cache.cpp14
-rw-r--r--plugins/AVS/src/commonheaders.h22
-rw-r--r--plugins/AVS/src/image_utils.cpp6
-rw-r--r--plugins/AVS/src/image_utils.h4
-rw-r--r--plugins/AVS/src/main.cpp10
-rw-r--r--plugins/AVS/src/options.cpp28
-rw-r--r--plugins/AVS/src/poll.cpp22
-rw-r--r--plugins/AVS/src/poll.h4
-rw-r--r--plugins/AVS/src/services.cpp16
-rw-r--r--plugins/AVS/src/utils.cpp16
12 files changed, 74 insertions, 74 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp
index cfdfd8ec4b..d664fd1995 100644
--- a/plugins/AVS/src/acc.cpp
+++ b/plugins/AVS/src/acc.cpp
@@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
char proto[64];
HANDLE hHook;
HANDLE hHookMy;
@@ -556,7 +556,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
{
DestroyAnimation(hwnd, data);
- data->hContact = (HANDLE) lParam;
+ data->hContact = (HCONTACT)lParam;
if (lParam == NULL)
data->proto[0] = '\0';
else
diff --git a/plugins/AVS/src/acc.h b/plugins/AVS/src/acc.h
index 79f0d826a1..576215b1a4 100644
--- a/plugins/AVS/src/acc.h
+++ b/plugins/AVS/src/acc.h
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA.
#ifndef __ACC_H__
# define __ACC_H__
-INT_PTR avSetAvatar( HANDLE hContact, TCHAR* tszPath );
+INT_PTR avSetAvatar(HCONTACT hContact, TCHAR* tszPath );
INT_PTR avSetMyAvatar( char* szProto, TCHAR* tszPath );
int LoadACC();
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp
index 9ca7415ba9..c6155f3bef 100644
--- a/plugins/AVS/src/cache.cpp
+++ b/plugins/AVS/src/cache.cpp
@@ -88,7 +88,7 @@ static CacheNode* AddToList(CacheNode *node)
return pCurrent;
}
-CacheNode *FindAvatarInCache(HANDLE hContact, BOOL add, BOOL findAny)
+CacheNode *FindAvatarInCache(HCONTACT hContact, BOOL add, BOOL findAny)
{
if (g_shutDown)
return NULL;
@@ -143,7 +143,7 @@ CacheNode *FindAvatarInCache(HANDLE hContact, BOOL add, BOOL findAny)
* popup plugin.
*/
-void NotifyMetaAware(HANDLE hContact, CacheNode *node = NULL, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)-1)
+void NotifyMetaAware(HCONTACT hContact, CacheNode *node = NULL, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)-1)
{
if (g_shutDown)
return;
@@ -154,8 +154,8 @@ void NotifyMetaAware(HANDLE hContact, CacheNode *node = NULL, AVATARCACHEENTRY *
NotifyEventHooks(hEventChanged, (WPARAM)hContact, (LPARAM)ace);
if (g_MetaAvail && (node->dwFlags & MC_ISSUBCONTACT) && db_get_b(NULL, g_szMetaName, "Enabled", 0)) {
- HANDLE hMasterContact = (HANDLE)db_get_dw(hContact, g_szMetaName, "Handle", 0);
- if (hMasterContact && (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMasterContact, 0) == hContact &&
+ HCONTACT hMasterContact = (HCONTACT)db_get_dw(hContact, g_szMetaName, "Handle", 0);
+ if (hMasterContact && (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMasterContact, 0) == hContact &&
!db_get_b(hMasterContact, "ContactPhoto", "Locked", 0))
NotifyEventHooks(hEventChanged, (WPARAM)hMasterContact, (LPARAM)ace);
}
@@ -200,7 +200,7 @@ void NotifyMetaAware(HANDLE hContact, CacheNode *node = NULL, AVATARCACHEENTRY *
// Just delete an avatar from cache
// An cache entry is never deleted. What is deleted is the image handle inside it
// This is done this way to keep track of which avatars avs have to keep track
-void DeleteAvatarFromCache(HANDLE hContact, BOOL forever)
+void DeleteAvatarFromCache(HCONTACT hContact, BOOL forever)
{
if (g_shutDown)
return;
@@ -222,7 +222,7 @@ void DeleteAvatarFromCache(HANDLE hContact, BOOL forever)
/////////////////////////////////////////////////////////////////////////////////////////
-int SetAvatarAttribute(HANDLE hContact, DWORD attrib, int mode)
+int SetAvatarAttribute(HCONTACT hContact, DWORD attrib, int mode)
{
if (g_shutDown)
return 0;
@@ -305,7 +305,7 @@ void PicLoader(LPVOID param)
mir_sleep(dwDelay);
}
else if (node->mustLoad < 0 && node->ace.hContact) { // delete this picture
- HANDLE hContact = node->ace.hContact;
+ HCONTACT hContact = node->ace.hContact;
EnterCriticalSection(&cachecs);
node->mustLoad = 0;
node->loaded = 0;
diff --git a/plugins/AVS/src/commonheaders.h b/plugins/AVS/src/commonheaders.h
index c5f91779c2..2b7b8d7877 100644
--- a/plugins/AVS/src/commonheaders.h
+++ b/plugins/AVS/src/commonheaders.h
@@ -123,24 +123,24 @@ extern HANDLE hEventChanged, hEventContactAvatarChanged, hMyAvatarChanged;
int GetFileHash(TCHAR* filename);
DWORD GetFileSize(TCHAR *szFilename);
-void MakePathRelative(HANDLE hContact);
-void MakePathRelative(HANDLE hContact, TCHAR *dest);
+void MakePathRelative(HCONTACT hContact);
+void MakePathRelative(HCONTACT hContact, TCHAR *dest);
HBITMAP LoadPNG(struct avatarCacheEntry *ace, char *szFilename);
void InitCache(void);
void UnloadCache(void);
-int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto);
-void DeleteAvatarFromCache(HANDLE, BOOL);
+int CreateAvatarInCache(HCONTACT hContact, avatarCacheEntry *ace, char *szProto);
+void DeleteAvatarFromCache(HCONTACT hContact, BOOL);
void PicLoader(LPVOID param);
void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bmHeight, DWORD dwFlags);
-int ChangeAvatar(HANDLE hContact, BOOL fLoad, BOOL fNotifyHist = FALSE, int pa_format = 0);
+int ChangeAvatar(HCONTACT hContact, BOOL fLoad, BOOL fNotifyHist = FALSE, int pa_format = 0);
void DeleteGlobalUserAvatar();
-int FetchAvatarFor(HANDLE hContact, char *szProto = NULL);
-CacheNode* FindAvatarInCache(HANDLE hContact, BOOL add, BOOL findAny = FALSE);
-int SetAvatarAttribute(HANDLE hContact, DWORD attrib, int mode);
+int FetchAvatarFor(HCONTACT hContact, char *szProto = NULL);
+CacheNode* FindAvatarInCache(HCONTACT hContact, BOOL add, BOOL findAny = FALSE);
+int SetAvatarAttribute(HCONTACT hContact, DWORD attrib, int mode);
void SetIgnoreNotify(char *protocol, BOOL ignore);
INT_PTR DrawAvatarPicture(WPARAM wParam, LPARAM lParam);
@@ -149,9 +149,9 @@ INT_PTR GetMyAvatar(WPARAM wParam, LPARAM lParam);
INT_PTR ProtectAvatar(WPARAM wParam, LPARAM lParam);
INT_PTR ReportMyAvatarChanged(WPARAM wParam, LPARAM lParam);
-HANDLE GetContactThatHaveTheAvatar(HANDLE hContact, int locked = -1);
+HCONTACT GetContactThatHaveTheAvatar(HCONTACT hContact, int locked = -1);
-void ProcessAvatarInfo(HANDLE hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto);
+void ProcessAvatarInfo(HCONTACT hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_NeedDelaysForAvatars(const char *proto);
@@ -161,4 +161,4 @@ int Proto_AvatarImageProportion(const char *proto);
void Proto_GetAvatarMaxSize(const char *proto, int *width, int *height);
int Proto_GetAvatarMaxFileSize(const char *proto);
-protoPicCacheEntry* GetProtoDefaultAvatar(HANDLE hContact); \ No newline at end of file
+protoPicCacheEntry* GetProtoDefaultAvatar(HCONTACT hContact); \ No newline at end of file
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp
index f081908245..9e7be9b152 100644
--- a/plugins/AVS/src/image_utils.cpp
+++ b/plugins/AVS/src/image_utils.cpp
@@ -2,7 +2,7 @@
#include "image_utils.h"
extern int _DebugTrace(const char *fmt, ...);
-extern int _DebugTrace(HANDLE hContact, const char *fmt, ...);
+extern int _DebugTrace(HCONTACT hContact, const char *fmt, ...);
#define GET_PIXEL(__P__, __X__, __Y__) ( __P__ + width * 4 * (__Y__) + 4 * (__X__))
@@ -410,7 +410,7 @@ DWORD GetImgHash(HBITMAP hBitmap)
/*
* Changes the handle to a grayscale image
*/
-HBITMAP MakeGrayscale(HANDLE hContact, HBITMAP hBitmap)
+HBITMAP MakeGrayscale(HCONTACT hContact, HBITMAP hBitmap)
{
if (hBitmap) {
FIBITMAP *dib = fei->FI_CreateDIBFromHBITMAP(hBitmap);
@@ -433,7 +433,7 @@ HBITMAP MakeGrayscale(HANDLE hContact, HBITMAP hBitmap)
* See if finds a transparent background in image, and set its transparency
* Return TRUE if found a transparent background
*/
-BOOL MakeTransparentBkg(HANDLE hContact, HBITMAP *hBitmap)
+BOOL MakeTransparentBkg(HCONTACT hContact, HBITMAP *hBitmap)
{
BYTE *p = NULL;
DWORD dwLen;
diff --git a/plugins/AVS/src/image_utils.h b/plugins/AVS/src/image_utils.h
index eadb2a3cfe..f22dc47c04 100644
--- a/plugins/AVS/src/image_utils.h
+++ b/plugins/AVS/src/image_utils.h
@@ -37,8 +37,8 @@ int BmpFilterSaveBitmapW(HBITMAP hBmp, wchar_t *wszFile, int flags);
HBITMAP CopyBitmapTo32(HBITMAP hBitmap);
BOOL PreMultiply(HBITMAP hBitmap);
-BOOL MakeTransparentBkg(HANDLE hContact, HBITMAP *hBitmap);
-HBITMAP MakeGrayscale(HANDLE hContact, HBITMAP hBitmap);
+BOOL MakeTransparentBkg(HCONTACT hContact, HBITMAP *hBitmap);
+HBITMAP MakeGrayscale(HCONTACT hContact, HBITMAP hBitmap);
DWORD GetImgHash(HBITMAP hBitmap);
int AVS_pathIsAbsolute(const TCHAR *path);
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp
index 591ac7a693..a4422d83b4 100644
--- a/plugins/AVS/src/main.cpp
+++ b/plugins/AVS/src/main.cpp
@@ -134,8 +134,8 @@ static int MetaChanged(WPARAM wParam, LPARAM lParam)
AVATARCACHEENTRY *ace;
- HANDLE hContact = (HANDLE) wParam;
- HANDLE hSubContact = GetContactThatHaveTheAvatar(hContact);
+ HCONTACT hContact = (HCONTACT)wParam;
+ HCONTACT hSubContact = GetContactThatHaveTheAvatar(hContact);
// Get the node
CacheNode *node = FindAvatarInCache(hSubContact, TRUE);
@@ -190,7 +190,7 @@ static void LoadAccountInfo(PROTOACCOUNT *acc)
g_ProtoPictures.insert(pce);
pce = new protoPicCacheEntry;
- CreateAvatarInCache((HANDLE)-1, pce, acc->szModuleName);
+ CreateAvatarInCache((HCONTACT)-1, pce, acc->szModuleName);
pce->szProtoname = mir_strdup(acc->szModuleName);
pce->tszAccName = mir_tstrdup(acc->tszAccountName);
g_MyAvatars.insert(pce);
@@ -242,7 +242,7 @@ static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
static int ContactDeleted(WPARAM wParam, LPARAM lParam)
{
- DeleteAvatarFromCache((HANDLE)wParam, TRUE);
+ DeleteAvatarFromCache((HCONTACT)wParam, TRUE);
return 0;
}
@@ -401,7 +401,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
// Load global avatar
protoPicCacheEntry *pce = new protoPicCacheEntry;
- CreateAvatarInCache((HANDLE)-1, pce, "");
+ CreateAvatarInCache((HCONTACT)-1, pce, "");
pce->szProtoname = mir_strdup("");
g_MyAvatars.insert(pce);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index fa15d767a3..ee1fc4007a 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define DM_AVATARCHANGED (WM_USER + 12)
#define DM_PROTOCOLCHANGED (WM_USER + 13)
-extern int _DebugPopup(HANDLE hContact, const char *fmt, ...);
+extern int _DebugPopup(HCONTACT hContact, const char *fmt, ...);
extern INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam);
extern OBJLIST<protoPicCacheEntry> g_ProtoPictures;
extern HANDLE hEventChanged;
@@ -41,7 +41,7 @@ extern BOOL ScreenToClient(HWND hWnd, LPRECT lpRect);
static BOOL dialoginit = TRUE;
struct WindowData {
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hHook;
};
@@ -423,7 +423,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar
BOOL newVal = ListView_GetCheckState(hwndList, i);
if (oldVal && !newVal)
- for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
+ for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
DeleteAvatarFromCache(hContact, TRUE);
if (newVal)
@@ -440,7 +440,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar
/////////////////////////////////////////////////////////////////////////////////////////
-static void LoadTransparentData(HWND hwndDlg, HANDLE hContact)
+static void LoadTransparentData(HWND hwndDlg, HCONTACT hContact)
{
CheckDlgButton(hwndDlg, IDC_MAKETRANSPBKG, db_get_b(hContact, "ContactPhoto", "MakeTransparentBkg", db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0)));
SendDlgItemMessage(hwndDlg, IDC_BKG_NUM_POINTS_SPIN, UDM_SETPOS, 0, (LPARAM)db_get_w(hContact, "ContactPhoto", "TranspBkgNumPoints", db_get_w(0, AVS_MODULE, "TranspBkgNumPoints", 5)));
@@ -455,7 +455,7 @@ static void LoadTransparentData(HWND hwndDlg, HANDLE hContact)
EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE), transp_enabled);
}
-static void SaveTransparentData(HWND hwndDlg, HANDLE hContact)
+static void SaveTransparentData(HWND hwndDlg, HCONTACT hContact)
{
BOOL transp = IsDlgButtonChecked(hwndDlg, IDC_MAKETRANSPBKG);
if (db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0) == transp)
@@ -476,18 +476,18 @@ static void SaveTransparentData(HWND hwndDlg, HANDLE hContact)
db_set_w(hContact, "ContactPhoto", "TranspBkgColorDiff", tmp);
}
-static void SaveTransparentData(HWND hwndDlg, HANDLE hContact, BOOL locked)
+static void SaveTransparentData(HWND hwndDlg, HCONTACT hContact, BOOL locked)
{
SaveTransparentData(hwndDlg, hContact);
- HANDLE tmp = GetContactThatHaveTheAvatar(hContact, locked);
+ HCONTACT tmp = GetContactThatHaveTheAvatar(hContact, locked);
if (tmp != hContact)
SaveTransparentData(hwndDlg, tmp);
}
INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
struct WindowData *dat = (struct WindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (dat)
@@ -501,10 +501,10 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
struct WindowData *dat = (struct WindowData *)malloc(sizeof(struct WindowData));
if (dat)
- dat->hContact = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
TranslateDialogDefault(hwndDlg);
if (hContact) {
szNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
@@ -759,7 +759,7 @@ int OptInit(WPARAM wParam, LPARAM lParam)
static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
struct WindowData *dat = (struct WindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (dat)
@@ -771,7 +771,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa
dat = (struct WindowData *) malloc(sizeof(struct WindowData));
if (dat == NULL)
return FALSE;
- dat->hContact = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
HWND protopic = GetDlgItem(hwndDlg, IDC_PROTOPIC);
SendMessage(protopic, AVATAR_SETCONTACT, 0, (LPARAM) dat->hContact);
@@ -781,7 +781,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa
SendMessage(protopic, AVATAR_SETRESIZEIFSMALLER, 0, (LPARAM) FALSE);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
TranslateDialogDefault(hwndDlg);
SendMessage(hwndDlg, DM_SETAVATARNAME, 0, 0);
CheckDlgButton(hwndDlg, IDC_PROTECTAVATAR, db_get_b(hContact, "ContactPhoto", "Locked", 0) ? TRUE : FALSE);
@@ -1148,7 +1148,7 @@ int OnDetailsInit(WPARAM wParam, LPARAM lParam)
odp.hInstance = g_hInst;
odp.pszTitle = LPGEN("Avatar");
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
if (hContact == NULL) {
// User dialog
odp.pfnDlgProc = DlgProcAvatarProtoInfo;
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp
index beefe4e8ee..9273720962 100644
--- a/plugins/AVS/src/poll.cpp
+++ b/plugins/AVS/src/poll.cpp
@@ -45,15 +45,15 @@ A queue to request items. One request is done at a time, REQUEST_WAIT_TIME milis
static void RequestThread(void *vParam);
extern HANDLE hShutdownEvent;
-extern int DeleteAvatar(HANDLE hContact);
-extern void MakePathRelative(HANDLE hContact, TCHAR *path);
+extern int DeleteAvatar(HCONTACT hContact);
+extern void MakePathRelative(HCONTACT hContact, TCHAR *path);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto);
BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto);
#ifdef _DEBUG
int _DebugTrace(const char *fmt, ...);
-int _DebugTrace(HANDLE hContact, const char *fmt, ...);
+int _DebugTrace(HCONTACT hContact, const char *fmt, ...);
#endif
// Functions ////////////////////////////////////////////////////////////////////////////
@@ -100,7 +100,7 @@ static BOOL PollCheckProtocol(const char *szProto)
}
// Return true if this contact can have avatar requested
-static BOOL PollContactCanHaveAvatar(HANDLE hContact, const char *szProto)
+static BOOL PollContactCanHaveAvatar(HCONTACT hContact, const char *szProto)
{
int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return (Proto_IsFetchingWhenContactOfflineAllowed(szProto) || status != ID_STATUS_OFFLINE)
@@ -108,12 +108,12 @@ static BOOL PollContactCanHaveAvatar(HANDLE hContact, const char *szProto)
}
// Return true if this contact has to be checked
-static BOOL PollCheckContact(HANDLE hContact, const char *szProto)
+static BOOL PollCheckContact(HCONTACT hContact, const char *szProto)
{
return !db_get_b(hContact, "ContactPhoto", "Locked", 0) && FindAvatarInCache(hContact, FALSE, TRUE) != NULL;
}
-static void QueueRemove(HANDLE hContact)
+static void QueueRemove(HCONTACT hContact)
{
mir_cslock lck(cs);
@@ -124,7 +124,7 @@ static void QueueRemove(HANDLE hContact)
}
}
-static void QueueAdd(HANDLE hContact, int waitTime)
+static void QueueAdd(HCONTACT hContact, int waitTime)
{
if (fei == NULL || g_shutDown)
return;
@@ -143,12 +143,12 @@ static void QueueAdd(HANDLE hContact, int waitTime)
}
// Add an contact to a queue
-void QueueAdd(HANDLE hContact)
+void QueueAdd(HCONTACT hContact)
{
QueueAdd(hContact, waitTime);
}
-void ProcessAvatarInfo(HANDLE hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto)
+void ProcessAvatarInfo(HCONTACT hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto)
{
QueueRemove(hContact);
@@ -202,7 +202,7 @@ void ProcessAvatarInfo(HANDLE hContact, int type, PROTO_AVATAR_INFORMATIONT *pai
}
}
-int FetchAvatarFor(HANDLE hContact, char *szProto)
+int FetchAvatarFor(HCONTACT hContact, char *szProto)
{
int result = GAIR_NOAVATAR;
@@ -258,7 +258,7 @@ static void RequestThread(void *vParam)
}
// Will request this item
- HANDLE hContact = qi.hContact;
+ HCONTACT hContact = qi.hContact;
queue.remove( queue.getCount()-1 );
QueueRemove(hContact);
LeaveCriticalSection(&cs);
diff --git a/plugins/AVS/src/poll.h b/plugins/AVS/src/poll.h
index 99d15da999..7b7924a9cf 100644
--- a/plugins/AVS/src/poll.h
+++ b/plugins/AVS/src/poll.h
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.
struct QueueItem
{
- HANDLE hContact;
+ HCONTACT hContact;
DWORD check_time;
};
@@ -31,6 +31,6 @@ void InitPolls();
void UninitPolls();
// Add an contact to a queue
-void QueueAdd(HANDLE hContact);
+void QueueAdd(HCONTACT hContact);
#endif // __POLL_H__
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp
index 8866404681..85218de38b 100644
--- a/plugins/AVS/src/services.cpp
+++ b/plugins/AVS/src/services.cpp
@@ -31,22 +31,22 @@ INT_PTR GetAvatarBitmap(WPARAM wParam, LPARAM lParam)
if (wParam == 0 || g_shutDown || fei == NULL)
return 0;
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
hContact = GetContactThatHaveTheAvatar(hContact);
// Get the node
CacheNode *node = FindAvatarInCache(hContact, TRUE);
if (node == NULL || !node->loaded)
- return (INT_PTR) GetProtoDefaultAvatar(hContact);
+ return (INT_PTR)GetProtoDefaultAvatar(hContact);
else
- return (INT_PTR) &node->ace;
+ return (INT_PTR)&node->ace;
}
/////////////////////////////////////////////////////////////////////////////////////////
INT_PTR ProtectAvatar(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
BYTE was_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
if (fei == NULL || was_locked == (BYTE)lParam) // no need for redundant lockings...
@@ -118,7 +118,7 @@ UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return FALSE;
}
-static INT_PTR avSetAvatar(HANDLE hContact, TCHAR *tszPath)
+static INT_PTR avSetAvatar(HCONTACT hContact, TCHAR *tszPath)
{
BYTE is_locked = 0;
TCHAR FileName[MAX_PATH], szBackupName[MAX_PATH];
@@ -188,12 +188,12 @@ static INT_PTR avSetAvatar(HANDLE hContact, TCHAR *tszPath)
INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam)
{
- return avSetAvatar((HANDLE)wParam, _A2T((const char*)lParam ));
+ return avSetAvatar((HCONTACT)wParam, _A2T((const char*)lParam));
}
INT_PTR SetAvatarW(WPARAM wParam, LPARAM lParam)
{
- return avSetAvatar((HANDLE)wParam, (TCHAR*)lParam );
+ return avSetAvatar((HCONTACT)wParam, (TCHAR*)lParam);
}
/*
@@ -932,7 +932,7 @@ static void ReloadMyAvatar(LPVOID lpParam)
if (g_MyAvatars[i].hbmPic)
DeleteObject(g_MyAvatars[i].hbmPic);
- if (CreateAvatarInCache((HANDLE)-1, &g_MyAvatars[i], myAvatarProto) != -1)
+ if (CreateAvatarInCache((HCONTACT)-1, &g_MyAvatars[i], myAvatarProto) != -1)
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, (LPARAM)&g_MyAvatars[i]);
else
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, 0);
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp
index e72921dc62..3c6a40c4e8 100644
--- a/plugins/AVS/src/utils.cpp
+++ b/plugins/AVS/src/utils.cpp
@@ -37,7 +37,7 @@ int _DebugTrace(const char *fmt, ...)
return 0;
}
-int _DebugTrace(HANDLE hContact, const char *fmt, ...)
+int _DebugTrace(HCONTACT hContact, const char *fmt, ...)
{
char text[1024];
size_t len;
@@ -119,7 +119,7 @@ size_t AVS_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut)
* convert the avatar image path to a relative one...
* given: contact handle, path to image
*/
-void MakePathRelative(HANDLE hContact, TCHAR *path)
+void MakePathRelative(HCONTACT hContact, TCHAR *path)
{
TCHAR szFinalPath[MAX_PATH];
szFinalPath[0] = '\0';
@@ -137,7 +137,7 @@ void MakePathRelative(HANDLE hContact, TCHAR *path)
* given: contact handle
*/
-void MakePathRelative(HANDLE hContact)
+void MakePathRelative(HCONTACT hContact)
{
DBVARIANT dbv;
if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
@@ -148,7 +148,7 @@ void MakePathRelative(HANDLE hContact)
// create the avatar in cache
// returns 0 if not created (no avatar), iIndex otherwise, -2 if has to request avatar, -3 if avatar too big
-int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto)
+int CreateAvatarInCache(HCONTACT hContact, avatarCacheEntry *ace, char *szProto)
{
DBVARIANT dbv = {0};
char *szExt = NULL;
@@ -493,7 +493,7 @@ BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto)
/////////////////////////////////////////////////////////////////////////////////////////
-protoPicCacheEntry *GetProtoDefaultAvatar(HANDLE hContact)
+protoPicCacheEntry *GetProtoDefaultAvatar(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto) {
@@ -506,7 +506,7 @@ protoPicCacheEntry *GetProtoDefaultAvatar(HANDLE hContact)
return NULL;
}
-HANDLE GetContactThatHaveTheAvatar(HANDLE hContact, int locked)
+HCONTACT GetContactThatHaveTheAvatar(HCONTACT hContact, int locked)
{
if (g_MetaAvail && db_get_b(NULL, g_szMetaName, "Enabled", 0)) {
if (db_get_dw(hContact, g_szMetaName, "NumContacts", 0) >= 1) {
@@ -514,13 +514,13 @@ HANDLE GetContactThatHaveTheAvatar(HANDLE hContact, int locked)
locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
if (!locked)
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
}
}
return hContact;
}
-int ChangeAvatar(HANDLE hContact, BOOL fLoad, BOOL fNotifyHist, int pa_format)
+int ChangeAvatar(HCONTACT hContact, BOOL fLoad, BOOL fNotifyHist, int pa_format)
{
if (g_shutDown)
return 0;