summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-29 17:27:00 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-29 17:27:08 +0300
commitf16cf071e51f4768f20692c99414cb39521fa413 (patch)
tree7dd3cc512fe65fdd546f7753937261c518e5008c /protocols/Discord/src
parent939048b7ebce6a70c8e243fec36983de7d931e8b (diff)
PROTO_INTERFACE::setAllContactStatuses - common code moved to the core
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/connection.cpp2
-rw-r--r--protocols/Discord/src/proto.cpp2
-rw-r--r--protocols/Discord/src/proto.h1
-rw-r--r--protocols/Discord/src/utils.cpp10
4 files changed, 2 insertions, 13 deletions
diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp
index 5d8f9677e2..9c3c36da40 100644
--- a/protocols/Discord/src/connection.cpp
+++ b/protocols/Discord/src/connection.cpp
@@ -87,7 +87,7 @@ void CDiscordProto::OnLoggedOut()
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, ID_STATUS_OFFLINE);
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- SetAllContactStatuses(ID_STATUS_OFFLINE);
+ setAllContactStatuses(ID_STATUS_OFFLINE, true);
}
void CDiscordProto::ShutdownSession()
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index e937ade657..fc935e20d0 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -148,7 +148,7 @@ int CDiscordProto::SetStatus(int iNewStatus)
ShutdownSession();
}
m_iStatus = m_iDesiredStatus;
- SetAllContactStatuses(ID_STATUS_OFFLINE);
+ setAllContactStatuses(ID_STATUS_OFFLINE, true);
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus);
}
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index 5970ce26d3..c701a7b98a 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -132,7 +132,6 @@ class CDiscordProto : public PROTO<CDiscordProto>
//////////////////////////////////////////////////////////////////////////////////////
// session control
- void SetAllContactStatuses(int iStatus);
void ConnectionFailed(int iReason);
void ShutdownSession(void);
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index 0b37e53167..6e6d9700a7 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -17,16 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-void CDiscordProto::SetAllContactStatuses(int status)
-{
- for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if (!getByte(hContact, "ChatRoom"))
- setWord(hContact, "Status", (WORD)status);
- else if (status == ID_STATUS_OFFLINE)
- Chat_Terminate(m_szModuleName, ptrW(getWStringA(hContact, "ChatRoomID")));
- }
-}
-
int StrToStatus(const CMStringW &str)
{
if (str == L"idle")