summaryrefslogtreecommitdiff
path: root/protocols/Icq10/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-28 20:28:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-28 20:28:13 +0300
commit0c508d74bee722c4d0032b33377a1305b484027a (patch)
tree224be76126cb0e208843f818deb5a6c6cdba1761 /protocols/Icq10/src/server.cpp
parent34ff0a2b21a357f80e798940df9ce887dcf1e185 (diff)
obsolte perversion with PF4_INFOSETTINGSVC removed
Diffstat (limited to 'protocols/Icq10/src/server.cpp')
-rw-r--r--protocols/Icq10/src/server.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp
index d2d84e39b9..e7c49a7e04 100644
--- a/protocols/Icq10/src/server.cpp
+++ b/protocols/Icq10/src/server.cpp
@@ -173,6 +173,24 @@ void CIcqProto::RetrieveUserInfo(MCONTACT hContact)
void CIcqProto::SetServerStatus(int iStatus)
{
+ const char *szStatus = "online";
+ int invisible = 0;
+
+ switch (iStatus) {
+ case ID_STATUS_OFFLINE: szStatus = "offline"; break;
+ case ID_STATUS_NA: szStatus = "occupied"; break;
+ case ID_STATUS_AWAY:
+ case ID_STATUS_DND: szStatus = "away"; break;
+ case ID_STATUS_INVISIBLE:
+ invisible = 1;
+ }
+
+ auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, ICQ_API_SERVER "/presence/setState");
+ pReq->flags |= NLHRF_NODUMPSEND;
+ pReq << CHAR_PARAM("f", "json") << CHAR_PARAM("aimsid", m_aimsid) << CHAR_PARAM("r", pReq->m_reqId)
+ << CHAR_PARAM("view", szStatus) << INT_PARAM("invisible", invisible);
+ Push(pReq);
+
int iOldStatus = m_iStatus; m_iStatus = iStatus;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus);
}