summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-07-30 23:15:49 +0000
committerRobert Pösel <robyer@seznam.cz>2014-07-30 23:15:49 +0000
commit3e7ef2c033af2cc511f83a8f154f129394f3832b (patch)
tree35457bec566fdd699d959c66583c59b1eacdf078 /protocols/FacebookRM/src
parent6dcfe55905a55fad9169a26d434c93ca15d0717f (diff)
Facebook: Requests constant renaming
git-svn-id: http://svn.miranda-ng.org/main/trunk@10000 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/communication.cpp78
-rw-r--r--protocols/FacebookRM/src/constants.h20
-rw-r--r--protocols/FacebookRM/src/contacts.cpp10
-rw-r--r--protocols/FacebookRM/src/process.cpp8
4 files changed, 58 insertions, 58 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 4c32e9648e..66f0248ee3 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -214,16 +214,16 @@ DWORD facebook_client::choose_security_level(RequestType request_type)
// case REQUEST_HOME:
// case REQUEST_DTSG:
// case REQUEST_BUDDY_LIST:
-// case REQUEST_LOAD_FRIEND:
-// case REQUEST_LOAD_FRIENDS:
// case REQUEST_USER_INFO:
-// case REQUEST_LOAD_REQUESTS:
+// case REQUEST_USER_INFO_ALL:
+// case REQUEST_USER_INFO_MOBILE:
+// case REQUEST_LOAD_FRIENDSHIPS:
// case REQUEST_SEARCH:
// case REQUEST_DELETE_FRIEND:
-// case REQUEST_REQUEST_FRIEND:
+// case REQUEST_ADD_FRIEND:
// case REQUEST_APPROVE_FRIEND:
-// case REQUEST_CANCEL_REQUEST:
-// case REQUEST_FRIENDS_REQUEST:
+// case REQUEST_CANCEL_FRIENDSHIP:
+// case REQUEST_FRIENDSHIP:
// case REQUEST_FEEDS:
// case REQUEST_PAGES:
// case REQUEST_NOTIFICATIONS:
@@ -232,8 +232,8 @@ DWORD facebook_client::choose_security_level(RequestType request_type)
// case REQUEST_IDENTITY_SWITCH:
// case REQUEST_STATUS_COMPOSER:
// case REQUEST_LINK_SCRAPER:
-// case REQUEST_MESSAGE_SEND:
-// case REQUEST_MESSAGE_SEND2:
+// case REQUEST_MESSAGE_SEND_CHAT:
+// case REQUEST_MESSAGE_SEND_INBOX:
// case REQUEST_THREAD_INFO:
// case REQUEST_MESSAGES_RECEIVE:
// case REQUEST_VISIBILITY:
@@ -259,8 +259,8 @@ int facebook_client::choose_method(RequestType request_type)
case REQUEST_IDENTITY_SWITCH:
case REQUEST_STATUS_COMPOSER:
case REQUEST_LINK_SCRAPER:
- case REQUEST_MESSAGE_SEND:
- case REQUEST_MESSAGE_SEND2:
+ case REQUEST_MESSAGE_SEND_CHAT:
+ case REQUEST_MESSAGE_SEND_INBOX:
case REQUEST_THREAD_INFO:
case REQUEST_VISIBILITY:
case REQUEST_POKE:
@@ -270,9 +270,9 @@ int facebook_client::choose_method(RequestType request_type)
case REQUEST_TYPING_SEND:
case REQUEST_LOGOUT:
case REQUEST_DELETE_FRIEND:
- case REQUEST_REQUEST_FRIEND:
- case REQUEST_CANCEL_REQUEST:
- case REQUEST_FRIENDS_REQUEST:
+ case REQUEST_ADD_FRIEND:
+ case REQUEST_CANCEL_FRIENDSHIP:
+ case REQUEST_FRIENDSHIP:
case REQUEST_UNREAD_THREADS:
return REQUEST_POST;
@@ -283,10 +283,10 @@ int facebook_client::choose_method(RequestType request_type)
// case REQUEST_PAGES:
// case REQUEST_NOTIFICATIONS:
// case REQUEST_RECONNECT:
-// case REQUEST_LOAD_FRIEND:
-// case REQUEST_LOAD_FRIENDS:
// case REQUEST_USER_INFO:
-// case REQUEST_LOAD_REQUESTS:
+// case REQUEST_USER_INFO_ALL:
+// case REQUEST_USER_INFO_MOBILE:
+// case REQUEST_LOAD_FRIENDSHIPS:
// case REQUEST_SEARCH:
default:
return REQUEST_GET;
@@ -318,15 +318,15 @@ std::string facebook_client::choose_server(RequestType request_type, std::string
case REQUEST_HOME:
case REQUEST_DTSG:
- case REQUEST_LOAD_REQUESTS:
+ case REQUEST_LOAD_FRIENDSHIPS:
case REQUEST_SEARCH:
- case REQUEST_USER_INFO:
+ case REQUEST_USER_INFO_MOBILE:
return FACEBOOK_SERVER_MOBILE;
// case REQUEST_LOGOUT:
// case REQUEST_BUDDY_LIST:
-// case REQUEST_LOAD_FRIEND:
-// case REQUEST_LOAD_FRIENDS:
+// case REQUEST_USER_INFO:
+// case REQUEST_USER_INFO_ALL:
// case REQUEST_FEEDS:
// case REQUEST_PAGES:
// case REQUEST_NOTIFICATIONS:
@@ -335,8 +335,8 @@ std::string facebook_client::choose_server(RequestType request_type, std::string
// case REQUEST_IDENTITY_SWITCH:
// case REQUEST_STATUS_COMPOSER:
// case REQUEST_LINK_SCRAPER:
-// case REQUEST_MESSAGE_SEND:
-// case REQUEST_MESSAGE_SEND2:
+// case REQUEST_MESSAGE_SEND_CHAT:
+// case REQUEST_MESSAGE_SEND_INBOX:
// case REQUEST_THREAD_INFO:
// case REQUEST_VISIBILITY:
// case REQUEST_POKE:
@@ -346,9 +346,9 @@ std::string facebook_client::choose_server(RequestType request_type, std::string
// case REQUEST_TYPING_SEND:
// case REQUEST_SETUP_MACHINE:
// case REQUEST_DELETE_FRIEND:
-// case REQUEST_REQUEST_FRIEND:
-// case REQUEST_CANCEL_REQUEST:
-// case REQUEST_FRIENDS_REQUEST:
+// case REQUEST_ADD_FRIEND:
+// case REQUEST_CANCEL_FRIENDSHIP:
+// case REQUEST_FRIENDSHIP:
// case REQUEST_UNREAD_THREADS:
default:
return FACEBOOK_SERVER_REGULAR;
@@ -377,7 +377,7 @@ std::string facebook_client::choose_action(RequestType request_type, std::string
case REQUEST_BUDDY_LIST:
return "/ajax/chat/buddy_list.php?__a=1";
- case REQUEST_LOAD_FRIEND:
+ case REQUEST_USER_INFO:
{
std::string action = "/ajax/chat/user_info.php?__a=1&viewer=%s&__user=%s";
utils::text::replace_all(&action, "%s", self_.user_id);
@@ -387,14 +387,14 @@ std::string facebook_client::choose_action(RequestType request_type, std::string
return action;
}
- case REQUEST_LOAD_FRIENDS:
+ case REQUEST_USER_INFO_ALL:
{
std::string action = "/ajax/chat/user_info_all.php?__a=1&viewer=%s&__user=%s";
utils::text::replace_all(&action, "%s", self_.user_id);
return action;
}
- case REQUEST_USER_INFO:
+ case REQUEST_USER_INFO_MOBILE:
{
std::string action = "/%sv=info";
if (get_data != NULL) {
@@ -403,7 +403,7 @@ std::string facebook_client::choose_action(RequestType request_type, std::string
return action;
}
- case REQUEST_LOAD_REQUESTS:
+ case REQUEST_LOAD_FRIENDSHIPS:
{
return "/friends/";
}
@@ -431,17 +431,17 @@ std::string facebook_client::choose_action(RequestType request_type, std::string
return action;
}
- case REQUEST_REQUEST_FRIEND:
+ case REQUEST_ADD_FRIEND:
{
return "/ajax/add_friend/action.php?__a=1";
}
- case REQUEST_CANCEL_REQUEST:
+ case REQUEST_CANCEL_FRIENDSHIP:
{
return "/ajax/friends/requests/cancel.php?__a=1";
}
- case REQUEST_FRIENDS_REQUEST:
+ case REQUEST_FRIENDSHIP:
{
return "/requests/friends/ajax/?__a=1";
}
@@ -502,10 +502,10 @@ std::string facebook_client::choose_action(RequestType request_type, std::string
return action;
}
- case REQUEST_MESSAGE_SEND:
+ case REQUEST_MESSAGE_SEND_CHAT:
return "/ajax/mercury/send_messages.php?__a=1";
- case REQUEST_MESSAGE_SEND2:
+ case REQUEST_MESSAGE_SEND_INBOX:
return "/ajax/messaging/send.php";
case REQUEST_THREAD_INFO:
@@ -576,8 +576,8 @@ bool facebook_client::notify_errors(RequestType request_type)
switch (request_type)
{
case REQUEST_BUDDY_LIST:
- case REQUEST_MESSAGE_SEND2:
- case REQUEST_MESSAGE_SEND:
+ case REQUEST_MESSAGE_SEND_INBOX:
+ case REQUEST_MESSAGE_SEND_CHAT:
case REQUEST_ASYNC:
return false;
@@ -1144,7 +1144,7 @@ bool facebook_client::send_message(MCONTACT hContact, std::string message_recipi
data += "&fb_dtsg=" + (!dtsg_.empty() ? dtsg_ : "0");
data += "&phstamp=0";
- resp = flap(REQUEST_MESSAGE_SEND2, &data);
+ resp = flap(REQUEST_MESSAGE_SEND_INBOX, &data);
break;
}
case MESSAGE_MERCURY:
@@ -1178,7 +1178,7 @@ bool facebook_client::send_message(MCONTACT hContact, std::string message_recipi
data += "&__a=1";
data += "&phstamp=0";
- resp = flap(REQUEST_MESSAGE_SEND, &data);
+ resp = flap(REQUEST_MESSAGE_SEND_CHAT, &data);
break;
}
case MESSAGE_TID:
@@ -1202,7 +1202,7 @@ bool facebook_client::send_message(MCONTACT hContact, std::string message_recipi
data += "&__user=" + this->self_.user_id;
data += "&phstamp=0";
- resp = flap(REQUEST_MESSAGE_SEND, &data);
+ resp = flap(REQUEST_MESSAGE_SEND_CHAT, &data);
break;
}
case MESSAGE_ASYNC:
diff --git a/protocols/FacebookRM/src/constants.h b/protocols/FacebookRM/src/constants.h
index 4e5fdab90c..6b24a79736 100644
--- a/protocols/FacebookRM/src/constants.h
+++ b/protocols/FacebookRM/src/constants.h
@@ -103,11 +103,11 @@ enum RequestType {
REQUEST_DTSG, // getting __fb_dtsg__
REQUEST_RECONNECT, // getting __sequence_num__ and __channel_id__
REQUEST_VISIBILITY, // setting chat visibility
- REQUEST_IDENTITY_SWITCH, // changing identity to post status from pages
+ REQUEST_IDENTITY_SWITCH, // changing identity to post status for pages
REQUEST_FEEDS, // getting feeds
REQUEST_NOTIFICATIONS, // getting notifications
- REQUEST_LOAD_REQUESTS, // getting friend requests
+ REQUEST_LOAD_FRIENDSHIPS, // getting friendship requests
REQUEST_PAGES, // getting pages list
REQUEST_POST_STATUS, // posting status to our or friends's wall
@@ -118,16 +118,16 @@ enum RequestType {
REQUEST_NOTIFICATIONS_READ, // marking notifications read
REQUEST_BUDDY_LIST, // getting regular updates (friends online, ...)
- REQUEST_LOAD_FRIEND, // getting info about particular friend
- REQUEST_LOAD_FRIENDS, // getting info about all friends
- REQUEST_USER_INFO, // getting info about particular user (from mobile website)
- REQUEST_REQUEST_FRIEND, // requesting friendships
+ REQUEST_USER_INFO, // getting info about particular friend
+ REQUEST_USER_INFO_ALL, // getting info about all friends
+ REQUEST_USER_INFO_MOBILE, // getting info about particular user (from mobile website)
+ REQUEST_ADD_FRIEND, // requesting friendships
REQUEST_DELETE_FRIEND, // deleting friendships
- REQUEST_CANCEL_REQUEST, // canceling (our) friendship request
- REQUEST_FRIENDS_REQUEST, // approving or ignoring friendship requests
+ REQUEST_CANCEL_FRIENDSHIP, // canceling (our) friendship request
+ REQUEST_FRIENDSHIP, // approving or ignoring friendship requests
- REQUEST_MESSAGE_SEND, // sending message
- REQUEST_MESSAGE_SEND2, // sending message through inbox
+ REQUEST_MESSAGE_SEND_CHAT, // sending message through chat
+ REQUEST_MESSAGE_SEND_INBOX, // sending message through inbox
REQUEST_MESSAGES_RECEIVE, // receiving messages
REQUEST_TYPING_SEND, // sending typing notification
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index c7604da722..0d4953494f 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -161,7 +161,7 @@ void FacebookProto::LoadContactInfo(facebook_user* fbu)
// TODO: support for more friends at once
std::string get_query = "&ids[0]=" + utils::url::encode(fbu->user_id);
- http::response resp = facy.flap(REQUEST_LOAD_FRIEND, NULL, &get_query);
+ http::response resp = facy.flap(REQUEST_USER_INFO, NULL, &get_query);
if (resp.code == HTTP_CODE_OK) {
CODE_BLOCK_TRY
@@ -422,7 +422,7 @@ void FacebookProto::AddContactToServer(void *data)
query += "&__user=" + facy.self_.user_id;
// Get unread inbox threads
- http::response resp = facy.flap(REQUEST_REQUEST_FRIEND, &query);
+ http::response resp = facy.flap(REQUEST_ADD_FRIEND, &query);
if (resp.data.find("\"success\":true", 0) != std::string::npos) {
MCONTACT hContact = ContactIDToHContact(id);
@@ -461,7 +461,7 @@ void FacebookProto::ApproveContactToServer(void *data)
query += "&fb_dtsg=" + facy.dtsg_;
// Ignore friendship request
- http::response resp = facy.flap(REQUEST_FRIENDS_REQUEST, &query);
+ http::response resp = facy.flap(REQUEST_FRIENDSHIP, &query);
if (resp.data.find("\"success\":true") != std::string::npos)
{
@@ -497,7 +497,7 @@ void FacebookProto::CancelFriendsRequest(void *data)
query += "&friend=" + std::string(id);
// Cancel (our) friendship request
- http::response resp = facy.flap(REQUEST_CANCEL_REQUEST, &query);
+ http::response resp = facy.flap(REQUEST_CANCEL_FRIENDSHIP, &query);
if (resp.data.find("\"payload\":null", 0) != std::string::npos)
{
@@ -531,7 +531,7 @@ void FacebookProto::IgnoreFriendshipRequest(void *data)
query += "&fb_dtsg=" + facy.dtsg_;
// Ignore friendship request
- http::response resp = facy.flap(REQUEST_FRIENDS_REQUEST, &query);
+ http::response resp = facy.flap(REQUEST_FRIENDSHIP, &query);
if (resp.data.find("\"success\":true") != std::string::npos)
{
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index ce337121bf..f3d91e02f1 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -157,7 +157,7 @@ void FacebookProto::ProcessFriendList(void*)
facy.handle_entry("load_friends");
// Get buddy list
- http::response resp = facy.flap(REQUEST_LOAD_FRIENDS);
+ http::response resp = facy.flap(REQUEST_USER_INFO_ALL);
if (resp.code != HTTP_CODE_OK) {
facy.handle_error("load_friends");
@@ -837,7 +837,7 @@ void FacebookProto::ProcessFriendRequests(void*)
facy.handle_entry("friendRequests");
// Get notifications
- http::response resp = facy.flap(REQUEST_LOAD_REQUESTS);
+ http::response resp = facy.flap(REQUEST_LOAD_FRIENDSHIPS);
if (resp.code != HTTP_CODE_OK) {
facy.handle_error("friendRequests");
@@ -1238,11 +1238,11 @@ void FacebookProto::SearchIdAckThread(void *targ)
if (!isOffline())
{
- http::response resp = facy.flap(REQUEST_USER_INFO, NULL, &search);
+ http::response resp = facy.flap(REQUEST_USER_INFO_MOBILE, NULL, &search);
if (resp.code == HTTP_CODE_FOUND && resp.headers.find("Location") != resp.headers.end()) {
search = utils::text::source_get_value(&resp.headers["Location"], 2, FACEBOOK_SERVER_MOBILE"/", "_rdr", true);
- resp = facy.flap(REQUEST_USER_INFO, NULL, &search);
+ resp = facy.flap(REQUEST_USER_INFO_MOBILE, NULL, &search);
}
if (resp.code == HTTP_CODE_OK)