summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/contacts.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-09-01 21:44:28 +0000
committerRobert Pösel <robyer@seznam.cz>2016-09-01 21:44:28 +0000
commit6c13e88bbfd39fe43ac732dde41672aead181819 (patch)
tree6b65af85c0ae715997bcffa490116464c6cdb212 /protocols/FacebookRM/src/contacts.cpp
parent31dbfa8932404d69b11dbaa9c4f16e141546b672 (diff)
Facebook: Remove use of useless macros
git-svn-id: http://svn.miranda-ng.org/main/trunk@17239 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp67
1 files changed, 27 insertions, 40 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 1d780d6e72..cb67ff7a0f 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -199,22 +199,19 @@ std::string FacebookProto::ThreadIDToContactID(const std::string &thread_id)
http::response resp = facy.flap(REQUEST_THREAD_INFO, &data); // NOTE: Request revised 17.8.2016
if (resp.code == HTTP_CODE_OK) {
- CODE_BLOCK_TRY
-
+ try {
facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_thread_info(&resp.data, &user_id);
- delete p;
-
- if (!user_id.empty())
- facy.thread_id_to_user_id.insert(std::make_pair(thread_id, user_id));
-
- debugLogA("*** Thread info processed");
+ p->parse_thread_info(&resp.data, &user_id);
+ delete p;
- CODE_BLOCK_CATCH
+ if (!user_id.empty())
+ facy.thread_id_to_user_id.insert(std::make_pair(thread_id, user_id));
+ debugLogA("*** Thread info processed");
+ }
+ catch (const std::exception &e) {
debugLogA("*** Error processing thread info: %s", e.what());
-
- CODE_BLOCK_END
+ }
}
return user_id;
@@ -239,19 +236,16 @@ void FacebookProto::LoadContactInfo(facebook_user* fbu)
http::response resp = facy.flap(REQUEST_USER_INFO, &data); // NOTE: Request revised 17.8.2016
if (resp.code == HTTP_CODE_OK) {
- CODE_BLOCK_TRY
-
+ try {
facebook_json_parser* p = new facebook_json_parser(this);
p->parse_user_info(&resp.data, fbu);
delete p;
debugLogA("*** Contact thread info processed");
-
- CODE_BLOCK_CATCH
-
+ }
+ catch (const std::exception &e) {
debugLogA("*** Error processing contact thread info: %s", e.what());
-
- CODE_BLOCK_END
+ }
}
}
@@ -317,21 +311,17 @@ void FacebookProto::LoadParticipantsNames(facebook_chatroom *fbc)
http::response resp = facy.flap(REQUEST_USER_INFO, &data); // NOTE: Request revised 17.8.2016
if (resp.code == HTTP_CODE_OK) {
- CODE_BLOCK_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;
-
- debugLogA("*** Participant names processed");
-
- CODE_BLOCK_CATCH
+ 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;
+ debugLogA("*** Participant names processed");
+ }
+ catch (const std::exception &e) {
debugLogA("*** Error processing participant names: %s", e.what());
-
- CODE_BLOCK_END
+ }
}
}
}
@@ -381,8 +371,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
return;
}
- CODE_BLOCK_TRY
-
+ try {
facebook_json_parser* p = new facebook_json_parser(this);
p->parse_chat_info(&resp.data, fbc);
delete p;
@@ -406,7 +395,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
std::wstring tname = _A2T(participant.c_str(), CP_UTF8);
fbc->chat_name += utils::text::prepare_name(tname, false);
-
+
if (++namesUsed >= FACEBOOK_CHATROOM_NAMES_COUNT)
break;
}
@@ -423,12 +412,10 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
}
debugLogA("*** Chat thread info processed");
-
- CODE_BLOCK_CATCH
-
+ }
+ catch (const std::exception &e) {
debugLogA("*** Error processing chat thread info: %s", e.what());
-
- CODE_BLOCK_END
+ }
facy.handle_success("LoadChatInfo");
}