summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 8f4bf3489b..3433941bca 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -177,9 +177,7 @@ std::string FacebookProto::ThreadIDToContactID(const std::string &thread_id)
if (resp.code == HTTP_CODE_OK) {
try {
- facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_thread_info(&resp.data, &user_id);
- delete p;
+ facebook_json_parser(this).parse_thread_info(&resp.data, &user_id);
if (!user_id.empty())
facy.thread_id_to_user_id.insert(std::make_pair(thread_id, user_id));
@@ -210,10 +208,7 @@ void FacebookProto::LoadContactInfo(facebook_user* fbu)
if (resp.code == HTTP_CODE_OK) {
try {
- facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_user_info(&resp.data, fbu);
- delete p;
-
+ facebook_json_parser(this).parse_user_info(&resp.data, fbu);
debugLogA("*** Contact thread info processed");
}
catch (const std::exception &e) {
@@ -281,10 +276,7 @@ void FacebookProto::LoadParticipantsNames(facebook_chatroom *fbc)
if (resp.code == HTTP_CODE_OK) {
try {
// TODO: We can cache these results and next time (e.g. for different chatroom) we can use that already cached names
- facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_chat_participant_names(&resp.data, &fbc->participants);
- delete p;
-
+ facebook_json_parser(this).parse_chat_participant_names(&resp.data, &fbc->participants);
debugLogA("*** Participant names processed");
}
catch (const std::exception &e) {
@@ -323,9 +315,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
}
try {
- facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_chat_info(&resp.data, fbc);
- delete p;
+ facebook_json_parser(this).parse_chat_info(&resp.data, fbc);
// Load missing participants names
LoadParticipantsNames(fbc);