summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-22 16:04:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-22 16:04:17 +0000
commite2c2a1f5a84c6c9b705dc85c6a2dd1f97edd57e4 (patch)
treeba79bdcede96f80039f8b88d2791f198b9ec2981 /protocols/MSN
parentf8e34b5f83f3ce5f39d541e9068b6b8cb6d92acd (diff)
T2Utf - handy replacement for ptrA<mir_utf8decodeT()>
git-svn-id: http://svn.miranda-ng.org/main/trunk@13758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn_misc.cpp3
-rw-r--r--protocols/MSN/src/msn_p2p.cpp4
-rw-r--r--protocols/MSN/src/msn_proto.cpp8
-rw-r--r--protocols/MSN/src/msn_soapstore.cpp6
-rw-r--r--protocols/MSN/src/msn_svcs.cpp2
5 files changed, 7 insertions, 16 deletions
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 8776bfd310..7408bd7df4 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -236,7 +236,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)
mir_sha1_ctx sha1ctx;
BYTE sha1c[MIR_SHA1_HASH_SIZE], sha1d[MIR_SHA1_HASH_SIZE];
- char *szFname = mir_utf8encodeT(sztFname);
+ T2Utf szFname(sztFname);
mir_sha1_init(&sha1ctx);
mir_sha1_append(&sha1ctx, (BYTE*)pData, (int)cbLen);
@@ -281,7 +281,6 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen)
char* szBuffer = ezxml_toxml(xmlp, false);
ezxml_free(xmlp);
- mir_free(szFname);
ptrA szEncodedBuffer(mir_urlEncode(szBuffer));
free(szBuffer);
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp
index 2a515a0e8c..46b85d9f43 100644
--- a/protocols/MSN/src/msn_p2p.cpp
+++ b/protocols/MSN/src/msn_p2p.cpp
@@ -249,9 +249,7 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
setString(ft->std.hContact, "PictSavedContext", ft->p2p_object);
ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
- char *filename = mir_utf8encodeT(AI.filename);
- debugLogA("Avatar for contact %08x saved to file '%s'", AI.hContact, filename);
- mir_free(filename);
+ debugLogA("Avatar for contact %08x saved to file '%s'", AI.hContact, T2Utf(AI.filename));
}
break;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 5a2036a115..acf07cc3a4 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -295,16 +295,13 @@ int __cdecl CMsnProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
db_get_static(hContact, m_szModuleName, "e-mail", email, sizeof(email)))
return 1;
- char* szMsg = mir_utf8encodeT(szMessage);
-
int netId = strncmp(email, "tel:", 4) == 0 ? NETID_MOB : (strncmp(email, "live:", 5) == 0 ? NETID_SKYPE : NETID_MSN);
- if (MSN_AddUser(hContact, email, netId, LIST_FL, szMsg)) {
+ if (MSN_AddUser(hContact, email, netId, LIST_FL, T2Utf(szMessage))) {
MSN_AddUser(hContact, email, netId, LIST_PL + LIST_REMOVE);
MSN_AddUser(hContact, email, netId, LIST_BL + LIST_REMOVE);
MSN_AddUser(hContact, email, netId, LIST_AL);
}
MSN_SetContactDb(hContact, email);
- mir_free(szMsg);
if (MSN_IsMeByContact(hContact)) displayEmailCount(hContact);
return 0;
@@ -400,7 +397,7 @@ int CMsnProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
void __cdecl CMsnProto::MsnSearchAckThread(void* arg)
{
const TCHAR* emailT = (TCHAR*)arg;
- char *email = mir_utf8encodeT(emailT);
+ T2Utf email(emailT);
if (Lists_IsInList(LIST_FL, email)) {
MSN_ShowPopup(emailT, TranslateT("Contact already in your contact list"), MSN_ALLOW_MSGBOX, NULL);
@@ -442,7 +439,6 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg)
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg, 0);
break;
}
- mir_free(email);
mir_free(arg);
}
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp
index 42a6d9ae8f..a10dbd11f0 100644
--- a/protocols/MSN/src/msn_soapstore.cpp
+++ b/protocols/MSN/src/msn_soapstore.cpp
@@ -507,7 +507,7 @@ bool CMsnProto::MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMime
{
char* reqHdr;
ezxml_t tbdy;
- char* szName = mir_utf8encodeT(sztName);
+ T2Utf szName(sztName);
ezxml_t xmlp = storeSoapHdr("CreateDocument", "RoamingIdentityChanged", tbdy, reqHdr);
ezxml_t hndl = ezxml_add_child(tbdy, "parentHandle", 0);
@@ -544,7 +544,6 @@ bool CMsnProto::MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMime
char* szData = ezxml_toxml(xmlp, true);
ezxml_free(xmlp);
- mir_free(szName);
unsigned status = 0;
char *storeUrl = NULL, *tResult = NULL;
@@ -589,7 +588,7 @@ bool CMsnProto::MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMime
bool CMsnProto::MSN_StoreUpdateDocument(const TCHAR *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse)
{
char* reqHdr;
- char* szName = mir_utf8encodeT(sztName);
+ T2Utf szName(sztName);
ezxml_t tbdy;
ezxml_t xmlp = storeSoapHdr("UpdateDocument", "RoamingIdentityChanged", tbdy, reqHdr);
@@ -616,7 +615,6 @@ bool CMsnProto::MSN_StoreUpdateDocument(const TCHAR *sztName, const char *szMime
char* szData = ezxml_toxml(xmlp, true);
ezxml_free(xmlp);
- mir_free(szName);
unsigned status = 0;
char *storeUrl = NULL, *tResult = NULL;
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp
index 32de674020..8a70038f54 100644
--- a/protocols/MSN/src/msn_svcs.cpp
+++ b/protocols/MSN/src/msn_svcs.cpp
@@ -436,7 +436,7 @@ int CMsnProto::OnGroupChange(WPARAM hContact, LPARAM lParam)
}
else {
if (MSN_IsMyContact(hContact))
- MSN_MoveContactToGroup(hContact, ptrA(mir_utf8encodeT(grpchg->pszNewName)));
+ MSN_MoveContactToGroup(hContact, T2Utf(grpchg->pszNewName));
}
return 0;
}