diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/JabberG | |
parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (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 'protocols/JabberG')
31 files changed, 258 insertions, 254 deletions
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index debcb70949..bf7839a11e 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -362,8 +362,8 @@ struct ThreadData int zlibRecv(char* data, long datalen);
// for nick names resolving
- int resolveID;
- HANDLE resolveContact;
+ int resolveID;
+ HCONTACT resolveContact;
// features & registration
HWND reg_hwndDlg;
@@ -760,7 +760,7 @@ void strdel(char* parBuffer, int len); //---- jabber_userinfo.cpp --------------------------------------------------------------
-void JabberUserInfoUpdate(HANDLE hContact);
+void JabberUserInfoUpdate(HCONTACT hContact);
//---- jabber_iq_handlers.cpp
BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE);
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index 1f4f55acf7..f3777d0ff9 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -510,7 +510,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
int res = -1;
if ((hContact != NULL || lParam != 0) && m_bJabberOnline) {
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index 7cacaa4c21..fa057d002b 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -56,13 +56,13 @@ int CJabberProto::CompareJIDs(LPCTSTR jid1, LPCTSTR jid2) return JabberCompareJids(jid1, jid2);
}
-HANDLE CJabberProto::ContactFromJID(LPCTSTR jid)
+HCONTACT CJabberProto::ContactFromJID(LPCTSTR jid)
{
if (jid == NULL) return NULL;
return HContactFromJID(jid);
}
-LPTSTR CJabberProto::ContactToJID(HANDLE hContact)
+LPTSTR CJabberProto::ContactToJID(HCONTACT hContact)
{
return getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid");
}
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index d2faf4fd8e..0786b363bf 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -32,7 +32,7 @@ void CJabberProto::EnableArchive(bool bEnable) << XCHILDNS( _T("auto"), JABBER_FEAT_ARCHIVE) << XATTR(_T("save"), (bEnable) ? _T("true") : _T("false")));
}
-void CJabberProto::RetrieveMessageArchive(HANDLE hContact, JABBER_LIST_ITEM *pItem)
+void CJabberProto::RetrieveMessageArchive(HCONTACT hContact, JABBER_LIST_ITEM *pItem)
{
if (pItem->bHistoryRead)
return;
@@ -60,7 +60,7 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*) if (!list || lstrcmp( xmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE))
return;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
time_t tmLast = 0;
for (int nodeIdx = 1; ; nodeIdx++) {
@@ -99,7 +99,7 @@ static HANDLE hPreviousContact = INVALID_HANDLE_VALUE; static HANDLE hPreviousDbEvent = NULL;
// Returns TRUE if the event already exist in the database
-BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei)
+BOOL IsDuplicateEvent(HCONTACT hContact, DBEVENTINFO& dbei)
{
HANDLE hExistingDbEvent;
DWORD dwEventTimeStamp;
@@ -258,7 +258,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*) if (!start || !with)
return;
- HANDLE hContact = HContactFromJID(with);
+ HCONTACT hContact = HContactFromJID(with);
time_t tmStart = str2time(start);
if (hContact == 0 || tmStart == 0)
return;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 20e7714bc8..d43a3b85ff 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -132,7 +132,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) gcw.ptszID = item->jid;
CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw);
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (hContact != NULL) {
if (JABBER_LIST_ITEM *bookmark = ListGetItemPtr(LIST_BOOKMARK, item->jid))
if (bookmark->name) {
@@ -600,7 +600,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) mir_sntprintf(sttRJidBuf, SIZEOF(sttRJidBuf), TranslateT("Real &JID: %s"), him->m_tszRealJid);
if (TCHAR *tmp = _tcschr(sttRJidBuf, _T('/'))) *tmp = 0;
- if (HANDLE hContact = HContactFromJID(him->m_tszRealJid)) {
+ if (HCONTACT hContact = HContactFromJID(him->m_tszRealJid)) {
gcmi->Item[3].uType = MENU_HMENU;
gcmi->Item[3].dwID = CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0);
sttShowGcMenuItems(gcmi, sttRJidItems, 0);
@@ -662,7 +662,7 @@ class CGroupchatInviteDlg : public CJabberDlgBase void FilterList(CCtrlClc *)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
if (lstrcmpA(proto, m_proto->m_szModuleName) || m_proto->isChatRoom(hContact))
if (HANDLE hItem = m_clc.FindContact(hContact))
@@ -740,7 +740,7 @@ public: m_txtNewJid.GetText(buf, SIZEOF(buf));
m_txtNewJid.SetTextA("");
- HANDLE hContact = m_proto->HContactFromJID(buf);
+ HCONTACT hContact = m_proto->HContactFromJID(buf);
if (hContact)
{
int hItem = SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
@@ -776,7 +776,7 @@ public: HWND hwndList = GetDlgItem(m_hwnd, IDC_CLIST);
// invite users from roster
- for (HANDLE hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
if (m_proto->isChatRoom(hContact))
continue;
@@ -1003,7 +1003,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if ((gch->dwData >= CLISTMENUIDMIN) && (gch->dwData <= CLISTMENUIDMAX)) {
if (him->m_tszRealJid && *him->m_tszRealJid)
- if (HANDLE hContact = ppro->HContactFromJID(him->m_tszRealJid))
+ if (HCONTACT hContact = ppro->HContactFromJID(him->m_tszRealJid))
CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(gch->dwData, MPCF_CONTACTMENU), (LPARAM)hContact);
return;
}
@@ -1039,7 +1039,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
- HANDLE hContact = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
+ HCONTACT hContact = (HCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
}
break;
@@ -1202,7 +1202,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* case IDM_RJID_VCARD:
if (him->m_tszRealJid && *him->m_tszRealJid) {
- HANDLE hContact;
+ HCONTACT hContact;
JABBER_SEARCH_RESULT jsr = { 0 };
jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->m_tszRealJid);
@@ -1211,7 +1211,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
- hContact = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
+ hContact = (HCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
}
break;
@@ -1305,7 +1305,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g item = ppro->ListGetItemPtr(LIST_CHATROOM, gch->pDest->ptszID);
if (item != NULL) {
item->type = _T("conference");
- HANDLE hContact = ppro->HContactFromJID(item->jid);
+ HCONTACT hContact = ppro->HContactFromJID(item->jid);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
ppro->AddEditBookmark(item);
}
@@ -1369,7 +1369,7 @@ static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, co {
TCHAR szFullJid[JABBER_MAX_JID_LEN];
mir_sntprintf(szFullJid, SIZEOF(szFullJid), _T("%s/%s"), item->jid, nick);
- HANDLE hContact = ppro->DBCreateContact(szFullJid, NULL, TRUE, FALSE);
+ HCONTACT hContact = ppro->DBCreateContact(szFullJid, NULL, TRUE, FALSE);
if (hContact != NULL) {
pResourceStatus r(item->findResource(nick));
if (r)
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 9b0ad50aad..1453e9f40f 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -406,7 +406,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) {
if ((item=ListGetItemPtrFromIndex(i)) != NULL) {
if (_tcschr(item->jid, '@') == NULL && _tcschr(item->jid, '/') == NULL && item->subscription!=SUB_NONE) {
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (hContact != NULL)
setByte(hContact, "IsTransport", TRUE);
@@ -1237,7 +1237,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM if (!items[i].feature) {
if (items[i].title) {
- HANDLE hContact;
+ HCONTACT hContact;
if ((items[i].action == SD_ACT_USERMENU) && (hContact = HContactFromJID(pNode->GetJid()))) {
HMENU hContactMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0);
AppendMenu(hMenu, MF_STRING|MF_POPUP, (UINT_PTR)hContactMenu, TranslateTS(items[i].title));
@@ -1397,7 +1397,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_USERMENU:
{
- HANDLE hContact = HContactFromJID(pNode->GetJid());
+ HCONTACT hContact = HContactFromJID(pNode->GetJid());
if (!hContact) {
hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), TRUE, FALSE);
JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid());
@@ -1413,12 +1413,12 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_VCARD:
{
TCHAR *jid = pNode->GetJid();
- HANDLE hContact = HContactFromJID(pNode->GetJid());
+ HCONTACT hContact = HContactFromJID(pNode->GetJid());
if (!hContact) {
JABBER_SEARCH_RESULT jsr={0};
mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), jid);
jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
- hContact = (HANDLE)CallProtoService(m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
+ hContact = (HCONTACT)CallProtoService(m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
}
if (ListGetItemPtr(LIST_VCARD_TEMP, pNode->GetJid()) == NULL) {
JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid());
@@ -1432,7 +1432,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_ROSTER:
{
- HANDLE hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), FALSE, FALSE);
+ HCONTACT hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), FALSE, FALSE);
db_unset(hContact, "CList", "NotOnList");
JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid());
item->bUseResource = TRUE;
@@ -1453,7 +1453,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM default:
if ((res >= CLISTMENUIDMIN) && (res <= CLISTMENUIDMAX)) {
- HANDLE hContact = HContactFromJID(pNode->GetJid());
+ HCONTACT hContact = HContactFromJID(pNode->GetJid());
if (hContact)
CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(res, MPCF_CONTACTMENU), (LPARAM)hContact);
}
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index d9a46a9d11..f9795c7ac9 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -36,7 +36,7 @@ int CJabberProto::OnContactDeleted(WPARAM wParam, LPARAM) if (!m_bJabberOnline) // should never happen
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ptrT jid(getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
if (jid == NULL)
return 0;
@@ -75,7 +75,7 @@ static TCHAR* sttSettingToTchar(DBCONTACTWRITESETTING *cws) return NULL;
}
-void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, HANDLE hContact)
+void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, HCONTACT hContact)
{
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid")));
if (item == NULL)
@@ -106,7 +106,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, HANDLE hCon }
}
-void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, HANDLE hContact)
+void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, HCONTACT hContact)
{
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT( getTStringA(hContact, "jid")));
if (item == NULL)
@@ -126,7 +126,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, HANDLE hC }
}
-void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HANDLE hContact)
+void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HCONTACT hContact)
{
if (cws->value.type != DBVT_DELETED && !(cws->value.type == DBVT_BYTE && cws->value.bVal == 0))
return;
@@ -159,7 +159,7 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HANDL int __cdecl CJabberProto::OnDbSettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL || !m_bJabberOnline)
return 0;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index d6d9fb29b5..c36d2cdc77 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -185,7 +185,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleJoinGroupchat(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ptrT jid( getTStringA(hContact, "ChatRoomID"));
if (jid == NULL)
return 0;
@@ -210,7 +210,7 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnLeaveChat(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ptrT jid(getTStringA(hContact, "ChatRoomID"));
if (jid != NULL) {
if (getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) {
@@ -791,7 +791,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *ol if (!lstrcmp(item->nick, oldNick)) {
replaceStrT(item->nick, newNick);
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (hContact != NULL)
setTString(hContact, "MyNick", newNick);
}
@@ -931,7 +931,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) if (r && bRoleChanged) GcLogShowInformation(item, r, INFO_ROLE);
// update clist status
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact != NULL)
setWord(hContact, "Status", status);
@@ -992,7 +992,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) GcLogUpdateMemberStatus(item, resource, nick, str, GC_EVENT_PART, statusNode);
ListRemoveResource(LIST_CHATROOM, from);
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact != NULL)
setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index df3c3ced7b..8c36b3d02b 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -393,7 +393,7 @@ int CJabberProto::OnReloadIcons(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM wParam, LPARAM)
{
- HANDLE hContact=(HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return -1;
@@ -415,7 +415,7 @@ INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM wParam, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
// Transport check functions
-BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HANDLE hContact)
+BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HCONTACT hContact)
{
// check if transport is already set
if (!jid || !hContact)
@@ -455,7 +455,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HANDLE hContact void CJabberProto::CheckAllContactsAreTransported()
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT jid( getTStringA(hContact, "jid"));
if (jid)
DBCheckIsTransportedContact(jid, hContact);
diff --git a/protocols/JabberG/src/jabber_iq.h b/protocols/JabberG/src/jabber_iq.h index c2c3dc960d..3eece1ec6e 100644 --- a/protocols/JabberG/src/jabber_iq.h +++ b/protocols/JabberG/src/jabber_iq.h @@ -70,7 +70,7 @@ public: TCHAR *m_szChildTagXmlns;
TCHAR *m_szChildTagName;
HXML m_pChildNode;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
TCHAR *m_szTo;
TCHAR *m_szId;
@@ -117,7 +117,7 @@ public: __forceinline TCHAR* GetIdStr()
{ return m_szId;
}
- __forceinline HANDLE GetHContact()
+ __forceinline HCONTACT GetHContact()
{ return m_hContact;
}
__forceinline HXML GetChildNode()
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index e83ad340ea..bd360cd167 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -525,7 +525,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) }
JABBER_LIST_ITEM *item;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
const TCHAR *jid, *str, *name;
TCHAR *nick;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 5e3cb859eb..c069d7fb31 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -313,7 +313,7 @@ void CJabberProto::OnIqResultSession(HXML iqNode, CJabberIqInfo *pInfo) OnLoggedIn();
}
-void CJabberProto::GroupchatJoinByHContact(HANDLE hContact, bool autojoin)
+void CJabberProto::GroupchatJoinByHContact(HCONTACT hContact, bool autojoin)
{
ptrT roomjid( getTStringA(hContact, "ChatRoomID"));
if (roomjid == NULL)
@@ -425,7 +425,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) }
}
- HANDLE hContact = HContactFromJID(jid);
+ HCONTACT hContact = HContactFromJID(jid);
if (hContact == NULL) {
// Received roster has a new JID.
// Add the jid (with empty resource) to Miranda contact list.
@@ -496,8 +496,8 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) // Delete orphaned contacts (if roster sync is enabled)
if (m_options.RosterSync == TRUE) {
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; ) {
- HANDLE hNext = db_find_next(hContact, m_szModuleName);
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; ) {
+ HCONTACT hNext = db_find_next(hContact, m_szModuleName);
ptrT jid( getTStringA(hContact, "jid"));
if (jid != NULL && !ListGetItemPtr(LIST_ROSTER, jid)) {
debugLogA("Syncing roster: preparing to delete %S (hContact=0x%x)", jid, hContact);
@@ -515,7 +515,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) if (m_options.AutoJoinConferences)
for (i=0; i < chatRooms.getCount(); i++)
- GroupchatJoinByHContact((HANDLE)chatRooms[i], true);
+ GroupchatJoinByHContact((HCONTACT)chatRooms[i], true);
//UI_SAFE_NOTIFY(m_pDlgJabberJoinGroupchat, WM_JABBER_CHECK_ONLINE);
//UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_CHECK_ONLINE);
@@ -565,7 +565,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*) if ((from = xmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
if (!lstrcmp(type, _T("result"))) {
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact != NULL)
setByte(hContact, "IsTransport", TRUE);
@@ -583,7 +583,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*) /////////////////////////////////////////////////////////////////////////////////////////
// JabberIqResultGetVcard - processes the server-side v-card
-void CJabberProto::OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HANDLE hContact, bool &hasPhoto)
+void CJabberProto::OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HCONTACT hContact, bool &hasPhoto)
{
debugLogA("JabberIqResultGetVcardPhoto: %d", hasPhoto);
if (hasPhoto)
@@ -661,7 +661,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) {
HXML vCardNode, m, n, o;
const TCHAR *type, *jid;
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR text[128];
DBVARIANT dbv;
@@ -1284,7 +1284,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*) if (from == NULL)
return;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact == NULL)
return;
@@ -1324,7 +1324,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*) const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact == NULL)
return;
@@ -1363,7 +1363,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo) if (from == NULL)
return;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact == NULL)
return;
@@ -1396,7 +1396,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo) }
-void CJabberProto::OnIqResultGotAvatar(HANDLE hContact, HXML n, const TCHAR *mimeType)
+void CJabberProto::OnIqResultGotAvatar(HCONTACT hContact, HXML n, const TCHAR *mimeType)
{
unsigned resultLen;
ptrA body((char*)mir_base64_decode( _T2A(xmlGetText(n)), &resultLen));
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h index 4c4c8358dc..eaddb149eb 100644 --- a/protocols/JabberG/src/jabber_list.h +++ b/protocols/JabberG/src/jabber_list.h @@ -212,9 +212,9 @@ struct JABBER_LIST_ITEM : public MZeroedObject struct JABBER_HTTP_AVATARS
{
char * Url;
- HANDLE hContact;
+ HCONTACT hContact;
- JABBER_HTTP_AVATARS(const TCHAR *tUrl, HANDLE thContact)
+ JABBER_HTTP_AVATARS(const TCHAR *tUrl, HCONTACT thContact)
: Url(mir_t2a(tUrl)), hContact(thContact) {}
~JABBER_HTTP_AVATARS() { mir_free(Url); }
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 2d0f0beb0b..b644efbbd8 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -73,7 +73,7 @@ static INT_PTR JabberMenuChooseService(WPARAM wParam, LPARAM lParam) return 0;
}
-static CJabberProto* JabberGetInstanceByHContact(HANDLE hContact)
+static CJabberProto* JabberGetInstanceByHContact(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -88,73 +88,73 @@ static CJabberProto* JabberGetInstanceByHContact(HANDLE hContact) static INT_PTR JabberMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuHandleRequestAuth(wParam, lParam) : 0;
}
static INT_PTR JabberMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuHandleGrantAuth(wParam, lParam) : 0;
}
static INT_PTR JabberMenuRevokeAuth(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuRevokeAuth(wParam, lParam) : 0;
}
static INT_PTR JabberMenuConvertChatContact(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuConvertChatContact(wParam, lParam) : 0;
}
static INT_PTR JabberMenuRosterAdd(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuRosterAdd(wParam, lParam) : 0;
}
static INT_PTR JabberMenuBookmarkAdd(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuBookmarkAdd(wParam, lParam) : 0;
}
static INT_PTR JabberMenuTransportLogin(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuTransportLogin(wParam, lParam) : 0;
}
static INT_PTR JabberMenuTransportResolve(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuTransportResolve(wParam, lParam) : 0;
}
static INT_PTR JabberContactMenuRunCommands(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->ContactMenuRunCommands(wParam, lParam) : 0;
}
static INT_PTR JabberMenuSendNote(WPARAM wParam, LPARAM lParam)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuSendNote(wParam, lParam) : 0;
}
static INT_PTR JabberMenuHandleResource(WPARAM wParam, LPARAM lParam, LPARAM lRes)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuHandleResource(wParam, lParam, lRes) : 0;
}
static INT_PTR JabberMenuHandleDirectPresence(WPARAM wParam, LPARAM lParam, LPARAM lRes)
{
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnMenuHandleDirectPresence(wParam, lParam, lRes) : 0;
}
@@ -173,7 +173,7 @@ static int JabberPrebuildContactMenu(WPARAM wParam, LPARAM lParam) Menu_ShowItem(g_hMenuResourcesRoot, FALSE);
Menu_ShowItem(g_hMenuDirectPresence[0], FALSE);
- CJabberProto *ppro = JabberGetInstanceByHContact((HANDLE)wParam);
+ CJabberProto *ppro = JabberGetInstanceByHContact((HCONTACT)wParam);
return(ppro) ? ppro->OnPrebuildContactMenu(wParam, lParam) : 0;
}
@@ -347,7 +347,7 @@ void g_MenuUninit(void) int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -479,7 +479,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
BYTE bIsChatRoom = isChatRoom(hContact);
const char *szSetting = (bIsChatRoom) ? "ChatRoomID" : "jid";
@@ -494,14 +494,17 @@ INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM)
{
- if (!wParam) return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
+ HCONTACT hContact = (HCONTACT)wParam;
+ if (!hContact)
+ return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrT roomID(getTStringA((HANDLE)wParam, "ChatRoomID"));
- if (roomID == NULL) return 0;
+ ptrT roomID(getTStringA(hContact, "ChatRoomID"));
+ if (roomID == NULL)
+ return 0;
if (ListGetItemPtr(LIST_ROSTER, roomID) == NULL) {
- ptrT group(db_get_tsa((HANDLE)wParam, "CList", "Group"));
- ptrT nick(getTStringA((HANDLE)wParam, "Nick"));
+ ptrT group(db_get_tsa(hContact, "CList", "Group"));
+ ptrT nick(getTStringA(hContact, "Nick"));
AddContactToRoster(roomID, nick, group);
if (m_options.AddRoster2Bookmarks == TRUE) {
@@ -510,7 +513,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM) item = new JABBER_LIST_ITEM();
item->jid = mir_tstrdup(roomID);
item->name = mir_tstrdup(nick);
- item->nick = getTStringA((HANDLE)wParam, "MyNick");
+ item->nick = getTStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
}
@@ -521,7 +524,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
@@ -532,7 +535,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
@@ -543,7 +546,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
@@ -554,7 +557,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!getByte(hContact, "IsTransport", 0))
return 0;
@@ -570,7 +573,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!getByte(hContact, "IsTransport", 0))
return 0;
@@ -582,7 +585,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM wParam, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
@@ -974,7 +977,7 @@ void CJabberProto::MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item) if (item->list != LIST_ROSTER)
return;
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (!hContact)
return;
@@ -1040,7 +1043,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM wParam, LPARAM lParam) if (lstrcmpA(sicd->szModule, m_szModuleName))
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0;
@@ -1094,7 +1097,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM wParam, LPARAM, LPARAM if (!m_bJabberOnline || !wParam)
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ptrT tszJid(getTStringA(hContact, "jid"));
if (tszJid == NULL)
return 0;
@@ -1126,7 +1129,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM wParam, LPARAM l if (!m_bJabberOnline || !wParam)
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
TCHAR *jid, text[1024];
ptrT tszJid(getTStringA(hContact, "jid"));
diff --git a/protocols/JabberG/src/jabber_message_manager.h b/protocols/JabberG/src/jabber_message_manager.h index b3815d7c8e..e2bc848e2b 100644 --- a/protocols/JabberG/src/jabber_message_manager.h +++ b/protocols/JabberG/src/jabber_message_manager.h @@ -57,7 +57,7 @@ public: LPCTSTR m_szChildTagXmlns;
LPCTSTR m_szChildTagName;
HXML m_hChildNode;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
LPCTSTR m_szTo;
LPCTSTR m_szId;
@@ -77,7 +77,7 @@ public: __forceinline LPCTSTR GetIdStr()
{ return m_szId;
}
- __forceinline HANDLE GetHContact()
+ __forceinline HCONTACT GetHContact()
{ return m_hContact;
}
__forceinline HXML GetChildNode()
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 7bc90fd9f1..04af56aec0 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -70,7 +70,7 @@ int JabberCompareJids(const TCHAR *jid1, const TCHAR *jid2) void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick)
{
- HANDLE hContact = DBCreateContact(jid, nick, TRUE, TRUE);
+ HCONTACT hContact = DBCreateContact(jid, nick, TRUE, TRUE);
delSetting(hContact, "Hidden");
char* szJid = mir_utf8encodeT(jid);
@@ -103,7 +103,7 @@ void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick) ///////////////////////////////////////////////////////////////////////////////
// JabberDBCreateContact()
-HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource)
+HCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource)
{
if (jid == NULL || jid[0]=='\0')
return NULL;
@@ -120,7 +120,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t // We can't use JabberHContactFromJID() here because of the stripResource option
size_t len = _tcslen(s);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT jid( getTStringA(hContact, "jid"));
if (jid == NULL)
continue;
@@ -130,7 +130,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t return hContact;
}
- HANDLE hNewContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hNewContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName);
setTString(hNewContact, "jid", s);
if (nick != NULL && *nick != '\0')
@@ -144,7 +144,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t return hNewContact;
}
-BOOL CJabberProto::AddDbPresenceEvent(HANDLE hContact, BYTE btEventType)
+BOOL CJabberProto::AddDbPresenceEvent(HCONTACT hContact, BYTE btEventType)
{
if (!hContact)
return FALSE;
@@ -179,7 +179,7 @@ BOOL CJabberProto::AddDbPresenceEvent(HANDLE hContact, BYTE btEventType) ///////////////////////////////////////////////////////////////////////////////
// JabberGetAvatarFileName() - gets a file name for the avatar image
-void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen)
+void CJabberProto::GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
@@ -219,9 +219,9 @@ void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbL void CJabberProto::ResolveTransportNicks(const TCHAR *jid)
{
// Set all contacts to offline
- HANDLE hContact = m_ThreadInfo->resolveContact;
+ HCONTACT hContact = m_ThreadInfo->resolveContact;
if (hContact == NULL)
- hContact = (HANDLE)db_find_first(m_szModuleName);
+ hContact = db_find_first(m_szModuleName);
for (; hContact != NULL; hContact = db_find_next(hContact, m_szModuleName)) {
if (!getByte(hContact, "IsTransported", 0))
@@ -320,7 +320,7 @@ static sttCapsNodeToName_Map[] = void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
{
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (!hContact)
return;
@@ -396,7 +396,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res) }
-void CJabberProto::UpdateMirVer(HANDLE hContact, pResourceStatus &resource)
+void CJabberProto::UpdateMirVer(HCONTACT hContact, pResourceStatus &resource)
{
CMString tszMirVer;
FormatMirVer(resource, tszMirVer);
@@ -415,7 +415,7 @@ void CJabberProto::UpdateMirVer(HANDLE hContact, pResourceStatus &resource) setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
}
-void CJabberProto::UpdateSubscriptionInfo(HANDLE hContact, JABBER_LIST_ITEM *item)
+void CJabberProto::UpdateSubscriptionInfo(HCONTACT hContact, JABBER_LIST_ITEM *item)
{
switch (item->subscription) {
case SUB_TO:
@@ -445,7 +445,7 @@ void CJabberProto::UpdateSubscriptionInfo(HANDLE hContact, JABBER_LIST_ITEM *ite }
}
-void CJabberProto::SetContactOfflineStatus(HANDLE hContact)
+void CJabberProto::SetContactOfflineStatus(HCONTACT hContact)
{
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
setWord(hContact, "Status", ID_STATUS_OFFLINE);
@@ -482,7 +482,7 @@ void CJabberProto::InitPopups(void) Skin_ReleaseIcon(ppc.hIcon);
}
-void CJabberProto::MsgPopup(HANDLE hContact, const TCHAR *szMsg, const TCHAR *szTitle)
+void CJabberProto::MsgPopup(HCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle)
{
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
char name[256];
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 33a183be41..db49f4d08e 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -813,7 +813,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleNotes(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM wParam, LPARAM)
{
if (wParam) {
- CNoteItem *pItem = new CNoteItem(NULL, ptrT(getTStringA((HANDLE)wParam, "jid")));
+ CNoteItem *pItem = new CNoteItem(NULL, ptrT(getTStringA((HCONTACT)wParam, "jid")));
CJabberDlgBase *pDlg = new CJabberDlgNoteItem(this, pItem, &CJabberProto::ProcessOutgoingNote);
pDlg->Show();
}
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 65ea059fc9..d6720c5a84 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -858,7 +858,7 @@ public: JABBER_LIST_ITEM *item = m_proto->ListGetItemPtrFromIndex(index);
if (item != NULL) {
if (_tcschr(item->jid, '@') == NULL) {
- HANDLE hContact = m_proto->HContactFromJID(item->jid);
+ HCONTACT hContact = m_proto->HContactFromJID(item->jid);
if (hContact != NULL) {
if (bChecked) {
if (item->getTemp()->m_iStatus != m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE)) {
@@ -1039,7 +1039,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) }
// now it is require to process whole contact list to add not in roster contacts
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT tszJid( getTStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 910aff524b..f5cb1785c9 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -418,7 +418,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0);
{
- for (HANDLE hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
ptrT jid( m_proto->getTStringA(hContact, "jid"));
if (jid != NULL)
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, jid);
@@ -1153,7 +1153,7 @@ void CJabberDlgPrivacyLists::DrawRulesList(LPDRAWITEMSTRUCT lpdis) DrawNextRulePart(lpdis->hDC, clLine1, pRule->GetValue(), &rc);
DrawNextRulePart(lpdis->hDC, clLine2, TranslateT("'"), &rc);
- if (HANDLE hContact = m_proto->HContactFromJID(pRule->GetValue())) {
+ if (HCONTACT hContact = m_proto->HContactFromJID(pRule->GetValue())) {
TCHAR *szName = pcli->pfnGetContactDisplayName(hContact, 0);
if (szName) {
DrawNextRulePart(lpdis->hDC, clLine2, TranslateT(" (nickname: "), &rc);
@@ -1300,7 +1300,7 @@ void CJabberDlgPrivacyLists::CListResetOptions(HWND) void CJabberDlgPrivacyLists::CListFilter(HWND)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
if (!proto || lstrcmpA(proto, m_proto->m_szModuleName))
if (HANDLE hItem = m_clcClist.FindContact(hContact))
@@ -1322,7 +1322,7 @@ void CJabberDlgPrivacyLists::CListSetupIcons(HWND, HANDLE hItem, int iSlot, DWOR HANDLE CJabberDlgPrivacyLists::CListAddContact(HWND hwndList, TCHAR *jid)
{
- HANDLE hContact = m_proto->HContactFromJID(jid);
+ HCONTACT hContact = m_proto->HContactFromJID(jid);
if (hContact)
return m_clcClist.FindContact(hContact);
@@ -1357,7 +1357,7 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList) CListResetIcons(hwndList, hItem, bHideIcons);
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = m_clcClist.FindContact(hContact);
if (hItem)
CListResetIcons(hwndList, hItem, bHideIcons);
@@ -1455,7 +1455,7 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) pList->AddRule(Jid, szJid, FALSE, dwOrder++, dwPackets);
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
hItem = m_clcClist.FindContact(hContact);
ptrT jid( m_proto->getTStringA(hContact, "jid"));
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 3c1581a46f..2af1d877fe 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -257,7 +257,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) ConvertPasswords();
// Set all contacts to offline
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
SetContactOfflineStatus(hContact);
if (!getByte(hContact, "IsTransport", 0))
@@ -314,9 +314,9 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM) ////////////////////////////////////////////////////////////////////////////////////////
// JabberAddToList - adds a contact to the contact list
-HANDLE CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
+HCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR *jid, *nick;
debugLogA("AddToListByJID jid = %S", newJid);
@@ -325,7 +325,7 @@ HANDLE CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags) // not already there: add
jid = mir_tstrdup(newJid);
debugLogA("Add new jid to contact jid = %S", jid);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
setTString(hContact, "jid", jid);
if ((nick=JabberNickFromJID(newJid)) == NULL)
@@ -398,7 +398,7 @@ HANDLE __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDL char *jid = lastName + strlen(lastName) + 1;
TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
- HANDLE hContact = (HANDLE)AddToListByJID(newJid, flags);
+ HCONTACT hContact = (HCONTACT)AddToListByJID(newJid, flags);
mir_free(newJid);
return hContact;
}
@@ -436,12 +436,11 @@ int CJabberProto::Authorize(HANDLE hDbEvent) // Automatically add this user to my roster if option is enabled
if (m_options.AutoAdd == TRUE) {
- HANDLE hContact;
JABBER_LIST_ITEM *item;
if ((item = ListGetItemPtr(LIST_ROSTER, newJid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
debugLogA("Try adding contact automatically jid = %S", jid);
- if ((hContact = AddToListByJID(newJid, 0)) != NULL) {
+ if (HCONTACT hContact = AddToListByJID(newJid, 0)) {
// Trigger actual add by removing the "NotOnList" added by AddToListByJID()
// See AddToListByJID() and JabberDbSettingChanged().
db_unset(hContact, "CList", "NotOnList");
@@ -493,7 +492,7 @@ int CJabberProto::AuthDeny(HANDLE hDbEvent, const TCHAR*) ////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CJabberProto::AuthRecv(HANDLE, PROTORECVEVENT*)
+int __cdecl CJabberProto::AuthRecv(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -501,7 +500,7 @@ int __cdecl CJabberProto::AuthRecv(HANDLE, PROTORECVEVENT*) ////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CJabberProto::AuthRequest(HANDLE, const TCHAR*)
+int __cdecl CJabberProto::AuthRequest(HCONTACT, const TCHAR*)
{
return 1;
}
@@ -517,7 +516,7 @@ HANDLE __cdecl CJabberProto::ChangeInfo(int /*iInfoType*/, void*) ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileAllow - starts a file transfer
-HANDLE __cdecl CJabberProto::FileAllow(HANDLE /*hContact*/, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE __cdecl CJabberProto::FileAllow(HCONTACT /*hContact*/, HANDLE hTransfer, const TCHAR *szPath)
{
if (!m_bJabberOnline)
return 0;
@@ -545,7 +544,7 @@ HANDLE __cdecl CJabberProto::FileAllow(HANDLE /*hContact*/, HANDLE hTransfer, co ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileCancel - cancels a file transfer
-int __cdecl CJabberProto::FileCancel(HANDLE /*hContact*/, HANDLE hTransfer)
+int __cdecl CJabberProto::FileCancel(HCONTACT, HANDLE hTransfer)
{
filetransfer *ft = (filetransfer*)hTransfer;
HANDLE hEvent;
@@ -573,7 +572,7 @@ int __cdecl CJabberProto::FileCancel(HANDLE /*hContact*/, HANDLE hTransfer) ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileDeny - denies a file transfer
-int __cdecl CJabberProto::FileDeny(HANDLE, HANDLE hTransfer, const TCHAR *)
+int __cdecl CJabberProto::FileDeny(HCONTACT, HANDLE hTransfer, const TCHAR *)
{
if (!m_bJabberOnline)
return 1;
@@ -617,7 +616,7 @@ int __cdecl CJabberProto::FileResume(HANDLE hTransfer, int *action, const TCHAR ////////////////////////////////////////////////////////////////////////////////////////
// GetCaps - return protocol capabilities bits
-DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HANDLE hContact)
+DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HCONTACT hContact)
{
switch(type) {
case PFLAGNUM_1:
@@ -645,7 +644,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HANDLE hContact) ////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
+int __cdecl CJabberProto::GetInfo(HCONTACT hContact, int /*infoType*/)
{
if (!m_bJabberOnline || isChatRoom(hContact))
return 1;
@@ -859,7 +858,7 @@ HANDLE __cdecl CJabberProto::SearchByName(const TCHAR *nick, const TCHAR *firstN ////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CJabberProto::RecvContacts(HANDLE /*hContact*/, PROTORECVEVENT*)
+int __cdecl CJabberProto::RecvContacts(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -867,7 +866,7 @@ int __cdecl CJabberProto::RecvContacts(HANDLE /*hContact*/, PROTORECVEVENT*) ////////////////////////////////////////////////////////////////////////////////////////
// RecvFile
-int __cdecl CJabberProto::RecvFile(HANDLE hContact, PROTORECVFILET *evt)
+int __cdecl CJabberProto::RecvFile(HCONTACT hContact, PROTORECVFILET *evt)
{
return Proto_RecvFile(hContact, evt);
}
@@ -875,7 +874,7 @@ int __cdecl CJabberProto::RecvFile(HANDLE hContact, PROTORECVFILET *evt) ////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CJabberProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *evt)
+int __cdecl CJabberProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *evt)
{
ptrA szResUtf( mir_utf8encodeT((LPCTSTR)evt->lParam));
evt->pCustomData = szResUtf;
@@ -887,7 +886,7 @@ int __cdecl CJabberProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *evt) ////////////////////////////////////////////////////////////////////////////////////////
// RecvUrl
-int __cdecl CJabberProto::RecvUrl(HANDLE /*hContact*/, PROTORECVEVENT*)
+int __cdecl CJabberProto::RecvUrl(HCONTACT, PROTORECVEVENT*)
{
return 1;
}
@@ -895,7 +894,7 @@ int __cdecl CJabberProto::RecvUrl(HANDLE /*hContact*/, PROTORECVEVENT*) ////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
+int __cdecl CJabberProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
{
if (!m_bJabberOnline)
return 0;
@@ -925,7 +924,7 @@ int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts ////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CJabberProto::SendFile(HANDLE hContact, const TCHAR *szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CJabberProto::SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR** ppszFiles)
{
if (!m_bJabberOnline) return 0;
@@ -1012,10 +1011,10 @@ HANDLE __cdecl CJabberProto::SendFile(HANDLE hContact, const TCHAR *szDescriptio struct TFakeAckParams
{
- inline TFakeAckParams(HANDLE _hContact, const char* _msg, int _msgid = 0)
+ inline TFakeAckParams(HCONTACT _hContact, const char* _msg, int _msgid = 0)
: hContact(_hContact), msg(_msg), msgid(_msgid) {}
- HANDLE hContact;
+ HCONTACT hContact;
const char *msg;
int msgid;
};
@@ -1035,7 +1034,7 @@ void __cdecl CJabberProto::SendMessageAckThread(void* param) static char PGP_PROLOG[] = "-----BEGIN PGP MESSAGE-----\r\n\r\n";
static char PGP_EPILOG[] = "\r\n-----END PGP MESSAGE-----\r\n";
-int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
+int __cdecl CJabberProto::SendMsg(HCONTACT hContact, int flags, const char* pszSrc)
{
TCHAR szClientJid[JABBER_MAX_JID_LEN];
if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, SIZEOF(szClientJid))) {
@@ -1135,7 +1134,7 @@ int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc ////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CJabberProto::SendUrl(HANDLE /*hContact*/, int /*flags*/, const char* /*url*/)
+int __cdecl CJabberProto::SendUrl(HCONTACT, int /*flags*/, const char* /*url*/)
{
return 1;
}
@@ -1143,7 +1142,7 @@ int __cdecl CJabberProto::SendUrl(HANDLE /*hContact*/, int /*flags*/, const char ////////////////////////////////////////////////////////////////////////////////////////
// JabberSetApparentMode - sets the visibility status
-int __cdecl CJabberProto::SetApparentMode(HANDLE hContact, int mode)
+int __cdecl CJabberProto::SetApparentMode(HCONTACT hContact, int mode)
{
if (mode != 0 && mode != ID_STATUS_ONLINE && mode != ID_STATUS_OFFLINE)
return 1;
@@ -1223,8 +1222,10 @@ int __cdecl CJabberProto::SetStatus(int iNewStatus) ////////////////////////////////////////////////////////////////////////////////////////
// JabberGetAwayMsg - returns a contact's away message
-void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
+void __cdecl CJabberProto::GetAwayMsgThread(void *param)
{
+ HCONTACT hContact = (HCONTACT)param;
+
ptrT jid( getTStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
@@ -1271,7 +1272,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void* hContact) ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)0);
}
-HANDLE __cdecl CJabberProto::GetAwayMsg(HANDLE hContact)
+HANDLE __cdecl CJabberProto::GetAwayMsg(HCONTACT hContact)
{
debugLogA("GetAwayMsg called, hContact=%08X", hContact);
@@ -1282,7 +1283,7 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(HANDLE hContact) ////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG
-int __cdecl CJabberProto::RecvAwayMsg(HANDLE /*hContact*/, int /*statusMode*/, PROTORECVEVENT*)
+int __cdecl CJabberProto::RecvAwayMsg(HCONTACT, int /*statusMode*/, PROTORECVEVENT*)
{
return 1;
}
@@ -1343,7 +1344,7 @@ int __cdecl CJabberProto::SetAwayMsg(int status, const TCHAR *msg) /////////////////////////////////////////////////////////////////////////////////////////
// JabberUserIsTyping - sends a UTN notification
-int __cdecl CJabberProto::UserIsTyping(HANDLE hContact, int type)
+int __cdecl CJabberProto::UserIsTyping(HCONTACT hContact, int type)
{
if (!m_bJabberOnline) return 0;
@@ -1425,7 +1426,7 @@ void CJabberProto::InfoFrame_OnSetup(CJabberInfoFrame_Event*) void CJabberProto::InfoFrame_OnTransport(CJabberInfoFrame_Event *evt)
{
if (evt->m_event == CJabberInfoFrame_Event::CLICK) {
- HANDLE hContact = (HANDLE)evt->m_pUserData;
+ HCONTACT hContact = (HCONTACT)evt->m_pUserData;
HMENU hContactMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0);
POINT pt;
GetCursorPos(&pt);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 1bbf639c5d..6c90985d43 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -87,18 +87,18 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface virtual int __cdecl Authorize(HANDLE hDbEvent);
virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
- virtual int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(HANDLE hContact, const TCHAR *szMessage);
+ virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
- virtual HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath);
- virtual int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR *szReason);
+ virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
+ virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
+ virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
- virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
+ virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
+ virtual int __cdecl GetInfo(HCONTACT hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
virtual HANDLE __cdecl SearchByEmail(const TCHAR *email);
@@ -106,24 +106,24 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
- virtual int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvFile(HANDLE hContact, PROTORECVFILET*);
- virtual int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
+ virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
+ virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList);
- virtual HANDLE __cdecl SendFile(HANDLE hContact, const TCHAR *szDescription, TCHAR** ppszFiles);
- virtual int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg);
- virtual int __cdecl SendUrl(HANDLE hContact, int flags, const char* url);
+ virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
+ virtual HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char *msg);
+ virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char *url);
- virtual int __cdecl SetApparentMode(HANDLE hContact, int mode);
+ virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode);
virtual int __cdecl SetStatus(int iNewStatus);
- virtual HANDLE __cdecl GetAwayMsg(HANDLE hContact);
- virtual int __cdecl RecvAwayMsg(HANDLE hContact, int mode, PROTORECVEVENT* evt);
+ virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
+ virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
- virtual int __cdecl UserIsTyping(HANDLE hContact, int type);
+ virtual int __cdecl UserIsTyping(HCONTACT hContact, int type);
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
@@ -132,7 +132,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
//====| Events |======================================================================
- void __cdecl OnAddContactForever(DBCONTACTWRITESETTING* cws, HANDLE hContact);
+ void __cdecl OnAddContactForever(DBCONTACTWRITESETTING* cws, HCONTACT hContact);
int __cdecl OnContactDeleted(WPARAM, LPARAM);
int __cdecl OnDbSettingChanged(WPARAM, LPARAM);
int __cdecl OnIdleChanged(WPARAM, LPARAM);
@@ -145,8 +145,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface int __cdecl OnProcessSrmmIconClick(WPARAM, LPARAM);
int __cdecl OnProcessSrmmEvent(WPARAM, LPARAM);
int __cdecl OnReloadIcons(WPARAM, LPARAM);
- void __cdecl OnRenameContact(DBCONTACTWRITESETTING* cws, HANDLE hContact);
- void __cdecl OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hContact);
+ void __cdecl OnRenameContact(DBCONTACTWRITESETTING* cws, HCONTACT hContact);
+ void __cdecl OnRenameGroup(DBCONTACTWRITESETTING* cws, HCONTACT hContact);
int __cdecl OnUserInfoInit(WPARAM, LPARAM);
int __cdecl JabberGcEventHook(WPARAM, LPARAM);
@@ -294,7 +294,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface //---- jabber_archive.c --------------------------------------------------------------
void EnableArchive(bool bEnable);
- void RetrieveMessageArchive(HANDLE hContact, JABBER_LIST_ITEM *pItem);
+ void RetrieveMessageArchive(HCONTACT hContact, JABBER_LIST_ITEM *pItem);
void OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*);
void OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*);
@@ -451,7 +451,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface int LoadAdvancedIcons(int iID);
int GetTransportProtoID(TCHAR* TransportDomain);
int GetTransportStatusIconIndex(int iID, int Status);
- BOOL DBCheckIsTransportedContact(const TCHAR *jid, HANDLE hContact);
+ BOOL DBCheckIsTransportedContact(const TCHAR *jid, HCONTACT hContact);
void CheckAllContactsAreTransported(void);
INT_PTR __cdecl JGetAdvancedStatusIcon(WPARAM wParam, LPARAM lParam);
@@ -472,7 +472,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo);
- void OnIqResultGotAvatar(HANDLE hContact, HXML n, const TCHAR *mimeType);
+ void OnIqResultGotAvatar(HCONTACT hContact, HXML n, const TCHAR *mimeType);
void OnIqResultGetMuc(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetRegister(HXML iqNode, CJabberIqInfo *pInfo);
void OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo);
@@ -528,7 +528,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface //---- jabber_iqid.cpp ---------------------------------------------------------------
- void GroupchatJoinByHContact(HANDLE hContact, bool autojoin=false);
+ void GroupchatJoinByHContact(HCONTACT hContact, bool autojoin=false);
//---- jabber_message_handlers.cpp ---------------------------------------------------
@@ -560,7 +560,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType);
void OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo *pInfo);
- void OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HANDLE hContact, bool &hasPhoto);
+ void OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HCONTACT hContact, bool &hasPhoto);
void SetBookmarkRequest (XmlNodeIq& iqId);
//---- jabber_menu.cpp ---------------------------------------------------------------
@@ -584,7 +584,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void MenuInit(void);
void MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item);
- void AuthWorker(HANDLE hContact, char* authReqType);
+ void AuthWorker(HCONTACT hContact, char* authReqType);
void UpdatePriorityMenu(short priority);
@@ -599,18 +599,18 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void AddContactToRoster(const TCHAR *jid, const TCHAR *nick, const TCHAR *grpName);
void DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick);
- BOOL AddDbPresenceEvent(HANDLE hContact, BYTE btEventType);
- HANDLE DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource);
- void GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen);
+ BOOL AddDbPresenceEvent(HCONTACT hContact, BYTE btEventType);
+ HCONTACT DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL temporary, BOOL stripResource);
+ void GetAvatarFileName(HCONTACT hContact, TCHAR* pszDest, size_t cbLen);
void ResolveTransportNicks(const TCHAR *jid);
void SetServerStatus(int iNewStatus);
void FormatMirVer(pResourceStatus &resource, CMString&);
void UpdateMirVer(JABBER_LIST_ITEM *item);
- void UpdateMirVer(HANDLE hContact, pResourceStatus &resource);
- void UpdateSubscriptionInfo(HANDLE hContact, JABBER_LIST_ITEM *item);
- void SetContactOfflineStatus(HANDLE hContact);
+ void UpdateMirVer(HCONTACT hContact, pResourceStatus &resource);
+ void UpdateSubscriptionInfo(HCONTACT hContact, JABBER_LIST_ITEM *item);
+ void SetContactOfflineStatus(HCONTACT hContact);
void InitPopups(void);
- void MsgPopup(HANDLE hContact, const TCHAR *szMsg, const TCHAR *szTitle);
+ void MsgPopup(HCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle);
//---- jabber_opt.cpp ----------------------------------------------------------------
@@ -653,7 +653,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void __cdecl GetAwayMsgThread(void* hContact);
void __cdecl SendMessageAckThread(void* hContact);
- HANDLE AddToListByJID(const TCHAR *newJid, DWORD flags);
+ HCONTACT AddToListByJID(const TCHAR *newJid, DWORD flags);
void WindowSubscribe(HWND hwnd);
void WindowUnsubscribe(HWND hwnd);
void WindowNotify(UINT msg, bool async = false);
@@ -739,7 +739,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void OnProcessProtocol(HXML node, ThreadData *info);
void UpdateJidDbSettings(const TCHAR *jid);
- HANDLE CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem);
+ HCONTACT CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem);
void PerformRegistration(ThreadData* info);
void PerformIqAuth(ThreadData* info);
@@ -759,8 +759,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface //---- jabber_util.c -----------------------------------------------------------------
pResourceStatus ResourceInfoFromJID(const TCHAR *jid);
- HANDLE HContactFromJID(const TCHAR *jid , BOOL bStripResource = 3);
- HANDLE ChatRoomHContactFromJID(const TCHAR *jid);
+ HCONTACT HContactFromJID(const TCHAR *jid, BOOL bStripResource = 3);
+ HCONTACT ChatRoomHContactFromJID(const TCHAR *jid);
void SendVisibleInvisiblePresence(BOOL invisible);
void SendPresenceTo(int status, const TCHAR* to, HXML extra, const TCHAR *msg = NULL);
void SendPresence(int m_iStatus, bool bSendToAll);
@@ -768,7 +768,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void RebuildInfoFrame(void);
// returns buf or NULL on error
- TCHAR* GetClientJID(HANDLE hContact, TCHAR *dest, size_t destLen);
+ TCHAR* GetClientJID(HCONTACT hContact, TCHAR *dest, size_t destLen);
TCHAR* GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen);
void ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *param, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
@@ -819,16 +819,16 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface HICON GetXStatusIcon(int bStatus, UINT flags);
void RegisterAdvStatusSlot(const char *pszSlot);
- void ResetAdvStatus(HANDLE hContact, const char *pszSlot);
- void WriteAdvStatus(HANDLE hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText);
- char* ReadAdvStatusA(HANDLE hContact, const char *pszSlot, const char *pszValue);
- TCHAR* ReadAdvStatusT(HANDLE hContact, const char *pszSlot, const char *pszValue);
+ void ResetAdvStatus(HCONTACT hContact, const char *pszSlot);
+ void WriteAdvStatus(HCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText);
+ char* ReadAdvStatusA(HCONTACT hContact, const char *pszSlot, const char *pszValue);
+ TCHAR* ReadAdvStatusT(HCONTACT hContact, const char *pszSlot, const char *pszValue);
BOOL SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource, TCHAR* szTitle, TCHAR* szTrack, TCHAR* szUri);
void XStatusInit(void);
- void SetContactTune(HANDLE hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack);
+ void SetContactTune(HCONTACT hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack);
void InfoFrame_OnUserMood(CJabberInfoFrame_Event *evt);
void InfoFrame_OnUserActivity(CJabberInfoFrame_Event *evt);
@@ -857,8 +857,8 @@ public: DWORD STDMETHODCALLTYPE GetJabberVersion() const; // Returns Jabber plugin version.
int STDMETHODCALLTYPE CompareJIDs(LPCTSTR jid1, LPCTSTR jid2); // Strips resource names from given JIDs and returns result of comparison for these JIDs.
- HANDLE STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid); // Returns contact handle for given JID.
- LPTSTR STDMETHODCALLTYPE ContactToJID(HANDLE hContact); // Returns JID of hContact. You must free the result using mir_free().
+ HCONTACT STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid); // Returns contact handle for given JID.
+ LPTSTR STDMETHODCALLTYPE ContactToJID(HCONTACT hContact); // Returns JID of hContact. You must free the result using mir_free().
LPTSTR STDMETHODCALLTYPE GetBestResourceName(LPCTSTR jid); // Returns best resource name for given JID. You must free the result using mir_free().
LPTSTR STDMETHODCALLTYPE GetResourceList(LPCTSTR jid); // Returns all resource names for a given JID in format "resource1\0resource2\0resource3\0\0" (all resources are separated by \0 character and the whole string is terminated with two \0 characters). You must free the string using mir_free().
char* STDMETHODCALLTYPE GetModuleName() const; // Returns Jabber module name.
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 6c53d6b819..5df492cb82 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -466,7 +466,7 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe int CJabberProto::RcGetUnreadEventsCount()
{
int nEventsSent = 0;
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT jid( getTStringA(hContact, "jid"));
if (jid == NULL) continue;
@@ -552,7 +552,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe m_options.RcMarkMessagesAsRead = bRemoveCListEvents ? 1 : 0;
int nEventsSent = 0;
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT tszJid( getTStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index ed66f07226..985030607f 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -41,7 +41,7 @@ void __forceinline sttCryptString(char *str) }
}
-static TCHAR* JSetStringCrypt(LPCSTR szModule, HANDLE hContact, char *valueName)
+static TCHAR* JSetStringCrypt(LPCSTR szModule, HCONTACT hContact, char *valueName)
{
DBVARIANT dbv;
if (db_get_s(hContact, szModule, valueName, &dbv))
@@ -62,7 +62,7 @@ void CJabberProto::ConvertPasswords() setTString("Password", passw);
delSetting("LoginPassword");
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if ((passw = JSetStringCrypt(m_szModuleName, hContact, "LoginPassword")) == NULL)
continue;
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index ee0b58dc2e..6741a69007 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -449,7 +449,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) return 1;
TCHAR *szMsgBody = NULL;
- HANDLE hContact = HContactFromJID(szJid, TRUE);
+ HCONTACT hContact = HContactFromJID(szJid, TRUE);
if (hContact == NULL)
hContact = DBCreateContact(szJid, szJid, TRUE, TRUE);
if (hContact == NULL)
@@ -520,7 +520,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) if (!ServiceExists(MS_FILE_SENDFILE))
return 1;
- HANDLE hContact = HContactFromJID(szJid, TRUE);
+ HCONTACT hContact = HContactFromJID(szJid, TRUE);
if (hContact == NULL)
hContact = DBCreateContact(szJid, szJid, TRUE, TRUE);
if (hContact == NULL)
@@ -538,7 +538,7 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM wParam, LPARAM) if (!m_bJabberOnline)
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ptrT jid( getTStringA(hContact, "jid"));
if (jid == NULL)
return 0;
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 4449c0d2bf..eed8b47784 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -559,7 +559,7 @@ recvRest: ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
// Set all contacts to offline
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
SetContactOfflineStatus(hContact);
mir_free(m_szJabberJID);
@@ -995,7 +995,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) m_pepServices.ProcessEvent(from, eventNode);
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (!hContact)
return;
@@ -1030,7 +1030,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) }
// returns 0, if error or no events
-DWORD JabberGetLastContactMessageTime(HANDLE hContact)
+DWORD JabberGetLastContactMessageTime(HCONTACT hContact)
{
// TODO: time cache can improve performance
HANDLE hDbEvent = db_event_last(hContact);
@@ -1051,9 +1051,9 @@ DWORD JabberGetLastContactMessageTime(HANDLE hContact) return dwTime;
}
-HANDLE CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem)
+HCONTACT CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM* chatItem)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
if (chatItem) {
const TCHAR *p = _tcschr(szJid, '/');
if (p != NULL && p[1] != '\0')
@@ -1101,7 +1101,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) if (m_messageManager.HandleMessagePermanent(node, info))
return;
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
JABBER_LIST_ITEM *chatItem = ListGetItemPtr(LIST_CHATROOM, from);
if (chatItem) {
HXML xCaptcha = xmlGetChild(node, "captcha");
@@ -1353,12 +1353,12 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) const TCHAR *group = xmlGetText(xmlGetChild(iNode, _T("group")));
if (action && jid && _tcsstr(jid, chkJID)) {
if (!_tcscmp(action, _T("add"))) {
- HANDLE hContact = DBCreateContact(jid, nick, FALSE, FALSE);
+ HCONTACT hContact = DBCreateContact(jid, nick, FALSE, FALSE);
if (group)
db_set_ts(hContact, "CList", "Group", group);
}
else if (!_tcscmp(action, _T("delete"))) {
- HANDLE hContact = HContactFromJID(jid);
+ HCONTACT hContact = HContactFromJID(jid);
if (hContact)
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
}
@@ -1462,7 +1462,7 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) r->m_tszCapsNode = mir_tstrdup(szNode);
r->m_tszCapsVer = mir_tstrdup(szVer);
r->m_tszCapsExt = mir_tstrdup(szExt);
- HANDLE hContact = HContactFromJID(from);
+ HCONTACT hContact = HContactFromJID(from);
if (hContact)
UpdateMirVer(hContact, r);
}
@@ -1477,7 +1477,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == NULL)
return;
- HANDLE hContact = HContactFromJID(jid);
+ HCONTACT hContact = HContactFromJID(jid);
if (hContact == NULL)
return;
@@ -1535,7 +1535,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
{
- HANDLE hContact;
+ HCONTACT hContact;
HXML showNode;
JABBER_LIST_ITEM *item;
LPCTSTR from, show;
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index bb85ac1f74..adb80356f6 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -74,10 +74,10 @@ struct UserInfoStringBuf struct JabberUserInfoDlgData
{
- CJabberProto* ppro;
- HANDLE hContact;
+ HCONTACT hContact;
+ CJabberProto *ppro;
JABBER_LIST_ITEM *item;
- int resourcesCount;
+ int resourcesCount;
};
enum
@@ -311,7 +311,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Miranda core version"), r->m_tszXMirandaCoreVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
}
-static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, HANDLE hContact, TCHAR *szTitle, char *pszSlot)
+static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, HCONTACT hContact, TCHAR *szTitle, char *pszSlot)
{
char *szAdvStatusIcon = ppro->ReadAdvStatusA(hContact, pszSlot, ADVSTATUS_VAL_ICON);
TCHAR *szAdvStatusTitle = ppro->ReadAdvStatusT(hContact, pszSlot, ADVSTATUS_VAL_TITLE);
@@ -340,7 +340,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM HTREEITEM htiRoot = sttFillInfoLine(hwndTree, NULL, ppro->LoadIconEx("main"), _T("JID"), item->jid, sttInfoLineId(0, INFOLINE_NAME), true);
TCHAR buf[256];
- if (HANDLE hContact = ppro->HContactFromJID(item->jid)) {
+ if (HCONTACT hContact = ppro->HContactFromJID(item->jid)) {
sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_MOOD), hContact, TranslateT("Mood"), ADVSTATUS_MOOD);
sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_ACTIVITY), hContact, TranslateT("Activity"), ADVSTATUS_ACTIVITY);
sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_TUNE), hContact, TranslateT("Tune"), ADVSTATUS_TUNE);
@@ -445,7 +445,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa dat->resourcesCount = -1;
if (CallService(MS_DB_CONTACT_IS, (WPARAM)lParam, 0))
- dat->hContact = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
else if (!IsBadReadPtr((void*)lParam, sizeof(JABBER_LIST_ITEM))) {
dat->hContact = NULL;
dat->item = (JABBER_LIST_ITEM *)lParam;
@@ -550,7 +550,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY) lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
SendMessage(hwndDlg, WM_JABBER_REFRESH, 0, (LPARAM)hContact);
}
break;
@@ -589,8 +589,8 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa struct USER_PHOTO_INFO
{
- HANDLE hContact;
- HBITMAP hBitmap;
+ HCONTACT hContact;
+ HBITMAP hBitmap;
CJabberProto *ppro;
};
@@ -605,7 +605,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP // lParam is hContact
TranslateDialogDefault(hwndDlg);
photoInfo = (USER_PHOTO_INFO *) mir_alloc(sizeof(USER_PHOTO_INFO));
- photoInfo->hContact = (HANDLE)lParam;
+ photoInfo->hContact = (HCONTACT)lParam;
photoInfo->ppro = NULL;
photoInfo->hBitmap = NULL;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) photoInfo);
@@ -800,7 +800,7 @@ int CJabberProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if (!CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)m_szModuleName))
return 0;
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
if (hContact == NULL) {
// Show our vcard
OnUserInfoInit_VCard(wParam, lParam);
@@ -844,7 +844,7 @@ void JabberUserInfoUninit() /////////////////////////////////////////////////////////////////////////////////////////
// JabberUserInfoUpdate
-void JabberUserInfoUpdate(HANDLE hContact)
+void JabberUserInfoUpdate(HCONTACT hContact)
{
if (!hContact)
WindowList_BroadcastAsync(hUserInfoList, WM_JABBER_REFRESH, 0, 0);
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index d73ff4cce4..9a881deafb 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -34,12 +34,12 @@ int CJabberProto::SerialNext(void) ///////////////////////////////////////////////////////////////////////////////
// JabberChatRoomHContactFromJID - looks for the char room HCONTACT with required JID
-HANDLE CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
+HCONTACT CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
{
if (jid == NULL)
return NULL;
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT dbJid( getTStringA(hContact, "ChatRoomID"));
if (dbJid == NULL)
if ((dbJid = getTStringA(hContact, "jid")) == NULL)
@@ -55,14 +55,14 @@ HANDLE CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid) ///////////////////////////////////////////////////////////////////////////////
// JabberHContactFromJID - looks for the HCONTACT with required JID
-HANDLE CJabberProto::HContactFromJID(const TCHAR *jid , BOOL bStripResource)
+HCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, BOOL bStripResource)
{
if (jid == NULL)
return NULL;
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, jid);
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
bool bIsChat = isChatRoom(hContact);
ptrT dbJid( getTStringA(hContact, bIsChat ? "ChatRoomID" : "jid"));
@@ -513,7 +513,7 @@ void CJabberProto::SendVisibleInvisiblePresence(BOOL invisible) if (item == NULL)
continue;
- HANDLE hContact = HContactFromJID(item->jid);
+ HCONTACT hContact = HContactFromJID(item->jid);
if (hContact == NULL)
continue;
@@ -727,7 +727,7 @@ int __stdcall JabberGetPacketID(HXML n) ///////////////////////////////////////////////////////////////////////////////
// JabberGetClientJID - adds a resource postfix to a JID
-TCHAR* CJabberProto::GetClientJID(HANDLE hContact, TCHAR *dest, size_t destLen)
+TCHAR* CJabberProto::GetClientJID(HCONTACT hContact, TCHAR *dest, size_t destLen)
{
if (hContact == NULL)
return NULL;
@@ -932,7 +932,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param) {
if ((item=ppro->ListGetItemPtrFromIndex(i)) != NULL) {
if (_tcschr(item->jid, '@') == NULL && _tcschr(item->jid, '/') == NULL && item->subscription!=SUB_NONE) {
- HANDLE hContact = ppro->HContactFromJID(item->jid);
+ HCONTACT hContact = ppro->HContactFromJID(item->jid);
if (hContact == NULL) continue;
char name[128];
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 4f8eb9c674..28d8b2a416 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -616,7 +616,7 @@ CPepMood::~CPepMood() void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
{
- HANDLE hContact = NULL, hSelfContact = NULL;
+ HCONTACT hContact = NULL, hSelfContact = NULL;
if (!m_proto->IsMyOwnJID(from)) {
hContact = m_proto->HContactFromJID(from);
if (!hContact) return;
@@ -659,19 +659,19 @@ void CPepMood::CreateData(HXML n) moodNode << XCHILD(_T("text"), m_text);
}
-void CPepMood::ResetExtraIcon(HANDLE hContact)
+void CPepMood::ResetExtraIcon(HCONTACT hContact)
{
char *szMood = m_proto->ReadAdvStatusA(hContact, ADVSTATUS_MOOD, "id");
SetExtraIcon(hContact, szMood);
mir_free(szMood);
}
-void CPepMood::SetExtraIcon(HANDLE hContact, char *szMood)
+void CPepMood::SetExtraIcon(HCONTACT hContact, char *szMood)
{
ExtraIcon_SetIcon(hExtraMood, hContact, szMood == NULL ? NULL : g_MoodIcons.GetIcolibHandle(szMood));
}
-void CPepMood::SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText)
+void CPepMood::SetMood(HCONTACT hContact, const TCHAR *szMood, const TCHAR *szText)
{
int mood = -1;
if (szMood) {
@@ -994,7 +994,7 @@ CPepActivity::~CPepActivity() void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
{
- HANDLE hContact = NULL, hSelfContact = NULL;
+ HCONTACT hContact = NULL, hSelfContact = NULL;
if (!m_proto->IsMyOwnJID(from)) {
hContact = m_proto->HContactFromJID(from);
if (!hContact) return;
@@ -1051,19 +1051,19 @@ void CPepActivity::CreateData(HXML n) activityNode << XCHILD(_T("text"), m_text);
}
-void CPepActivity::ResetExtraIcon(HANDLE hContact)
+void CPepActivity::ResetExtraIcon(HCONTACT hContact)
{
char *szActivity = m_proto->ReadAdvStatusA(hContact, ADVSTATUS_ACTIVITY, "id");
SetExtraIcon(hContact, szActivity);
mir_free(szActivity);
}
-void CPepActivity::SetExtraIcon(HANDLE hContact, char *szActivity)
+void CPepActivity::SetExtraIcon(HCONTACT hContact, char *szActivity)
{
ExtraIcon_SetIcon(hExtraActivity, hContact, szActivity == NULL ? NULL : g_ActivityIcons.GetIcolibHandle(szActivity));
}
-void CPepActivity::SetActivity(HANDLE hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText)
+void CPepActivity::SetActivity(HCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText)
{
int activity = -1;
if (szFirst || szSecond) {
@@ -1194,7 +1194,7 @@ BOOL CJabberProto::SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource return TRUE;
}
-void CJabberProto::SetContactTune(HANDLE hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack)
+void CJabberProto::SetContactTune(HCONTACT hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack)
{
if (!szArtist && !szTitle) {
delSetting(hContact, "ListeningTo");
@@ -1342,7 +1342,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) if (pepMood == NULL)
return 1;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
// fill status member
if (pData->flags & CSSF_MASK_STATUS)
@@ -1451,7 +1451,7 @@ void CJabberProto::RegisterAdvStatusSlot(const char *pszSlot) db_set_resident(szSetting, "text");
}
-void CJabberProto::ResetAdvStatus(HANDLE hContact, const char *pszSlot)
+void CJabberProto::ResetAdvStatus(HCONTACT hContact, const char *pszSlot)
{
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/id", m_szModuleName, pszSlot);
@@ -1467,7 +1467,7 @@ void CJabberProto::ResetAdvStatus(HANDLE hContact, const char *pszSlot) db_unset(hContact, "AdvStatus", szSetting);
}
-void CJabberProto::WriteAdvStatus(HANDLE hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText)
+void CJabberProto::WriteAdvStatus(HCONTACT hContact, const char *pszSlot, const TCHAR *pszMode, const char *pszIcon, const TCHAR *pszTitle, const TCHAR *pszText)
{
char szSetting[128];
@@ -1490,14 +1490,14 @@ void CJabberProto::WriteAdvStatus(HANDLE hContact, const char *pszSlot, const TC }
}
-char* CJabberProto::ReadAdvStatusA(HANDLE hContact, const char *pszSlot, const char *pszValue)
+char* CJabberProto::ReadAdvStatusA(HCONTACT hContact, const char *pszSlot, const char *pszValue)
{
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
return db_get_sa(hContact, "AdvStatus", szSetting);
}
-TCHAR* CJabberProto::ReadAdvStatusT(HANDLE hContact, const char *pszSlot, const char *pszValue)
+TCHAR* CJabberProto::ReadAdvStatusT(HCONTACT hContact, const char *pszSlot, const char *pszValue)
{
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h index 6caa4117b4..f0ebf5429a 100644 --- a/protocols/JabberG/src/jabber_xstatus.h +++ b/protocols/JabberG/src/jabber_xstatus.h @@ -45,7 +45,7 @@ public: virtual void InitGui() {}
virtual void RebuildMenu() {}
- virtual void ResetExtraIcon(HANDLE /*hContact*/) {}
+ virtual void ResetExtraIcon(HCONTACT) {}
virtual bool LaunchSetGui() { return false; }
protected:
@@ -88,7 +88,7 @@ public: (*this)[i].RebuildMenu();
}
- void ResetExtraIcon(HANDLE hContact)
+ void ResetExtraIcon(HCONTACT hContact)
{
for (int i=0; i < getCount(); i++)
(*this)[i].ResetExtraIcon(hContact);
@@ -152,7 +152,7 @@ public: CPepMood(CJabberProto *proto);
~CPepMood();
void ProcessItems(const TCHAR *from, HXML items);
- void ResetExtraIcon(HANDLE hContact);
+ void ResetExtraIcon(HCONTACT hContact);
public:
TCHAR *m_text;
@@ -161,9 +161,9 @@ public: protected:
void CreateData(HXML);
void ShowSetDialog(BYTE bQuiet);
- void SetExtraIcon(HANDLE hContact, char *szMood);
+ void SetExtraIcon(HCONTACT hContact, char *szMood);
- void SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText);
+ void SetMood(HCONTACT hContact, const TCHAR *szMood, const TCHAR *szText);
};
class CPepActivity: public CPepGuiService
@@ -173,7 +173,7 @@ public: CPepActivity(CJabberProto *proto);
~CPepActivity();
void ProcessItems(const TCHAR *from, HXML items);
- void ResetExtraIcon(HANDLE hContact);
+ void ResetExtraIcon(HCONTACT hContact);
protected:
TCHAR *m_text;
@@ -181,9 +181,9 @@ protected: void CreateData(HXML);
void ShowSetDialog(BYTE bQuiet);
- void SetExtraIcon(HANDLE hContact, char *szActivity);
+ void SetExtraIcon(HCONTACT hContact, char *szActivity);
- void SetActivity(HANDLE hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText);
+ void SetActivity(HCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSecond, LPCTSTR szText);
};
#endif // _JABBER_XSTATUS_H_
diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp index 1005903432..d48e881578 100644 --- a/protocols/JabberG/src/ui_utils.cpp +++ b/protocols/JabberG/src/ui_utils.cpp @@ -601,7 +601,7 @@ BOOL CCtrlClc::OnNotify(int, NMHDR *pnmh) return FALSE;
}
-void CCtrlClc::AddContact(HANDLE hContact)
+void CCtrlClc::AddContact(HCONTACT hContact)
{ SendMessage(m_hwnd, CLM_ADDCONTACT, (WPARAM)hContact, 0);
}
@@ -633,7 +633,7 @@ void CCtrlClc::Expand(HANDLE hItem, DWORD flags) { SendMessage(m_hwnd, CLM_EXPAND, (WPARAM)hItem, flags);
}
-HANDLE CCtrlClc::FindContact(HANDLE hContact)
+HANDLE CCtrlClc::FindContact(HCONTACT hContact)
{ return (HANDLE)SendMessage(m_hwnd, CLM_FINDCONTACT, (WPARAM)hContact, 0);
}
diff --git a/protocols/JabberG/src/ui_utils.h b/protocols/JabberG/src/ui_utils.h index 50de45fa73..7e0b4792ad 100644 --- a/protocols/JabberG/src/ui_utils.h +++ b/protocols/JabberG/src/ui_utils.h @@ -458,7 +458,7 @@ class CCtrlClc: public CCtrlBase public:
CCtrlClc(CDlgBase* dlg, int ctrlId);
- void AddContact(HANDLE hContact);
+ void AddContact(HCONTACT hContact);
void AddGroup(HANDLE hGroup);
void AutoRebuild();
void DeleteItem(HANDLE hItem);
@@ -466,7 +466,7 @@ public: void EndEditLabel(bool save);
void EnsureVisible(HANDLE hItem, bool partialOk);
void Expand(HANDLE hItem, DWORD flags);
- HANDLE FindContact(HANDLE hContact);
+ HANDLE FindContact(HCONTACT hContact);
HANDLE FindGroup(HANDLE hGroup);
COLORREF GetBkColor();
bool GetCheck(HANDLE hItem);
|