summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_menu.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/JabberG/src/jabber_menu.cpp
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (diff)
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_menu.cpp')
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp67
1 files changed, 35 insertions, 32 deletions
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"));