summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_chat.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-30 21:32:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-30 21:32:23 +0000
commit44d6b953f94d5c34a2d50e12c7416aa9a2e19b70 (patch)
treec8e1c28234b52079e90e1569288b9c38a3ce2dce /protocols/JabberG/src/jabber_chat.cpp
parentaf10723abafc00db6a77edd299cea1fc7c6822ab (diff)
end of major perversion in Jabber: JABBER_SEARCH_RESULT
git-svn-id: http://svn.miranda-ng.org/main/trunk@13916 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_chat.cpp')
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp39
1 files changed, 16 insertions, 23 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index e4ef7d7a01..349853f05a 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -1030,15 +1030,12 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_VCARD:
{
- JABBER_SEARCH_RESULT jsr = { 0 };
- mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s/%s"), item->jid, him->m_tszResourceName);
- jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
+ CMString jid(FORMAT, _T("%s/%s"), item->jid, him->m_tszResourceName);
- ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
- ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
+ ppro->ListAdd(LIST_VCARD_TEMP, jid);
+ ppro->ListAddResource(LIST_VCARD_TEMP, jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
- MCONTACT hContact = (MCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
- CallService(MS_USERINFO_SHOWDIALOG, hContact, 0);
+ CallService(MS_USERINFO_SHOWDIALOG, ppro->AddToListByJID(jid, PALF_TEMPORARY), 0);
}
break;
@@ -1198,35 +1195,31 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_RJID_VCARD:
if (him->m_tszRealJid && *him->m_tszRealJid) {
- MCONTACT hContact;
- JABBER_SEARCH_RESULT jsr = { 0 };
- jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
- _tcsncpy_s(jsr.jid, him->m_tszRealJid, _TRUNCATE);
- if (TCHAR *tmp = _tcschr(jsr.jid, _T('/')))
+ TCHAR *jid = NEWTSTR_ALLOCA(him->m_tszRealJid);
+ if (TCHAR *tmp = _tcschr(jid, _T('/')))
*tmp = 0;
- ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
- ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
+ ppro->ListAdd(LIST_VCARD_TEMP, jid);
+ ppro->ListAddResource(LIST_VCARD_TEMP, jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
- hContact = (MCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
- CallService(MS_USERINFO_SHOWDIALOG, hContact, 0);
+ CallService(MS_USERINFO_SHOWDIALOG, ppro->AddToListByJID(jid, PALF_TEMPORARY), 0);
}
break;
case IDM_RJID_ADD:
if (him->m_tszRealJid && *him->m_tszRealJid) {
- JABBER_SEARCH_RESULT jsr = { 0 };
- jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
- jsr.hdr.flags = PSR_TCHAR;
- _tcsncpy_s(jsr.jid, him->m_tszRealJid, _TRUNCATE);
- if (TCHAR *tmp = _tcschr(jsr.jid, _T('/')))
+ PROTOSEARCHRESULT jsr = { 0 };
+ jsr.cbSize = sizeof(jsr);
+ jsr.flags = PSR_TCHAR;
+ jsr.id = NEWTSTR_ALLOCA(him->m_tszRealJid);
+ if (TCHAR *tmp = _tcschr(jsr.id, _T('/')))
*tmp = 0;
- jsr.hdr.nick = jsr.jid;
+ jsr.nick = jsr.id;
ADDCONTACTSTRUCT acs = { 0 };
acs.handleType = HANDLE_SEARCHRESULT;
acs.szProto = ppro->m_szModuleName;
- acs.psr = (PROTOSEARCHRESULT *)&jsr;
+ acs.psr = &jsr;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)CallService(MS_CLUI_GETHWND, 0, 0), (LPARAM)&acs);
}
break;