summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/notifications.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-08 20:15:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-08 20:15:22 +0300
commit968eceb522b9dc380a4922e2f6b08857dec83bf4 (patch)
tree62214fa8eb79b103dd1703740189d50e98c128cf /protocols/FacebookRM/src/notifications.cpp
parent1c6bcb36c8b19d6a40e23dc9a71944e48bb67295 (diff)
Facebook: less RTTI, less useless data
Diffstat (limited to 'protocols/FacebookRM/src/notifications.cpp')
-rw-r--r--protocols/FacebookRM/src/notifications.cpp44
1 files changed, 25 insertions, 19 deletions
diff --git a/protocols/FacebookRM/src/notifications.cpp b/protocols/FacebookRM/src/notifications.cpp
index eee2574fce..a4f5ae5925 100644
--- a/protocols/FacebookRM/src/notifications.cpp
+++ b/protocols/FacebookRM/src/notifications.cpp
@@ -25,40 +25,46 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////////////////
// getting notifications
-GetNotificationsRequest::GetNotificationsRequest(facebook_client *fc, int count) :
- HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/ajax/notifications/client/get.php")
+HttpRequest* facebook_client::getNotificationsRequest(int count)
{
- Url << INT_PARAM("dpr", 1);
+ HttpRequest *p = new HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/ajax/notifications/client/get.php");
+
+ p->Url << INT_PARAM("dpr", 1);
- Body
- << CHAR_PARAM("__user", fc->self_.user_id.c_str())
- << CHAR_PARAM("fb_dtsg", fc->dtsg_.c_str())
+ p->Body
+ << CHAR_PARAM("__user", self_.user_id.c_str())
+ << CHAR_PARAM("fb_dtsg", dtsg_.c_str())
// << "cursor=" // when loading more
<< INT_PARAM("length", count) // number of items to load
// << "businessID=" // probably for pages?
- << CHAR_PARAM("ttstamp", fc->ttstamp_.c_str())
- << CHAR_PARAM("__dyn", fc->__dyn())
- << CHAR_PARAM("__req", fc->__req())
- << CHAR_PARAM("__rev", fc->__rev())
+ << CHAR_PARAM("ttstamp", ttstamp_.c_str())
+ << CHAR_PARAM("__dyn", __dyn())
+ << CHAR_PARAM("__req", __req())
+ << CHAR_PARAM("__rev", __rev())
<< CHAR_PARAM("__pc", "PHASED:DEFAULT")
<< INT_PARAM("__be", -1)
<< INT_PARAM("__a", 1);
+
+ return p;
}
//////////////////////////////////////////////////////////////////////////////////////////
// marking notifications read
-MarkNotificationReadRequest::MarkNotificationReadRequest(facebook_client *fc, const char *id) :
- HttpRequest(REQUEST_GET, FACEBOOK_SERVER_REGULAR "/ajax/notifications/mark_read.php")
+HttpRequest* facebook_client::markNotificationReadRequest(const char *id)
{
- Url
+ HttpRequest *p = new HttpRequest(REQUEST_GET, FACEBOOK_SERVER_REGULAR "/ajax/notifications/mark_read.php");
+
+ p->Url
<< INT_PARAM("__a", 1)
<< INT_PARAM("seen", 0)
- << 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("__dyn", fc->__dyn())
- << CHAR_PARAM("__req", fc->__req())
- << CHAR_PARAM("__rev", fc->__rev())
+ << CHAR_PARAM("fb_dtsg", dtsg_.c_str())
+ << CHAR_PARAM("__user", self_.user_id.c_str())
+ << CHAR_PARAM("ttstamp", ttstamp_.c_str())
+ << CHAR_PARAM("__dyn", __dyn())
+ << CHAR_PARAM("__req", __req())
+ << CHAR_PARAM("__rev", __rev())
<< CHAR_PARAM("alert_ids%5B0%5D", ptrA(mir_urlEncode(id)));
+
+ return p;
}