summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/process.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-10-02 10:38:56 +0000
committerRobert Pösel <robyer@seznam.cz>2013-10-02 10:38:56 +0000
commit7f920402def20a9d2a3d95defc53877b2cbe2990 (patch)
treee31d665868682af42f67d6a9bfba1a3e6ce9e138 /protocols/FacebookRM/src/process.cpp
parent19ccfc7c1220fdf728f67e466081960e19b00b06 (diff)
Facebook: get rid of validate_response forever
git-svn-id: http://svn.miranda-ng.org/main/trunk@6305 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r--protocols/FacebookRM/src/process.cpp47
1 files changed, 19 insertions, 28 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 74180a8358..af9726db2f 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -278,7 +278,6 @@ void FacebookProto::ProcessUnreadMessages(void*)
data += "&__a=1&__dyn=&__req=&ttstamp=0";
http::response resp = facy.flap(REQUEST_UNREAD_THREADS, &data);
- facy.validate_response(&resp);
if (resp.code == HTTP_CODE_OK) {
@@ -343,7 +342,6 @@ void FacebookProto::ProcessUnreadMessage(void *p)
}
resp = facy.flap(REQUEST_THREAD_INFO, &data);
- facy.validate_response(&resp);
if (resp.code == HTTP_CODE_OK) {
@@ -371,22 +369,26 @@ void FacebookProto::ProcessUnreadMessage(void *p)
ParseSmileys(messages[i]->message_text, hContact);
- if (messages[i]->isIncoming) {
- PROTORECVEVENT recv = {0};
- recv.flags = PREF_UTF;
- recv.szMessage = const_cast<char*>(messages[i]->message_text.c_str());
- recv.timestamp = local_timestamp || !messages[i]->time ? ::time(NULL) : messages[i]->time;
- ProtoChainRecvMsg(hContact, &recv);
+ if (messages[i]->isChat) {
+
} else {
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
- dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.flags = DBEF_SENT | DBEF_UTF;
- dbei.szModule = m_szModuleName;
- dbei.timestamp = local_timestamp || !messages[i]->time ? ::time(NULL) : messages[i]->time;
- dbei.cbBlob = (DWORD)messages[i]->message_text.length() + 1;
- dbei.pBlob = (PBYTE)messages[i]->message_text.c_str();
- db_event_add(hContact, &dbei);
+ if (messages[i]->isIncoming) {
+ PROTORECVEVENT recv = {0};
+ recv.flags = PREF_UTF;
+ recv.szMessage = const_cast<char*>(messages[i]->message_text.c_str());
+ recv.timestamp = local_timestamp || !messages[i]->time ? ::time(NULL) : messages[i]->time;
+ ProtoChainRecvMsg(hContact, &recv);
+ } else {
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.flags = DBEF_SENT | DBEF_UTF;
+ dbei.szModule = m_szModuleName;
+ dbei.timestamp = local_timestamp || !messages[i]->time ? ::time(NULL) : messages[i]->time;
+ dbei.cbBlob = (DWORD)messages[i]->message_text.length() + 1;
+ dbei.pBlob = (PBYTE)messages[i]->message_text.c_str();
+ db_event_add(hContact, &dbei);
+ }
}
}
delete messages[i];
@@ -510,9 +512,6 @@ void FacebookProto::ProcessNotifications(void*)
// Get notifications
http::response resp = facy.flap(REQUEST_NOTIFICATIONS);
- // Process result data
- facy.validate_response(&resp);
-
if (resp.code != HTTP_CODE_OK) {
facy.handle_error("notifications");
return;
@@ -556,9 +555,6 @@ void FacebookProto::ProcessFriendRequests(void*)
// Get notifications
http::response resp = facy.flap(REQUEST_LOAD_REQUESTS);
- // Process result data
- facy.validate_response(&resp);
-
if (resp.code != HTTP_CODE_OK) {
facy.handle_error("friendRequests");
return;
@@ -763,9 +759,6 @@ void FacebookProto::SearchAckThread(void *targ)
http::response resp = facy.flap(REQUEST_SEARCH, NULL, &get_data);
- // Process result data
- facy.validate_response(&resp);
-
if (resp.code == HTTP_CODE_OK)
{
std::string items = utils::text::source_get_value(&resp.data, 2, "<body", "</body>");
@@ -848,8 +841,6 @@ void FacebookProto::SearchIdAckThread(void *targ)
resp = facy.flap(REQUEST_USER_INFO, NULL, &search);
}
- facy.validate_response(&resp);
-
if (resp.code == HTTP_CODE_OK)
{
std::string about = utils::text::source_get_value(&resp.data, 2, "<div class=\"timeline", "<div id=\"footer");