summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/ICQ-WIM/src/proto.cpp')
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp37
1 files changed, 10 insertions, 27 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 06e67ee280..ea9e7f21f9 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -159,13 +159,6 @@ void CIcqProto::OnBuildProtoMenu()
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUP);
m_hUploadGroups = Menu_AddProtoMenuItem(&mi, m_szModuleName);
- mi.pszService = "/EditIgnore";
- CreateProtoService(mi.pszService, &CIcqProto::EditIgnoreList);
- mi.name.a = LPGEN("Edit ignore list");
- mi.position++;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
- Menu_AddProtoMenuItem(&mi, m_szModuleName);
-
Menu_ShowItem(m_hUploadGroups, false);
}
@@ -201,19 +194,6 @@ INT_PTR CIcqProto::GotoInbox(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
-int CIcqProto::OnContactMenu(WPARAM hContact, LPARAM)
-{
- Menu_ShowItem(g_plugin.m_hmiRoot, true);
- Menu_ModifyItem(g_plugin.m_hmiRoot, nullptr, Skin_GetProtoIcon(GetContactProto(hContact), ID_STATUS_ONLINE));
-
- bool bIgnorable = getDword(hContact, "ApparentMode") != ID_STATUS_OFFLINE;
- Menu_ShowItem(g_plugin.m_hmiAllow, !bIgnorable);
- Menu_ShowItem(g_plugin.m_hmiIgnore, bIgnorable);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
void CIcqProto::MarkReadTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD)
{
CIcqProto *ppro = (CIcqProto*)id;
@@ -225,8 +205,7 @@ void CIcqProto::MarkReadTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD)
auto *pReq = new AsyncHttpRequest(CONN_RAPI, REQUEST_POST, ICQ_ROBUST_SERVER);
JSONNode request, params; params.set_name("params");
params << WCHAR_PARAM("sn", ppro->GetUserId(pUser->m_hContact)) << INT64_PARAM("lastRead", ppro->getId(pUser->m_hContact, DB_KEY_LASTMSGID));
- request << CHAR_PARAM("method", "setDlgStateWim") << CHAR_PARAM("reqId", pReq->m_reqId)
- << CHAR_PARAM("authToken", ppro->m_szRToken) << INT_PARAM("clientId", ppro->m_iRClientId) << params;
+ request << CHAR_PARAM("method", "setDlgStateWim") << CHAR_PARAM("reqId", pReq->m_reqId) << params;
pReq->m_szParam = ptrW(json_write(&request));
ppro->Push(pReq);
@@ -327,7 +306,7 @@ INT_PTR CIcqProto::GetCaps(int type, MCONTACT)
switch (type) {
case PFLAGNUM_1:
nReturn = PF1_IM | PF1_AUTHREQ | PF1_BASICSEARCH | PF1_ADDSEARCHRES | /*PF1_SEARCHBYNAME | TODO */
- PF1_VISLIST | PF1_INVISLIST | PF1_MODEMSG | PF1_FILE | PF1_CONTACT | PF1_SERVERCLIST;
+ PF1_VISLIST | PF1_MODEMSG | PF1_FILE | PF1_CONTACT | PF1_SERVERCLIST;
break;
case PFLAGNUM_2:
@@ -368,8 +347,7 @@ HANDLE CIcqProto::SearchBasic(const wchar_t *pszSearch)
JSONNode request, params; params.set_name("params");
params << WCHAR_PARAM("keyword", pszSearch);
- request << CHAR_PARAM("method", "search") << CHAR_PARAM("reqId", pReq->m_reqId) << CHAR_PARAM("authToken", m_szRToken)
- << INT_PARAM("clientId", m_iRClientId) << params;
+ request << CHAR_PARAM("method", "search") << CHAR_PARAM("reqId", pReq->m_reqId) << params;
pReq->m_szParam = ptrW(json_write(&request));
Push(pReq);
return pReq;
@@ -523,7 +501,12 @@ int CIcqProto::UserIsTyping(MCONTACT hContact, int type)
////////////////////////////////////////////////////////////////////////////////////////
// PS_SetApparentMode - sets the visibility status
-int CIcqProto::SetApparentMode(MCONTACT, int)
+int CIcqProto::SetApparentMode(MCONTACT hContact, int iMode)
{
- return 1; // Failure
+ int oldMode = getWord(hContact, "ApparentMode");
+ if (oldMode != iMode) {
+ setWord(hContact, "ApparentMode", iMode);
+ SetPermitDeny(GetUserId(hContact), iMode != ID_STATUS_OFFLINE);
+ }
+ return 0;
}