summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src/services.cpp
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/AimOscar/src/services.cpp
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/AimOscar/src/services.cpp')
-rw-r--r--protocols/AimOscar/src/services.cpp24
1 files changed, 8 insertions, 16 deletions
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;