From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Authentication.cpp | 2 +- plugins/NewsAggregator/Src/CheckFeed.cpp | 4 ++-- plugins/NewsAggregator/Src/Common.h | 20 ++++++++++---------- plugins/NewsAggregator/Src/ExportImport.cpp | 6 +++--- plugins/NewsAggregator/Src/Options.cpp | 16 ++++++++-------- plugins/NewsAggregator/Src/Services.cpp | 14 +++++++------- plugins/NewsAggregator/Src/Update.cpp | 8 ++++---- plugins/NewsAggregator/Src/Utils.cpp | 14 +++++++------- 8 files changed, 42 insertions(+), 42 deletions(-) (limited to 'plugins/NewsAggregator') diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index baacf5ac69..2ff61ebaef 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "common.h" -void CreateAuthString(char *auth, HCONTACT hContact, HWND hwndDlg) +void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg) { DBVARIANT dbv; char *user = NULL, *pass = NULL; diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 18a42881ef..d58176e3f7 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -77,7 +77,7 @@ TCHAR * CheckFeed(TCHAR *tszURL, HWND hwndDlg) return NULL; } -VOID CheckCurrentFeed(HCONTACT hContact) +VOID CheckCurrentFeed(MCONTACT hContact) { char *szData = NULL; DBVARIANT dbURL = {0}; @@ -599,7 +599,7 @@ VOID CheckCurrentFeed(HCONTACT hContact) } } -VOID CheckCurrentFeedAvatar(HCONTACT hContact) +VOID CheckCurrentFeedAvatar(MCONTACT hContact) { char *szData = NULL; DBVARIANT dbURL = {0}; diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h index 50241d3234..48371e702f 100644 --- a/plugins/NewsAggregator/Src/Common.h +++ b/plugins/NewsAggregator/Src/Common.h @@ -62,7 +62,7 @@ extern TCHAR tszRoot[MAX_PATH]; struct ItemInfo { HWND hwndList; - HCONTACT hContact; + MCONTACT hContact; int SelNumber; TCHAR nick[MAX_PATH]; TCHAR url[MAX_PATH]; @@ -71,7 +71,7 @@ struct ItemInfo //============ STRUCT USED TO MAKE AN UPDATE LIST ============ struct NEWSCONTACTLIST { - HCONTACT hContact; + MCONTACT hContact; struct NEWSCONTACTLIST *next; }; @@ -80,7 +80,7 @@ typedef struct NEWSCONTACTLIST UPDATELIST; extern UPDATELIST *UpdateListHead; extern UPDATELIST *UpdateListTail; -void UpdateListAdd(HCONTACT hContact); +void UpdateListAdd(MCONTACT hContact); void UpdateThreadProc(LPVOID AvatarCheck); void DestroyUpdateList(void); @@ -119,26 +119,26 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP VOID CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); VOID CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); -BOOL IsMyContact(HCONTACT hContact); -VOID GetNewsData(TCHAR *szUrl, char** szData, HCONTACT hContact, HWND hwndDlg); +BOOL IsMyContact(MCONTACT hContact); +VOID GetNewsData(TCHAR *szUrl, char** szData, MCONTACT hContact, HWND hwndDlg); VOID CreateList(HWND hwndList); VOID UpdateList(HWND hwndList); VOID DeleteAllItems(HWND hwndList); time_t __stdcall DateToUnixTime(TCHAR *stamp, BOOL FeedType); -VOID CheckCurrentFeed(HCONTACT hContact); -VOID CheckCurrentFeedAvatar(HCONTACT hContact); +VOID CheckCurrentFeed(MCONTACT hContact); +VOID CheckCurrentFeedAvatar(MCONTACT hContact); TCHAR* CheckFeed(TCHAR* tszURL, HWND hwndDlg); void UpdateMenu(BOOL State); int ImportFeedsDialog(); VOID ClearText(TCHAR *&message); BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal); int StrReplace(TCHAR *lpszOld, TCHAR *lpszNew, TCHAR *&lpszStr); -void CreateAuthString(char *auth, HCONTACT hContact, HWND hwndDlg); +void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg); INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -HCONTACT GetContactByNick(const TCHAR *nick); -HCONTACT GetContactByURL(const TCHAR *url); +MCONTACT GetContactByNick(const TCHAR *nick); +MCONTACT GetContactByURL(const TCHAR *url); // =============== NewsAggregator SERVICES ================ // Check all Feeds info diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index 02c84365e0..3dc225ec06 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -148,7 +148,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM isGroupUTF = 1; } - HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE); db_set_ts(hContact, MODULE, "Nick", title); db_set_ts(hContact, MODULE, "URL", url); @@ -468,7 +468,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE, "ExportDlg"); - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { DBVARIANT dbVar = {0}; if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) { SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)dbVar.ptszVal); @@ -516,7 +516,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < count; i++) { TCHAR item[MAX_PATH]; SendMessage(FeedsExportList, LB_GETTEXT, i, (LPARAM)item); - HCONTACT hContact = GetContactByNick(item); + MCONTACT hContact = GetContactByNick(item); TCHAR *title = NULL, *url = NULL, *siteurl = NULL, *group = NULL; DBVARIANT dbv = {0}; if (!db_get_ts(hContact, MODULE, "Nick", &dbv)) { diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 52dc11f066..b7c104b65a 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -57,7 +57,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break; } - HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE); GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str)); db_set_ts(hContact, MODULE, "Nick", str); @@ -154,7 +154,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_CHECKTIME, EM_LIMITTEXT, 3, 0); SendDlgItemMessage(hwndDlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, 0, 999); - HCONTACT hContact; + MCONTACT hContact; for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { ptrT dbNick( db_get_tsa(hContact, MODULE, "Nick")); if (dbNick == NULL) @@ -305,7 +305,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case WM_DESTROY: - HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); Utils_SaveWindowPosition(hwndDlg, hContact, MODULE, "ChangeDlg"); WindowList_Remove(hChangeFeedDlgList, hwndDlg); ItemInfo *SelItem = (ItemInfo *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); @@ -325,7 +325,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetWindowText(hwndDlg, TranslateT("Change Feed")); SendDlgItemMessage(hwndDlg, IDC_CHECKTIME, UDM_SETRANGE32, 0, 999); - HCONTACT hContact = (HCONTACT)lParam; + MCONTACT hContact = (MCONTACT)lParam; WindowList_Add(hChangeFeedDlgList, hwndDlg, hContact); Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, MODULE, "ChangeDlg"); DBVARIANT dbv; @@ -361,7 +361,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (LOWORD(wParam)) { case IDOK: { - HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); TCHAR str[MAX_PATH]; char passw[MAX_PATH]; if (!GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str))) { @@ -460,7 +460,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case WM_DESTROY: - HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); Utils_SaveWindowPosition(hwndDlg, hContact, MODULE, "ChangeDlg"); WindowList_Remove(hChangeFeedDlgList, hwndDlg); } @@ -505,7 +505,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ListView_GetItemText(hwndList, sel, 0, nick, MAX_PATH); ListView_GetItemText(hwndList, sel, 1, url, MAX_PATH); - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { ptrT dbNick( db_get_tsa(hContact, MODULE, "Nick")); if (dbNick == NULL) break; @@ -547,7 +547,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA { db_set_b(NULL, MODULE, "StartupRetrieve", IsDlgButtonChecked(hwndDlg, IDC_STARTUPRETRIEVE)); int i = 0; - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { db_set_b(hContact, MODULE, "CheckState", ListView_GetCheckState(hwndList, i)); if (!ListView_GetCheckState(hwndList, i)) db_set_b(hContact, "CList", "Hidden", 1); diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 8f508afdc0..5ee8862342 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -23,7 +23,7 @@ int g_nStatus = ID_STATUS_ONLINE; UINT_PTR timerId = 0; HANDLE hTBButton = NULL, hNewsAggregatorFolder = NULL; -void SetContactStatus(HCONTACT hContact, int nNewStatus) +void SetContactStatus(MCONTACT hContact, int nNewStatus) { if(db_get_w(hContact, MODULE, "Status", ID_STATUS_ONLINE) != nNewStatus) db_set_w(hContact, MODULE, "Status", nNewStatus); @@ -33,7 +33,7 @@ static void __cdecl WorkingThread(void* param) { int nStatus = (int)param; - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) SetContactStatus(hContact, nStatus); } @@ -51,7 +51,7 @@ int NewsAggrInit(WPARAM wParam, LPARAM lParam) else lstrcpyn(tszRoot, VARST( _T("%miranda_userdata%\\Avatars\\"_T(DEFAULT_AVATARS_FOLDER))), SIZEOF(tszRoot)); - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1)) db_set_dw(hContact, MODULE, "LastCheck", time(NULL)); SetContactStatus(hContact, ID_STATUS_ONLINE); @@ -139,7 +139,7 @@ INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM lParam) static void __cdecl AckThreadProc(void *param) { Sleep(100); - ProtoBroadcastAck(MODULE, (HCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); + ProtoBroadcastAck(MODULE, (MCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); } INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam) @@ -151,7 +151,7 @@ INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam) INT_PTR CheckAllFeeds(WPARAM wParam, LPARAM lParam) { - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { if (lParam && db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) UpdateListAdd(hContact); else if (!lParam) @@ -172,7 +172,7 @@ INT_PTR AddFeed(WPARAM wParam, LPARAM lParam) INT_PTR ChangeFeed(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; HWND hChangeFeedDlg = WindowList_Find(hChangeFeedDlgList, hContact); if (!hChangeFeedDlg) { hChangeFeedDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDFEED), NULL, DlgProcChangeFeedMenu, (LPARAM)hContact); @@ -198,7 +198,7 @@ INT_PTR ExportFeeds(WPARAM wParam, LPARAM lParam) INT_PTR CheckFeed(WPARAM wParam, LPARAM lParam) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; if(IsMyContact(hContact)) UpdateListAdd(hContact); if ( !ThreadRunning) diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index be1d71be92..cbcc2efd0f 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -30,7 +30,7 @@ VOID CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) // only run if it is not current updating and the auto update option is enabled if (!ThreadRunning && !Miranda_Terminated()) { BOOL HaveUpdates = FALSE; - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) { double diff = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0)); if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) { @@ -58,7 +58,7 @@ VOID CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) } } -void UpdateListAdd(HCONTACT hContact) +void UpdateListAdd(MCONTACT hContact) { UPDATELIST *newItem = (UPDATELIST*)mir_alloc(sizeof(UPDATELIST)); newItem->hContact = hContact; @@ -74,9 +74,9 @@ void UpdateListAdd(HCONTACT hContact) ReleaseMutex(hUpdateMutex); } -HCONTACT UpdateGetFirst() +MCONTACT UpdateGetFirst() { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; WaitForSingleObject(hUpdateMutex, INFINITE); diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index c361b08485..3ac7545883 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. HANDLE hNetlibUser = NULL, hNetlibHttp; BOOL UpdateListFlag = FALSE; -BOOL IsMyContact(HCONTACT hContact) +BOOL IsMyContact(MCONTACT hContact) { const char *szProto = GetContactProto(hContact); return szProto != NULL && strcmp(MODULE, szProto) == 0; @@ -58,7 +58,7 @@ static void arrayToHex(BYTE *data, size_t datasz, char *res) *resptr = '\0'; } -VOID GetNewsData(TCHAR *tszUrl, char **szData, HCONTACT hContact, HWND hwndDlg) +VOID GetNewsData(TCHAR *tszUrl, char **szData, MCONTACT hContact, HWND hwndDlg) { NETLIBHTTPREQUEST nlhr = {0}; @@ -155,7 +155,7 @@ VOID UpdateList(HWND hwndList) // Initialize LVITEM members that are common to all // items. int i = 0; - for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { UpdateListFlag = TRUE; lvI.mask = LVIF_TEXT; lvI.iSubItem = 0; @@ -562,9 +562,9 @@ VOID ClearText(TCHAR *&message) CoUninitialize(); } -HCONTACT GetContactByNick(const TCHAR *nick) +MCONTACT GetContactByNick(const TCHAR *nick) { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { ptrW contactNick(::db_get_wsa(hContact, MODULE, "Nick")); @@ -574,9 +574,9 @@ HCONTACT GetContactByNick(const TCHAR *nick) return hContact; } -HCONTACT GetContactByURL(const TCHAR *url) +MCONTACT GetContactByURL(const TCHAR *url) { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { ptrW contactURL(::db_get_wsa(hContact, MODULE, "URL")); -- cgit v1.2.3