summaryrefslogtreecommitdiff
path: root/protocols/Twitter/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-02-19 12:31:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-02-19 12:31:20 +0300
commit46fd8bbce689895bfbaaa08d9bad73b879e17172 (patch)
tree965513d22957bad31ea5d6fb2ea8f9ea94c9cd75 /protocols/Twitter/src/proto.cpp
parent845d6d07ee1c6c87c7dacae4f0ba0a803a5aff3d (diff)
Twitter:
- fixes #2218 (add support for private messages); - code optimization; - support for JSON requests; - fixed base url;
Diffstat (limited to 'protocols/Twitter/src/proto.cpp')
-rw-r--r--protocols/Twitter/src/proto.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index 01da0ec206..8ab85237b1 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -26,7 +26,6 @@ static volatile LONG g_msgid = 1;
CTwitterProto::CTwitterProto(const char *proto_name, const wchar_t *username) :
PROTO<CTwitterProto>(proto_name, username),
m_szChatId(mir_utf8encodeW(username)),
- m_szBaseUrl("https://api.twitter.com/"),
m_arChatMarks(10, NumericKeySortT)
{
CreateProtoService(PS_CREATEACCMGRUI, &CTwitterProto::SvcCreateAccMgrUI);
@@ -138,13 +137,10 @@ void CTwitterProto::SendSuccess(void *p)
auto *data = (TSendDirect*)p;
- DBVARIANT dbv;
- if (!db_get_s(data->hContact, m_szModuleName, TWITTER_KEY_UN, &dbv)) {
- mir_cslock s(twitter_lock_);
- send_direct(dbv.pszVal, data->msg);
-
+ CMStringA id(getMStringA(data->hContact, TWITTER_KEY_ID));
+ if (!id.IsEmpty()) {
+ send_direct(id, data->msg);
ProtoBroadcastAck(data->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)data->msgid, 0);
- db_free(&dbv);
}
delete data;