From e2c2a1f5a84c6c9b705dc85c6a2dd1f97edd57e4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 22 May 2015 16:04:17 +0000 Subject: T2Utf - handy replacement for ptrA git-svn-id: http://svn.miranda-ng.org/main/trunk@13758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/services.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'protocols/AimOscar/src/services.cpp') diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index 5097b0d080..01944ef024 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -204,34 +204,26 @@ int CAimProto::OnGroupChange(WPARAM hContact,LPARAM lParam) if (hContact == NULL) { if (grpchg->pszNewName == NULL && grpchg->pszOldName != NULL) { - char* szOldName = mir_utf8encodeT(grpchg->pszOldName); + T2Utf szOldName(grpchg->pszOldName); unsigned short group_id = group_list.find_id(szOldName); if (group_id) { aim_delete_contact(hServerConn, seqno, szOldName, 0, group_id, 1, false); group_list.remove_by_id(group_id); update_server_group("", 0); } - mir_free(szOldName); } else if (grpchg->pszNewName != NULL && grpchg->pszOldName != NULL) { - char* szOldName = mir_utf8encodeT(grpchg->pszOldName); - unsigned short group_id = group_list.find_id(szOldName); - if (group_id) { - char* szNewName = mir_utf8encodeT(grpchg->pszNewName); - update_server_group(szNewName, group_id); - mir_free(szNewName); - } - mir_free(szOldName); + unsigned short group_id = group_list.find_id(T2Utf(grpchg->pszOldName)); + if (group_id) + update_server_group(T2Utf(grpchg->pszNewName), group_id); } } else { if (is_my_contact(hContact) && getBuddyId(hContact, 1) && !db_get_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 0)) { - if (grpchg->pszNewName) { - char* szNewName = mir_utf8encodeT(grpchg->pszNewName); - add_contact_to_group(hContact, szNewName); - mir_free(szNewName); - } - else add_contact_to_group(hContact, AIM_DEFAULT_GROUP); + if (grpchg->pszNewName) + add_contact_to_group(hContact, T2Utf(grpchg->pszNewName)); + else + add_contact_to_group(hContact, AIM_DEFAULT_GROUP); } } return 0; -- cgit v1.2.3