summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-29 17:03:21 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-29 17:03:21 +0300
commit9536e0bb47b12ea2ae01ab070dd9f6aa5bb360c2 (patch)
treea6663fa7d5aa9afcb51fe1b914e457acdcf5fa8f /protocols
parent28535b12d00c1ccfa98250dd2c7e87402545adba (diff)
fixes #4085 (Удалить настройки невидимости)
Diffstat (limited to 'protocols')
-rw-r--r--protocols/EmLanProto/src/amdproto.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp11
-rw-r--r--protocols/Gadu-Gadu/src/gg.h1
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp13
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h1
-rw-r--r--protocols/ICQ-WIM/src/ignore.cpp12
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp15
-rw-r--r--protocols/ICQ-WIM/src/proto.h1
-rw-r--r--protocols/ICQCorp/src/protocol.cpp75
-rw-r--r--protocols/ICQCorp/src/protocol.h2
-rw-r--r--protocols/ICQCorp/src/services.cpp29
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp41
-rw-r--r--protocols/JabberG/src/jabber_proto.h1
-rw-r--r--protocols/Weather/src/weather_svcs.cpp2
-rw-r--r--protocols/WebView/src/webview_services.cpp2
15 files changed, 9 insertions, 199 deletions
diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp
index bc4d7655f1..215f02a24b 100644
--- a/protocols/EmLanProto/src/amdproto.cpp
+++ b/protocols/EmLanProto/src/amdproto.cpp
@@ -63,7 +63,7 @@ static INT_PTR __cdecl EMPGetCaps(WPARAM wParam, LPARAM)
{
switch (wParam) {
case PFLAGNUM_1:
- return PF1_IM | PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_PEER2PEER | PF1_INDIVSTATUS |
+ return PF1_IM | PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_PEER2PEER |
PF1_MODEMSG | PF1_FILE | PF1_CANRENAMEFILE | PF1_FILERESUME;
case PFLAGNUM_2:
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT;
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index b7c506df0b..dd2271de69 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -1350,12 +1350,10 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh)
if (!hContact)
return;
- if (isonline() && (uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0)))
- {
+ if (isonline() && (uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0))) {
// Check if user should be invisible
// Or be blocked ?
- if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact::OnList(hContact))
- {
+ if (!Contact::OnList(hContact)) {
gg_EnterCriticalSection(&sess_mutex, "notifyuser", 77, "sess_mutex", 1);
if (refresh) {
gg_remove_notify_ex(m_sess, uin, GG_USER_NORMAL);
@@ -1365,8 +1363,7 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh)
gg_add_notify_ex(m_sess, uin, GG_USER_OFFLINE);
gg_LeaveCriticalSection(&sess_mutex, "notifyuser", 77, 1, "sess_mutex", 1);
}
- else if (getByte(hContact, GG_KEY_BLOCK, 0))
- {
+ else if (getByte(hContact, GG_KEY_BLOCK, 0)) {
gg_EnterCriticalSection(&sess_mutex, "notifyuser", 78, "sess_mutex", 1);
if (refresh)
gg_remove_notify_ex(m_sess, uin, GG_USER_OFFLINE);
@@ -1409,7 +1406,7 @@ void GaduProto::notifyall()
int cc = 0;
for (auto &hContact : AccContacts()) {
if (uins[cc] = getDword(hContact, GG_KEY_UIN, 0)) {
- if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact::OnList(hContact))
+ if (!Contact::OnList(hContact))
types[cc] = GG_USER_OFFLINE;
else if (getByte(hContact, GG_KEY_BLOCK, 0))
types[cc] = GG_USER_BLOCKED;
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h
index 757feeda92..301d3fdb2e 100644
--- a/protocols/Gadu-Gadu/src/gg.h
+++ b/protocols/Gadu-Gadu/src/gg.h
@@ -230,7 +230,6 @@ struct GGGETAVATARDATA
#define GG_KEYDEF_GC_POLICY_DEFAULT 0
#define GG_KEY_BLOCK "Block" // Contact is blocked
-#define GG_KEY_APPARENT "ApparentMode" // Visible list
#define GG_KEY_TIMEDEVIATION "TimeDeviation" // Max time deviation for connections (seconds)
#define GG_KEYDEF_TIMEDEVIATION 300
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 856ce81228..a083507708 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -155,7 +155,7 @@ INT_PTR GaduProto::GetCaps(int type, MCONTACT)
switch (type) {
case PFLAGNUM_1:
return PF1_IM | PF1_BASICSEARCH | PF1_EXTSEARCH | PF1_EXTSEARCHUI | PF1_SEARCHBYNAME |
- PF1_MODEMSG | PF1_NUMERICUSERID | PF1_VISLIST | PF1_FILE;
+ PF1_MODEMSG | PF1_NUMERICUSERID | PF1_FILE;
case PFLAGNUM_2:
return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT | PF2_INVISIBLE |
PF2_LONGAWAY;
@@ -527,17 +527,6 @@ int GaduProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
}
//////////////////////////////////////////////////////////
-// visible lists
-//
-int GaduProto::SetApparentMode(MCONTACT hContact, int mode)
-{
- setWord(hContact, GG_KEY_APPARENT, (uint16_t)mode);
- notifyuser(hContact, 1);
-
- return 0;
-}
-
-//////////////////////////////////////////////////////////
// sets protocol status
//
int GaduProto::SetStatus(int iNewStatus)
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index 75da3bc4f1..f7387f789c 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -48,7 +48,6 @@ struct GaduProto : public PROTO<GaduProto>
HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override;
int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char* msg) override;
- int SetApparentMode(MCONTACT hContact, int mode) override;
int SetStatus(int iNewStatus) override;
HANDLE GetAwayMsg(MCONTACT hContact) override;
diff --git a/protocols/ICQ-WIM/src/ignore.cpp b/protocols/ICQ-WIM/src/ignore.cpp
index a7b6cfe66b..6dd86c51fb 100644
--- a/protocols/ICQ-WIM/src/ignore.cpp
+++ b/protocols/ICQ-WIM/src/ignore.cpp
@@ -58,18 +58,6 @@ void CIcqProto::ProcessPermissions(const JSONNode &ev)
Contact::Hide(p->m_hContact);
m_bIgnoreListEmpty = false;
}
-
- { mir_cslock lck(m_csCache);
- for (auto &it : m_arCache) {
- int oldMode = getDword(it->m_hContact, "ApparentMode");
- if (oldMode != it->m_iApparentMode) {
- if (it->m_iApparentMode == 0)
- delSetting(it->m_hContact, "ApparentMode");
- else
- setDword(it->m_hContact, "ApparentMode", it->m_iApparentMode);
- }
- }
- }
}
void CIcqProto::SetPermitDeny(const CMStringW &userId, bool bAllow)
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index dea367270c..68567975b1 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -491,7 +491,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_FILE | PF1_CONTACT | PF1_SERVERCLIST;
+ PF1_FILE | PF1_CONTACT | PF1_SERVERCLIST;
break;
case PFLAGNUM_2:
@@ -668,16 +668,3 @@ int CIcqProto::UserIsTyping(MCONTACT hContact, int type)
<< AIMSID(this) << WCHAR_PARAM("t", GetUserId(hContact)) << CHAR_PARAM("typingStatus", (type == PROTOTYPE_SELFTYPING_ON) ? "typing" : "typed"));
return 0;
}
-
-////////////////////////////////////////////////////////////////////////////////////////
-// PS_SetApparentMode - sets the visibility status
-
-int CIcqProto::SetApparentMode(MCONTACT hContact, int iMode)
-{
- int oldMode = getWord(hContact, "ApparentMode");
- if (oldMode != iMode) {
- setWord(hContact, "ApparentMode", iMode);
- SetPermitDeny(GetUserId(hContact), iMode != ID_STATUS_OFFLINE);
- }
- return 0;
-}
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index c0339b38aa..44def39b16 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -435,7 +435,6 @@ class CIcqProto : public PROTO<CIcqProto>
HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *msg) override;
- int SetApparentMode(MCONTACT hContact, int mode) override;
int SetStatus(int iNewStatus) override;
int UserIsTyping(MCONTACT hContact, int type) override;
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp
index bdbf79bce3..cb24b1ddf4 100644
--- a/protocols/ICQCorp/src/protocol.cpp
+++ b/protocols/ICQCorp/src/protocol.cpp
@@ -1151,81 +1151,6 @@ void ICQ::updateContactList()
///////////////////////////////////////////////////////////////////////////////
-void ICQ::sendVisibleList()
-{
- /*
- unsigned int i, numUsers = 0;
- ICQUser *u;
-
- if (statusVal != ID_STATUS_INVISIBLE) return;
-
- Packet userPacket;
- userPacket << ICQ_VERSION
- << ICQ_CMDxSND_VISxLIST
- << sequenceVal
- << sequenceVal
- << uin
- << (unsigned int)0x00;
-
- for (i=0; i<icqUsers.size(); i++)
- {
- u = icqUsers[i];
- if (u->statusVal != ID_STATUS_OFFLINE && g_plugin.getWord(u->hContact, "ApparentMode") == ID_STATUS_ONLINE)
- numUsers++;
- }
-
- if (numUsers == 0) return;
- userPacket << (char)numUsers;
-
- for (i=0; i<icqUsers.size(); i++)
- {
- u = icqUsers[i];
- if (u->statusVal != ID_STATUS_OFFLINE && g_plugin.getWord(u->hContact, "ApparentMode") == ID_STATUS_ONLINE)
- userPacket << icqUsers[i]->uin;
- }
-
- Netlib_Logf(hNetlibUser, "[udp] sending visible list (%d)\n", sequenceVal);
- sendICQ(udpSocket, userPacket, ICQ_CMDxSND_VISxLIST, sequenceVal);
- */
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-void ICQ::sendInvisibleList()
-{
- /*
- unsigned int i, numUsers = 0;
-
- Packet userPacket;
- userPacket << ICQ_VERSION
- << ICQ_CMDxSND_INVISxLIST
- << sequenceVal
- << sequenceVal
- << uin
- << (unsigned int)0x00;
-
- for (i=0; i<icqUsers.size(); i++)
- {
- if (g_plugin.getWord(icqUsers[i]->hContact, "ApparentMode") == ID_STATUS_OFFLINE)
- numUsers++;
- }
-
- if (numUsers == 0) return;
- userPacket << (char)numUsers;
-
- for (i=0; i<icqUsers.size(); i++)
- {
- if (g_plugin.getWord(icqUsers[i]->hContact, "ApparentMode") == ID_STATUS_OFFLINE)
- userPacket << icqUsers[i]->uin;
- }
-
- Netlib_Logf(hNetlibUser, "[udp] sending invisible list (%d)\n", sequenceVal);
- sendICQ(udpSocket, userPacket, ICQ_CMDxSND_INVISxLIST, sequenceVal);
- */
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
void ICQ::updateUserList(ICQUser* /*u*/, char /*list*/, char /*add*/)
{
/*
diff --git a/protocols/ICQCorp/src/protocol.h b/protocols/ICQCorp/src/protocol.h
index 4e23d7781c..ef1adf9ad6 100644
--- a/protocols/ICQCorp/src/protocol.h
+++ b/protocols/ICQCorp/src/protocol.h
@@ -165,8 +165,6 @@ public:
void requestSystemMsg();
void requestBroadcastMsg();
void updateContactList();
- void sendVisibleList();
- void sendInvisibleList();
void updateUserList(ICQUser *u, char list, char add);
void processSystemMessage(Packet &packet, unsigned long checkUin, unsigned short newCommand, time_t timeSent);
void ackSYS(unsigned int timeStamp);
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp
index 253dfb3e42..90a79b090f 100644
--- a/protocols/ICQCorp/src/services.cpp
+++ b/protocols/ICQCorp/src/services.cpp
@@ -392,34 +392,6 @@ static INT_PTR icqFileResume(WPARAM wParam, LPARAM lParam)
///////////////////////////////////////////////////////////////////////////////
-static INT_PTR icqSetApparentMode(WPARAM, LPARAM)
-{
- /*
- CCSDATA *ccs = (CCSDATA *)lParam;
- int oldMode, newMode = ccs->wParam;
- ICQUser *u;
-
- u = icq.getUserByContact(ccs->hContact);
- if (u == NULL) return 1;
-
- oldMode = db_get_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", 0);
- if (newMode == oldMode) return 1;
-
- Netlib_Logf(hNetlibUser, "[ ] set apparent mode\n");
-
- if (newMode == ID_STATUS_ONLINE || newMode == ID_STATUS_OFFLINE) db_set_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", (uint16_t)newMode);
- else db_unset(u->hContact, ICQCORP_PROTONAME, "ApparentMode");
-
- if (icq.statusVal <= ID_STATUS_OFFLINE) return 0;
-
- if (oldMode != 0) icq.updateUserList(u, oldMode == ID_STATUS_OFFLINE ? 1 : 2, 0);
- if (newMode != 0) icq.updateUserList(u, newMode == ID_STATUS_OFFLINE ? 1 : 2, 1);
- */
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
static int icqContactDeleted(WPARAM hContact, LPARAM)
{
Netlib_Logf(hNetlibUser, "[ ] contact deleted\n");
@@ -469,7 +441,6 @@ int LoadServices()
CreateProtoServiceFunction(protoName, PSS_FILEALLOW, icqFileAllow);
CreateProtoServiceFunction(protoName, PSS_FILEDENY, icqFileDeny);
CreateProtoServiceFunction(protoName, PSS_FILECANCEL, icqFileCancel);
- CreateProtoServiceFunction(protoName, PSS_SETAPPARENTMODE, icqSetApparentMode);
CreateProtoServiceFunction(protoName, PSR_MESSAGE, icqRecvMessage);
CreateProtoServiceFunction(protoName, PSR_AWAYMSG, icqRecvAwayMsg);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 63009c39fc..5eda5e8ff9 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -984,47 +984,6 @@ int CJabberProto::SendMsgEx(MCONTACT hContact, const char *pszSrc, XmlNode &m)
}
////////////////////////////////////////////////////////////////////////////////////////
-// rSetApparentMode - sets the visibility status
-
-int CJabberProto::SetApparentMode(MCONTACT hContact, int mode)
-{
- if (mode != 0 && mode != ID_STATUS_ONLINE && mode != ID_STATUS_OFFLINE)
- return 1;
-
- int oldMode = getWord(hContact, "ApparentMode", 0);
- if (mode == oldMode)
- return 1;
-
- setWord(hContact, "ApparentMode", (uint16_t)mode);
- if (!m_bJabberOnline)
- return 0;
-
- ptrA jid(getUStringA(hContact, "jid"));
- if (jid == nullptr)
- return 0;
-
- switch (mode) {
- case ID_STATUS_ONLINE:
- if (m_iStatus == ID_STATUS_INVISIBLE || oldMode == ID_STATUS_OFFLINE)
- m_ThreadInfo->send(XmlNode("presence") << XATTR("to", jid));
- break;
- case ID_STATUS_OFFLINE:
- if (m_iStatus != ID_STATUS_INVISIBLE || oldMode == ID_STATUS_ONLINE)
- SendPresenceTo(ID_STATUS_INVISIBLE, jid);
- break;
- case 0:
- if (oldMode == ID_STATUS_ONLINE && m_iStatus == ID_STATUS_INVISIBLE)
- SendPresenceTo(ID_STATUS_INVISIBLE, jid);
- else if (oldMode == ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_INVISIBLE)
- SendPresenceTo(m_iStatus, jid);
- break;
- }
-
- // TODO: update the zebra list (jabber:iq:privacy)
- return 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
// JabberSetStatus - sets the protocol status
int CJabberProto::SetStatus(int iNewStatus)
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 54359d8d8c..824ad6c929 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -141,7 +141,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
int SendMsg(MCONTACT hContact, MEVENT, const char *msg) override;
int SendMsgEx(MCONTACT hContact, const char *msg, XmlNode &m);
- int SetApparentMode(MCONTACT hContact, int mode) override;
int SetStatus(int iNewStatus) override;
HANDLE GetAwayMsg(MCONTACT hContact) override;
diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp
index c8307ba99a..757e243910 100644
--- a/protocols/Weather/src/weather_svcs.cpp
+++ b/protocols/Weather/src/weather_svcs.cpp
@@ -59,7 +59,7 @@ INT_PTR WeatherGetCaps(WPARAM wParam, LPARAM)
switch (wParam) {
case PFLAGNUM_1:
// support search and visible list
- ret = PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_EXTSEARCH | PF1_VISLIST | PF1_MODEMSGRECV;
+ ret = PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_EXTSEARCH | PF1_MODEMSGRECV;
break;
case PFLAGNUM_2:
diff --git a/protocols/WebView/src/webview_services.cpp b/protocols/WebView/src/webview_services.cpp
index 2eef900ee9..bbc7fb457f 100644
--- a/protocols/WebView/src/webview_services.cpp
+++ b/protocols/WebView/src/webview_services.cpp
@@ -199,7 +199,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM)
{
switch (wParam) {
case PFLAGNUM_1:
- return PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_VISLIST;
+ return PF1_BASICSEARCH | PF1_ADDSEARCHRES;
case PFLAGNUM_2:
return g_plugin.getByte(HIDE_STATUS_ICON_KEY, 0) ? 0 : (PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND);
case PFLAGNUM_3: