diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-03 17:27:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-03 17:27:06 +0000 |
commit | a9fac2d04887b80526ab90c4c8ce45cd482e80b2 (patch) | |
tree | 0bc62363778c6110d16016816650278a147049f7 /protocols/JabberG/src/jabber_menu.cpp | |
parent | 9257dc8641a40437ceda38b65f4be7390e57954b (diff) |
- filetransfer::iqid converted from string to int;
- further code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@6319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_menu.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 4c27ddf361..909feaae84 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -1081,7 +1081,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM wParam, LPARAM lParam) JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal);
db_free(&dbv);
- if ( !LI)
+ if (LI == NULL)
return 0;
HMENU hMenu = CreatePopupMenu();
@@ -1131,15 +1131,12 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM wParam, LPARAM, LPARAM return 0;
HANDLE hContact = (HANDLE)wParam;
-
- DBVARIANT dbv;
- if (getTString(hContact, "jid", &dbv))
+ ptrT tszJid( getTStringA(hContact, "jid"));
+ if (tszJid == NULL)
return 0;
- JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal);
- db_free(&dbv);
-
- if ( !LI)
+ JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, tszJid);
+ if (LI == NULL)
return 0;
if (res == MENUITEM_LASTSEEN) {
@@ -1168,35 +1165,32 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM wParam, LPARAM l HANDLE hContact = (HANDLE)wParam;
TCHAR *jid, text[ 1024 ];
+ ptrT tszJid( getTStringA(hContact, "jid"));
+ if (tszJid == NULL) {
+ ptrT roomid( getTStringA(hContact, "ChatRoomID"));
+ if (roomid == NULL)
+ return 0;
- DBVARIANT dbv;
- int result = getTString(hContact, "jid", &dbv);
- if (result)
- {
- result = getTString(hContact, "ChatRoomID", &dbv);
- if (result) return 0;
-
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, dbv.ptszVal);
- if ( !item) return 0;
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, roomid);
+ if (item == NULL)
+ return 0;
mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), item->jid, item->nick);
jid = text;
}
- else
- jid = dbv.ptszVal;
+ else jid = tszJid;
TCHAR buf[1024] = _T("");
EnterString(buf, SIZEOF(buf), TranslateT("Status Message"), JES_MULTINE);
SendPresenceTo(res, jid, NULL, buf);
- db_free(&dbv);
return 0;
}
////////////////////////////////////////////////////////////////////////
// Choose protocol instance
-CJabberProto *JabberChooseInstance(bool bIsLink)
+CJabberProto* JabberChooseInstance(bool bIsLink)
{
if (g_Instances.getCount() == 0)
return NULL;
@@ -1207,11 +1201,10 @@ CJabberProto *JabberChooseInstance(bool bIsLink) return NULL;
}
- if (bIsLink) {
+ if (bIsLink)
for (int i=0; i < g_Instances.getCount(); i++)
if (g_Instances[i]->m_options.ProcessXMPPLinks)
return g_Instances[i];
- }
CLISTMENUITEM clmi = { sizeof(clmi) };
|