diff options
Diffstat (limited to 'protocols/FacebookRM/src/http_request.h')
-rw-r--r-- | protocols/FacebookRM/src/http_request.h | 230 |
1 files changed, 230 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/http_request.h b/protocols/FacebookRM/src/http_request.h index 7c03adec46..523d7d6af8 100644 --- a/protocols/FacebookRM/src/http_request.h +++ b/protocols/FacebookRM/src/http_request.h @@ -246,4 +246,234 @@ public: } }; +///////////////////////////////////////////////////////////////////////////////////////// +// channel.cpp + +struct ChannelRequest : public HttpRequest +{ + enum Type { PULL, PING }; + + ChannelRequest(facebook_client *fc, Type type); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// contact.cpp + +// getting frienship requests (using mobile website) +struct GetFriendshipsRequest : public HttpRequest +{ + GetFriendshipsRequest(bool mobileBasicWorks) : + HttpRequest(REQUEST_GET, FORMAT, "%s/friends/center/requests/", mobileBasicWorks ? FACEBOOK_SERVER_MBASIC : FACEBOOK_SERVER_MOBILE) + { + flags |= NLHRF_REDIRECT; + } +}; + +// getting info about particular friend +struct UserInfoRequest : public HttpRequest +{ UserInfoRequest(facebook_client *fc, const LIST<char> &userIds); +}; + +// getting info about all friends +struct UserInfoAllRequest : public HttpRequest +{ UserInfoAllRequest(facebook_client *fc); +}; + +// requesting friendships +struct AddFriendRequest : public HttpRequest +{ AddFriendRequest(facebook_client *fc, const char *userId); +}; + +// deleting friendships +struct DeleteFriendRequest : public HttpRequest +{ DeleteFriendRequest(facebook_client *fc, const char *userId); +}; + +// canceling (our) friendship request +struct CancelFriendshipRequest : public HttpRequest +{ CancelFriendshipRequest(facebook_client *fc, const char *userId); +}; + +// approving or ignoring friendship requests +struct AnswerFriendshipRequest : public HttpRequest +{ + enum Answer { CONFIRM, REJECT }; + + AnswerFriendshipRequest(facebook_client *fc, const char *userId, Answer answer); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// feeds.cpp + +// getting newsfeed posts +struct NewsfeedRequest : public HttpRequest +{ NewsfeedRequest(facebook_client *fc); +}; + +// getting memories ("on this day") posts +struct MemoriesRequest : public HttpRequest +{ MemoriesRequest(facebook_client *fc); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// history.cpp + +// getting thread info and messages +class ThreadInfoRequest : public HttpRequest +{ + void setCommonBody(facebook_client *fc); + +public: + // Request only messages history + ThreadInfoRequest(facebook_client *fc, bool isChat, const char *id, const char* timestamp = nullptr, int limit = -1); + ThreadInfoRequest(facebook_client *fc, const LIST<char> &ids, int offset, int limit); +}; + +// getting unread threads +struct UnreadThreadsRequest : public HttpRequest +{ UnreadThreadsRequest(facebook_client *fc); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// login.cpp + +// connecting physically +struct LoginRequest : public HttpRequest +{ + LoginRequest(); + LoginRequest(const char *username, const char *password, const char *urlData, const char *bodyData); +}; + +// disconnecting physically +struct LogoutRequest : public HttpRequest +{ LogoutRequest(const char *dtsg, const char *logoutHash); +}; + +// request to receive login code via SMS +struct LoginSmsRequest : public HttpRequest +{ LoginSmsRequest(facebook_client *fc, const char *dtsg); +}; + +// setting machine name +struct SetupMachineRequest : public HttpRequest +{ + SetupMachineRequest(); + SetupMachineRequest(const char *dtsg, const char *nh, const char *submit); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// messages.cpp + +// sending messages +struct SendMessageRequest : public HttpRequest +{ SendMessageRequest(facebook_client *fc, const char *userId, const char *threadId, const char *messageId, const char *messageText, bool isChat, const char *captcha, const char *captchaPersistData); +}; + +// sending typing notification +struct SendTypingRequest : public HttpRequest +{ SendTypingRequest(facebook_client *fc, const char *userId, bool isChat, bool isTyping); +}; + +struct MarkMessageReadRequest : public HttpRequest +{ MarkMessageReadRequest(facebook_client *fc, const LIST<char> &ids); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// notifications.cpp + +// getting notifications +struct GetNotificationsRequest : public HttpRequest +{ GetNotificationsRequest(facebook_client *fc, int count); +}; + +// marking notifications read +struct MarkNotificationReadRequest : public HttpRequest +{ MarkNotificationReadRequest(facebook_client *fc, const char *id); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// profile.cpp + +// getting own name, avatar, ... +struct HomeRequest : public HttpRequest +{ HomeRequest(); +}; + +// getting fb_dtsg +struct DtsgRequest : public HttpRequest +{ DtsgRequest(); +}; + +// request mobile page containing profile picture +struct ProfilePictureRequest : public HttpRequest +{ ProfilePictureRequest(bool mobileBasicWorks, const char *userId); +}; + +// request mobile page containing user profile +struct ProfileRequest : public HttpRequest +{ ProfileRequest(bool mobileBasicWorks, const char *data); +}; + +// request mobile page containing user profile by his id, and in english language (for parsing data) +struct ProfileInfoRequest : public HttpRequest +{ ProfileInfoRequest(bool mobileBasicWorks, const char *userId); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// search.cpp + +// searching +struct SearchRequest : public HttpRequest +{ SearchRequest(bool mobileBasicWorks, const char *query, int s, int pn, const char *ssid); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// status.cpp + +// getting info about channel and connecting to it +struct ReconnectRequest : public HttpRequest +{ ReconnectRequest(facebook_client *fc); +}; + +// setting chat visibility +struct SetVisibilityRequest : public HttpRequest +{ SetVisibilityRequest(facebook_client *fc, bool online); +}; + +////////////////////////////////////////////////////////////////////////////////////////// +// utils.cpp + +// getting data for given url (for sending/posting reasons) +struct LinkScraperRequest : public HttpRequest +{ LinkScraperRequest(facebook_client *fc, status_data *status); +}; + +// refreshing captcha dialog (changing captcha type) +struct RefreshCaptchaRequest : public HttpRequest +{ RefreshCaptchaRequest(facebook_client *fc, const char *captchaPersistData); +}; + +// getting owned/admined pages list +struct GetPagesRequest : public HttpRequest +{ + GetPagesRequest() : + HttpRequest(REQUEST_GET, FACEBOOK_SERVER_REGULAR "/bookmarks/pages") + {} +}; + +// changing identity to post status for pages +struct SwitchIdentityRequest : public HttpRequest +{ SwitchIdentityRequest(const char *dtsg, const char *userId); +}; + +// posting status to our or friends's wall +struct SharePostRequest : public HttpRequest +{ SharePostRequest(facebook_client *fc, status_data *status, const char *linkData); +}; + +// sending pokes +struct SendPokeRequest : public HttpRequest +{ SendPokeRequest(facebook_client *fc, const char *userId); +}; + #endif //_HTTP_REQUEST_H_
\ No newline at end of file |