diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-09-29 14:44:04 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-09-29 14:44:04 +0000 |
commit | d09782a435ae4a9229b853e53e603d4c621df3a3 (patch) | |
tree | 25acbd0e49c8d901bd00b9b9bf44a84e6c1257e1 /protocols/FacebookRM/src/process.cpp | |
parent | b728069180bcea77894d344753a7fdfc4f30a061 (diff) |
Facebook: cleanup using ptrA, ptrT
git-svn-id: http://svn.miranda-ng.org/main/trunk@6270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 31 |
1 files changed, 10 insertions, 21 deletions
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<facebook_notification*>::size_type i=0; i<notifications.size(); i++)
{
LOG(" Got notification: %s", notifications[i]->text.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<facebook_notification*>::size_type i=0; i<notifications.size(); i++)
{
LOG(" Got notification: %s", notifications[i]->text.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<facebook_newsfeed*>::size_type i=0; i<news.size(); i++)
{
LOG(" Got newsfeed: %s %s", news[i]->title.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;
|