diff options
Diffstat (limited to 'protocols/FacebookRM/src/requests/contacts.h')
-rw-r--r-- | protocols/FacebookRM/src/requests/contacts.h | 117 |
1 files changed, 52 insertions, 65 deletions
diff --git a/protocols/FacebookRM/src/requests/contacts.h b/protocols/FacebookRM/src/requests/contacts.h index 6a92bf6b27..4b1122c808 100644 --- a/protocols/FacebookRM/src/requests/contacts.h +++ b/protocols/FacebookRM/src/requests/contacts.h @@ -43,28 +43,23 @@ public: UserInfoRequest(facebook_client *fc, const LIST<char> &userIds) : HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/chat/user_info/") { - Url - << "dpr=1"; + Url << INT_PARAM("dpr", 1); for (int i = 0; i < userIds.getCount(); i++) { CMStringA id(::FORMAT, "ids[%i]", i); - Body << CHAR_VALUE(id, ptrA(mir_urlEncode(userIds[i]))); + Body << CHAR_PARAM(id, ptrA(mir_urlEncode(userIds[i]))); } Body - << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) - << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) - << CHAR_VALUE("__user", fc->self_.user_id.c_str()) - << CHAR_VALUE("__dyn", fc->__dyn()) - << CHAR_VALUE("__req", fc->__req()) - << CHAR_VALUE("__rev", fc->__rev()) - << "__a=1" - << "__pc=PHASED:DEFAULT" - << "__be=1" - << "jazoest=" - << "__spin_r=" - << "__spin_b=" - << "__spin_t="; + << CHAR_PARAM("fb_dtsg", fc->dtsg_.c_str()) + << CHAR_PARAM("ttstamp", fc->ttstamp_.c_str()) + << CHAR_PARAM("__user", fc->self_.user_id.c_str()) + << CHAR_PARAM("__dyn", fc->__dyn()) + << CHAR_PARAM("__req", fc->__req()) + << CHAR_PARAM("__rev", fc->__rev()) + << INT_PARAM("__a", 1) + << INT_PARAM("__be", 1) + << CHAR_PARAM("__pc", "PHASED:DEFAULT"); } }; @@ -77,19 +72,19 @@ public: HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/chat/user_info_all/") { Url - << "dpr=1" - << CHAR_VALUE("viewer", fc->self_.user_id.c_str()); + << INT_PARAM("dpr", 1) + << CHAR_PARAM("viewer", fc->self_.user_id.c_str()); Body - << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) - << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) - << CHAR_VALUE("__user", fc->self_.user_id.c_str()) - << CHAR_VALUE("__dyn", fc->__dyn()) - << CHAR_VALUE("__req", fc->__req()) - << CHAR_VALUE("__rev", fc->__rev()) - << "__a=1" - << "__pc=PHASED:DEFAULT" - << "__be=-1"; + << CHAR_PARAM("fb_dtsg", fc->dtsg_.c_str()) + << CHAR_PARAM("ttstamp", fc->ttstamp_.c_str()) + << CHAR_PARAM("__user", fc->self_.user_id.c_str()) + << CHAR_PARAM("__dyn", fc->__dyn()) + << CHAR_PARAM("__req", fc->__req()) + << CHAR_PARAM("__rev", fc->__rev()) + << CHAR_PARAM("__pc", "PHASED:DEFAULT") + << INT_PARAM("__a", 1) + << INT_PARAM("__be", -1); } }; @@ -100,22 +95,16 @@ public: AddFriendRequest(facebook_client *fc, const char *userId) : HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/ajax/add_friend/action.php") { - Url - << "__a=1"; + Url << INT_PARAM("__a", 1); Body - << CHAR_VALUE("to_friend", userId) - << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) - << CHAR_VALUE("__user", fc->self_.user_id.c_str()) - << "action=add_friend" - << "how_found=profile_button" - << "ref_param=ts" - << "outgoing_id=" - << "unwanted=" - << "logging_location=" - << "no_flyout_on_click=false" - << "ego_log_data=" - << "lsd="; + << CHAR_PARAM("to_friend", userId) + << CHAR_PARAM("fb_dtsg", fc->dtsg_.c_str()) + << CHAR_PARAM("__user", fc->self_.user_id.c_str()) + << CHAR_PARAM("action", "add_friend") + << CHAR_PARAM("how_found", "profile_button") + << CHAR_PARAM("ref_param", "ts") + << CHAR_PARAM("no_flyout_on_click", "false"); } }; @@ -127,20 +116,20 @@ public: HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/ajax/profile/removefriendconfirm.php") { Url - << "__a=1" - << "norefresh=true" - << "unref=button_dropdown" - << CHAR_VALUE("uid", userId); + << INT_PARAM("__a", 1) + << BOOL_PARAM("norefresh", true) + << CHAR_PARAM("unref", "button_dropdown") + << CHAR_PARAM("uid", userId); Body - << CHAR_VALUE("uid", userId) - << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) - << CHAR_VALUE("__user", fc->self_.user_id.c_str()) - << CHAR_VALUE("ttstamp", fc->ttstamp_.c_str()) - << "norefresh=true" - << "unref=button_dropdown" - << "confirmed=1" - << "__a=1"; + << CHAR_PARAM("uid", userId) + << CHAR_PARAM("fb_dtsg", fc->dtsg_.c_str()) + << CHAR_PARAM("__user", fc->self_.user_id.c_str()) + << CHAR_PARAM("ttstamp", fc->ttstamp_.c_str()) + << CHAR_PARAM("norefresh", "true") + << CHAR_PARAM("unref", "button_dropdown") + << INT_PARAM("confirmed", 1) + << INT_PARAM("__a", 1); } }; @@ -151,14 +140,13 @@ public: CancelFriendshipRequest(facebook_client *fc, const char *userId) : HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/ajax/friends/requests/cancel.php") { - Url - << "__a=1"; + Url << INT_PARAM("__a", 1); Body - << "confirmed=1" - << CHAR_VALUE("friend", userId) - << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) - << CHAR_VALUE("__user", fc->self_.user_id.c_str()); + << INT_PARAM("confirmed", 1) + << CHAR_PARAM("friend", userId) + << CHAR_PARAM("fb_dtsg", fc->dtsg_.c_str()) + << CHAR_PARAM("__user", fc->self_.user_id.c_str()); } }; @@ -171,8 +159,7 @@ public: AnswerFriendshipRequest(facebook_client *fc, const char *userId, Answer answer) : HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/requests/friends/ajax/") { - Url - << "__a=1"; + Url << INT_PARAM("__a", 1); const char *action = ""; switch (answer) { @@ -185,10 +172,10 @@ public: } Body - << CHAR_VALUE("action", action) - << CHAR_VALUE("id", userId) - << CHAR_VALUE("fb_dtsg", fc->dtsg_.c_str()) - << CHAR_VALUE("__user", fc->self_.user_id.c_str()); + << CHAR_PARAM("action", action) + << CHAR_PARAM("id", userId) + << CHAR_PARAM("fb_dtsg", fc->dtsg_.c_str()) + << CHAR_PARAM("__user", fc->self_.user_id.c_str()); } }; |