summaryrefslogtreecommitdiff
path: root/plugins/AvatarHistory
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AvatarHistory')
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp32
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp13
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.h8
-rw-r--r--plugins/AvatarHistory/src/icolib.cpp2
-rw-r--r--plugins/AvatarHistory/src/options.cpp2
-rw-r--r--plugins/AvatarHistory/src/popup.cpp8
-rw-r--r--plugins/AvatarHistory/src/popup.h8
-rw-r--r--plugins/AvatarHistory/src/utils.cpp10
8 files changed, 41 insertions, 42 deletions
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index 46c84d363d..82a987b0b5 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -23,22 +23,22 @@ Avatar History Plugin
HGENMENU hMenu = NULL;
DWORD WINAPI AvatarDialogThread(LPVOID param);
static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
-int ShowSaveDialog(HWND hwnd, TCHAR* fn,HANDLE hContact = NULL);
+int ShowSaveDialog(HWND hwnd, TCHAR* fn,HCONTACT hContact = NULL);
BOOL ProtocolEnabled(const char *proto);
-int FillAvatarListFromDB(HWND list, HANDLE hContact);
-int FillAvatarListFromFolder(HWND list, HANDLE hContact);
-int FillAvatarListFromFiles(HWND list, HANDLE hContact);
+int FillAvatarListFromDB(HWND list, HCONTACT hContact);
+int FillAvatarListFromFolder(HWND list, HCONTACT hContact);
+int FillAvatarListFromFiles(HWND list, HCONTACT hContact);
int CleanupAvatarPic(HWND hwnd);
bool UpdateAvatarPic(HWND hwnd);
-TCHAR * GetContactFolder(TCHAR *fn, HANDLE hContact);
+TCHAR * GetContactFolder(TCHAR *fn, HCONTACT hContact);
BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file);
static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam);
struct AvatarDialogData
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR fn[MAX_PATH];
HWND parent;
};
@@ -65,7 +65,7 @@ public:
TCHAR *filelink;
};
-int OpenAvatarDialog(HANDLE hContact, char* fn)
+int OpenAvatarDialog(HCONTACT hContact, char* fn)
{
HWND hAvatarWindow = WindowList_Find(hAvatarWindowsList, hContact);
if (hAvatarWindow)
@@ -222,7 +222,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
DestroyMenu(menu);
ListEntry *le = (ListEntry*) SendMessage(hwndList, LB_GETITEMDATA, pos, 0);
- HANDLE hContact = (HANDLE) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT) GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch(ret) {
case ID_AVATARLISTPOPUP_SAVEAS:
ShowSaveDialog(hwnd, le->filename, hContact);
@@ -302,7 +302,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
switch(LOWORD(wParam)) {
case IDOK:
if (HIWORD(wParam) == BN_CLICKED) {
- HANDLE hContact = (HANDLE) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT) GetWindowLongPtr(hwnd, GWLP_USERDATA);
db_set_b(hContact, MODULE_NAME, "AvatarPopups", (BYTE) IsDlgButtonChecked(hwnd, IDC_POPUPUSER));
db_set_b(hContact, MODULE_NAME, "LogToDisk", (BYTE) IsDlgButtonChecked(hwnd, IDC_LOGUSER));
db_set_b(hContact, MODULE_NAME, "LogToHistory", (BYTE) IsDlgButtonChecked(hwnd, IDC_HISTORYUSER));
@@ -324,7 +324,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
case IDC_OPENFOLDER:
if (HIWORD(wParam) == BN_CLICKED && opts.log_per_contact_folders) {
TCHAR avfolder[MAX_PATH];
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
GetContactFolder(avfolder, hContact);
ShellExecute(NULL, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? _T("explore") : _T("open"), avfolder, NULL, NULL, SW_SHOWNORMAL);
return TRUE;
@@ -373,7 +373,7 @@ int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list)
return max_pos;
}
-int FillAvatarListFromFiles(HWND list, HANDLE hContact)
+int FillAvatarListFromFiles(HWND list, HCONTACT hContact)
{
int max_pos = 0;
TCHAR dir[MAX_PATH], path[MAX_PATH];
@@ -400,7 +400,7 @@ int FillAvatarListFromFiles(HWND list, HANDLE hContact)
return 0;
}
-int FillAvatarListFromFolder(HWND list, HANDLE hContact)
+int FillAvatarListFromFolder(HWND list, HCONTACT hContact)
{
int max_pos = 0;
TCHAR dir[MAX_PATH], path[MAX_PATH];
@@ -429,7 +429,7 @@ int FillAvatarListFromFolder(HWND list, HANDLE hContact)
return 0;
}
-int FillAvatarListFromDB(HWND list, HANDLE hContact)
+int FillAvatarListFromDB(HWND list, HCONTACT hContact)
{
int max_pos = 0;
BYTE blob[2048];
@@ -513,7 +513,7 @@ int CleanupAvatarPic(HWND hwnd)
int PreBuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
Menu_ShowItem(hMenu, ProtocolEnabled(proto));
return 0;
}
@@ -534,12 +534,12 @@ void InitMenuItem()
static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam)
{
- OpenAvatarDialog((HANDLE)wParam, (char*)lParam);
+ OpenAvatarDialog((HCONTACT)wParam, (char*)lParam);
return 0;
}
-int ShowSaveDialog(HWND hwnd, TCHAR* fn, HANDLE hContact)
+int ShowSaveDialog(HWND hwnd, TCHAR* fn, HCONTACT hContact)
{
TCHAR filter[MAX_PATH];
TCHAR file[MAX_PATH];
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index cc6b049e70..156134bea9 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -40,7 +40,7 @@ int OptInit(WPARAM wParam,LPARAM lParam);
TCHAR* GetHistoryFolder(TCHAR *fn);
TCHAR* GetProtocolFolder(TCHAR *fn, char *proto);
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, HANDLE hContact);
+TCHAR* GetOldStyleAvatarName(TCHAR *fn, HCONTACT hContact);
void InitMenuItem();
@@ -84,7 +84,7 @@ static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam)
static INT_PTR IsEnabled(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT) wParam;
return ContactEnabled(hContact, "LogToDisk", AVH_DEF_LOGTODISK)
|| ContactEnabled(hContact, "AvatarPopups", AVH_DEF_AVPOPUPS)
|| ContactEnabled(hContact, "LogToHistory", AVH_DEF_LOGTOHISTORY);
@@ -105,11 +105,11 @@ static INT_PTR IsEnabled(WPARAM wParam, LPARAM lParam)
static int AvatarChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
if (proto == NULL)
return 0;
@@ -158,7 +158,7 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam)
ShowDebugPopup(hContact, TranslateT("AVH Debug: File copied successfully"), history_filename);
if (ServiceExists(MS_MC_GETMETACONTACT)) {
- HANDLE hMetaContact = (HANDLE) CallService(MS_MC_GETMETACONTACT, wParam, 0);
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, wParam, 0);
if (hMetaContact != NULL && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) {
TCHAR filename[MAX_PATH] = _T("");
@@ -203,8 +203,7 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam)
CreateOldStyleShortcut(hContact, history_filename);
if (ServiceExists(MS_MC_GETMETACONTACT)) {
- HANDLE hMetaContact = (HANDLE) CallService(MS_MC_GETMETACONTACT, wParam, 0);
-
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, wParam, 0);
if (hMetaContact != NULL && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY))
CreateOldStyleShortcut(hMetaContact, history_filename);
}
diff --git a/plugins/AvatarHistory/src/AvatarHistory.h b/plugins/AvatarHistory/src/AvatarHistory.h
index 20dcd8f518..334ef74109 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.h
+++ b/plugins/AvatarHistory/src/AvatarHistory.h
@@ -60,22 +60,22 @@ void LoadOptions();
void SetupIcoLib();
HICON createDefaultOverlayedIcon(BOOL big);
-HICON createProtoOverlayedIcon(HANDLE hContact);
+HICON createProtoOverlayedIcon(HCONTACT hContact);
int PreBuildContactMenu(WPARAM wParam,LPARAM lParam);
int IcoLibIconsChanged(WPARAM wParam,LPARAM lParam);
-int OpenAvatarDialog(HANDLE hContact, char* fn);
+int OpenAvatarDialog(HCONTACT hContact, char* fn);
// utils
TCHAR* GetCachedAvatar(char *proto, TCHAR *hash);
BOOL ProtocolEnabled(const char *proto);
-BOOL ContactEnabled(HANDLE hContact, char *setting, int def);
+BOOL ContactEnabled(HCONTACT hContact, char *setting, int def);
BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file);
void ConvertToFilename(TCHAR *str, size_t size);
-void CreateOldStyleShortcut(HANDLE hContact, TCHAR *history_filename);
+void CreateOldStyleShortcut(HCONTACT hContact, TCHAR *history_filename);
BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut);
#define POPUP_ACTION_DONOTHING 0
diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp
index 5ff2475db7..b3307b0a7b 100644
--- a/plugins/AvatarHistory/src/icolib.cpp
+++ b/plugins/AvatarHistory/src/icolib.cpp
@@ -74,7 +74,7 @@ HICON createDefaultOverlayedIcon(BOOL big)
}
-HICON createProtoOverlayedIcon(HANDLE hContact)
+HICON createProtoOverlayedIcon(HCONTACT hContact)
{
HICON icon1 = LoadIconEx(I_OVERLAY);
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp
index d7fbcdca68..7044b2122f 100644
--- a/plugins/AvatarHistory/src/options.cpp
+++ b/plugins/AvatarHistory/src/options.cpp
@@ -133,7 +133,7 @@ static INT_PTR CALLBACK PopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
op.popup_use_win_colors = IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS) != 0;
op.popup_use_default_colors = IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS) != 0;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
ShowTestPopup(hContact,TranslateT("Test Contact"), TranslateT("Test description"), &op);
break;
}
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp
index dbdd6821ca..34a39ec6c7 100644
--- a/plugins/AvatarHistory/src/popup.cpp
+++ b/plugins/AvatarHistory/src/popup.cpp
@@ -62,18 +62,18 @@ void ShowErrPopup(const TCHAR *description, const TCHAR *title)
}
-void ShowTestPopup(HANDLE hContact,const TCHAR *title, const TCHAR *description, const Options *op)
+void ShowTestPopup(HCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op)
{
ShowPopupEx(hContact, title, description, NULL, POPUP_TYPE_TEST, op);
}
-void ShowPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description)
+void ShowPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description)
{
ShowPopupEx(hContact, title, description, hContact, POPUP_TYPE_NORMAL, &opts);
}
-void ShowDebugPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description)
+void ShowDebugPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description)
{
if (db_get_b(NULL,MODULE_NAME,"Debug",0))
{
@@ -89,7 +89,7 @@ typedef struct
PopupDataType;
// Show an popup
-void ShowPopupEx(HANDLE hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(HCONTACT hContact, const TCHAR *title, const TCHAR *description,
void *plugin_data, int type, const Options *op)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT))
diff --git a/plugins/AvatarHistory/src/popup.h b/plugins/AvatarHistory/src/popup.h
index 706d5824e3..6738f7d577 100644
--- a/plugins/AvatarHistory/src/popup.h
+++ b/plugins/AvatarHistory/src/popup.h
@@ -54,16 +54,16 @@ void DeInitPopups();
#define POPUP_TYPE_ERROR 2
// Show an popup
-void ShowPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description);
-void ShowDebugPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description);
+void ShowPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description);
+void ShowDebugPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description);
// Show an test
-void ShowTestPopup(HANDLE hContact,const TCHAR *title, const TCHAR *description, const Options *op);
+void ShowTestPopup(HCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op);
// Show an error popup
void ShowErrPopup(const char *description, const char *title = NULL);
-void ShowPopupEx(HANDLE hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(HCONTACT hContact, const TCHAR *title, const TCHAR *description,
void *plugin_data, int type, const Options *op);
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp
index 388a2e85d5..3d0bd65ec3 100644
--- a/plugins/AvatarHistory/src/utils.cpp
+++ b/plugins/AvatarHistory/src/utils.cpp
@@ -34,7 +34,7 @@ BOOL ProtocolEnabled(const char *proto)
return (BOOL) db_get_b(NULL, MODULE_NAME, setting, TRUE);
}
-BOOL ContactEnabled(HANDLE hContact, char *setting, int def)
+BOOL ContactEnabled(HCONTACT hContact, char *setting, int def)
{
if (hContact == NULL)
return FALSE;
@@ -77,7 +77,7 @@ void ConvertToFilename(TCHAR *str, size_t size)
}
}
-int GetUIDFromHContact(HANDLE contact, TCHAR* uinout, int uinout_len)
+int GetUIDFromHContact(HCONTACT contact, TCHAR* uinout, int uinout_len)
{
bool found = true;
@@ -138,7 +138,7 @@ TCHAR* GetProtocolFolder(TCHAR *fn, char *proto)
return fn;
}
-TCHAR* GetContactFolder(TCHAR *fn, HANDLE hContact)
+TCHAR* GetContactFolder(TCHAR *fn, HCONTACT hContact)
{
char *proto = GetContactProto(hContact);
GetProtocolFolder(fn, proto);
@@ -158,7 +158,7 @@ TCHAR* GetContactFolder(TCHAR *fn, HANDLE hContact)
return fn;
}
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, HANDLE hContact)
+TCHAR* GetOldStyleAvatarName(TCHAR *fn, HCONTACT hContact)
{
GetContactFolder(fn, hContact);
@@ -172,7 +172,7 @@ TCHAR* GetOldStyleAvatarName(TCHAR *fn, HANDLE hContact)
return fn;
}
-void CreateOldStyleShortcut(HANDLE hContact, TCHAR *history_filename)
+void CreateOldStyleShortcut(HCONTACT hContact, TCHAR *history_filename)
{
TCHAR shortcut[MAX_PATH] = _T("");