From d09782a435ae4a9229b853e53e603d4c621df3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 29 Sep 2013 14:44:04 +0000 Subject: Facebook: cleanup using ptrA, ptrT git-svn-id: http://svn.miranda-ng.org/main/trunk@6270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/process.cpp | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'protocols/FacebookRM/src/process.cpp') diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 8b72f2e11d..74180a8358 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -116,9 +116,8 @@ void FacebookProto::ProcessBuddyList(void* data) std::string url = FACEBOOK_URL_PROFILE + fbu->user_id; - TCHAR* szTitle = mir_utf8decodeT(fbu->real_name.c_str()); + ptrT szTitle( mir_utf8decodeT(fbu->real_name.c_str())); NotifyEvent(szTitle, TranslateT("Contact is back on server-list."), fbu->handle, FACEBOOK_EVENT_OTHER, &url); - mir_free(szTitle); } // Check avatar change @@ -209,9 +208,8 @@ void FacebookProto::ProcessFriendList(void* data) std::string url = FACEBOOK_URL_PROFILE + fbu->user_id; - TCHAR* szTitle = mir_utf8decodeT(fbu->real_name.c_str()); + ptrT szTitle( mir_utf8decodeT(fbu->real_name.c_str())); NotifyEvent(szTitle, TranslateT("Contact is back on server-list."), hContact, FACEBOOK_EVENT_OTHER, &url); - mir_free(szTitle); } // Check avatar change @@ -235,9 +233,8 @@ void FacebookProto::ProcessFriendList(void* data) std::string url = FACEBOOK_URL_PROFILE + id; - TCHAR* szTitle = mir_utf8decodeT(contactname.c_str()); + ptrT szTitle( mir_utf8decodeT(contactname.c_str())); NotifyEvent(szTitle, TranslateT("Contact is no longer on server-list."), hContact, FACEBOOK_EVENT_OTHER, &url); - mir_free(szTitle); } } } @@ -481,12 +478,9 @@ void FacebookProto::ProcessMessages(void* data) for(std::vector::size_type i=0; itext.c_str()); - TCHAR* szTitle = mir_utf8decodeT(this->m_szModuleName); - TCHAR* szText = mir_utf8decodeT(notifications[i]->text.c_str()); + ptrT szTitle( mir_utf8decodeT(this->m_szModuleName)); + ptrT szText( mir_utf8decodeT(notifications[i]->text.c_str())); NotifyEvent(szTitle, szText, ContactIDToHContact(notifications[i]->user_id), FACEBOOK_EVENT_NOTIFICATION, ¬ifications[i]->link, ¬ifications[i]->id); - mir_free(szTitle); - mir_free(szText); - delete notifications[i]; } notifications.clear(); @@ -539,12 +533,9 @@ void FacebookProto::ProcessNotifications(void*) for(std::vector::size_type i=0; itext.c_str()); - TCHAR* szTitle = mir_utf8decodeT(this->m_szModuleName); - TCHAR* szText = mir_utf8decodeT(notifications[i]->text.c_str()); + ptrT szTitle( mir_utf8decodeT(this->m_szModuleName)); + ptrT szText( mir_utf8decodeT(notifications[i]->text.c_str())); NotifyEvent(szTitle, szText, ContactIDToHContact(notifications[i]->user_id), FACEBOOK_EVENT_NOTIFICATION, ¬ifications[i]->link, ¬ifications[i]->id); - mir_free(szTitle); - mir_free(szText); - delete notifications[i]; } notifications.clear(); @@ -733,11 +724,9 @@ void FacebookProto::ProcessFeeds(void* data) for(std::vector::size_type i=0; ititle.c_str(), news[i]->text.c_str()); - TCHAR* szTitle = mir_utf8decodeT(news[i]->title.c_str()); - TCHAR* szText = mir_utf8decodeT(news[i]->text.c_str()); + ptrT szTitle( mir_utf8decodeT(news[i]->title.c_str())); + ptrT szText( mir_utf8decodeT(news[i]->text.c_str())); NotifyEvent(szTitle,szText,this->ContactIDToHContact(news[i]->user_id),FACEBOOK_EVENT_NEWSFEED, &news[i]->link); - mir_free(szTitle); - mir_free(szText); delete news[i]; } news.clear(); @@ -886,7 +875,7 @@ void FacebookProto::SearchIdAckThread(void *targ) PROTOSEARCHRESULT isr = {0}; isr.cbSize = sizeof(isr); isr.flags = PSR_TCHAR; - isr.id = tid; + isr.id = tid; isr.firstName = tname; isr.lastName = tsurname; -- cgit v1.2.3