diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-18 23:22:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-18 23:22:20 +0300 |
commit | 845d6d07ee1c6c87c7dacae4f0ba0a803a5aff3d (patch) | |
tree | 7ac585bc9808977c7c1bb5fac2b795e1a536bf04 /protocols/Twitter/src/twitter.cpp | |
parent | 5f1b32a8d66e21430457a5e33b58b27fa10110af (diff) |
Twitter:
- partially implements #2218 (support for reading direct messages and marking them as read);
- user id parameter added to database;
- support added for server message ids;
- code cleaning;
Diffstat (limited to 'protocols/Twitter/src/twitter.cpp')
-rw-r--r-- | protocols/Twitter/src/twitter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Twitter/src/twitter.cpp b/protocols/Twitter/src/twitter.cpp index 2a8625e10b..16b105ab67 100644 --- a/protocols/Twitter/src/twitter.cpp +++ b/protocols/Twitter/src/twitter.cpp @@ -108,6 +108,17 @@ void CTwitterProto::remove_friend(const CMStringA &name) Execute(req);
}
+void CTwitterProto::mark_read(MCONTACT hContact, const CMStringA &msgId)
+{
+ CMStringA id(getMStringA(hContact, TWITTER_KEY_ID));
+ if (id.IsEmpty())
+ return;
+
+ auto *req = new AsyncHttpRequest(REQUEST_POST, m_szBaseUrl + "1.1/direct_messages/mark_read.json");
+ req << CHAR_PARAM("recipient_id", id) << CHAR_PARAM("last_read_event_id", msgId);
+ Execute(req);
+}
+
void CTwitterProto::set_status(const CMStringA &text)
{
if (text.IsEmpty())
|