summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-24 15:36:52 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-24 15:36:52 +0300
commit93af1070aaa1de81d573ff0ec879e74df036dd01 (patch)
tree502d4f5b3fa538e52acf1d595b36566df312433f /protocols/ICQ-WIM/src/proto.cpp
parentc69b6df18206f22513bc83f93d29f95ecbd77977 (diff)
ICQ: added messages' forwarding + "Add to favorites" NewStory menu item
Diffstat (limited to 'protocols/ICQ-WIM/src/proto.cpp')
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 9a58298890..b6f27ec26a 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -541,20 +541,6 @@ HANDLE CIcqProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wcha
int CIcqProto::SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszSrc)
{
- CMStringA szUserid(GetUserId(hContact));
- if (szUserid.IsEmpty())
- return 0;
-
- int id = InterlockedIncrement(&m_msgId);
- auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_POST, "/im/sendIM", &CIcqProto::OnSendMessage);
-
- auto *pOwn = new IcqOwnMessage(hContact, id, pReq->m_reqId, pszSrc);
- pReq->pUserInfo = pOwn;
- {
- mir_cslock lck(m_csOwnIds);
- m_arOwnIds.insert(pOwn);
- }
-
JSONNode parts(JSON_ARRAY);
if (hReplyEvent) {
DB::EventInfo dbei(hReplyEvent);
@@ -570,10 +556,15 @@ int CIcqProto::SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszSrc
JSONNode msgText; msgText << CHAR_PARAM("mediaType", "text") << CHAR_PARAM("text", pszSrc);
parts.push_back(msgText);
-
- pReq << AIMSID(this) << CHAR_PARAM("a", m_szAToken) << CHAR_PARAM("k", appId()) << CHAR_PARAM("mentions", "")
- << CHAR_PARAM("offlineIM", "true") << CHAR_PARAM("parts", parts.write().c_str()) << CHAR_PARAM("t", szUserid) << INT_PARAM("ts", TS());
- Push(pReq);
+
+ int id = InterlockedIncrement(&m_msgId);
+ auto *pOwn = new IcqOwnMessage(hContact, id, pszSrc);
+ {
+ mir_cslock lck(m_csOwnIds);
+ m_arOwnIds.insert(pOwn);
+ }
+
+ SendMessageParts(hContact, parts, pOwn);
return id;
}