diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-29 17:27:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-29 17:27:08 +0300 |
commit | f16cf071e51f4768f20692c99414cb39521fa413 (patch) | |
tree | 7dd3cc512fe65fdd546f7753937261c518e5008c /protocols/SkypeWeb | |
parent | 939048b7ebce6a70c8e243fec36983de7d931e8b (diff) |
PROTO_INTERFACE::setAllContactStatuses - common code moved to the core
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_accounts.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 16 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 4 |
5 files changed, 2 insertions, 32 deletions
diff --git a/protocols/SkypeWeb/src/skype_accounts.cpp b/protocols/SkypeWeb/src/skype_accounts.cpp index 1e54acb021..f5c01b0c4f 100644 --- a/protocols/SkypeWeb/src/skype_accounts.cpp +++ b/protocols/SkypeWeb/src/skype_accounts.cpp @@ -51,7 +51,7 @@ CSkypeProto* CSkypeProto::GetContactAccount(MCONTACT hContact) int CSkypeProto::OnAccountLoaded(WPARAM, LPARAM)
{
- SetAllContactsStatus(ID_STATUS_OFFLINE);
+ setAllContactStatuses(ID_STATUS_OFFLINE, true);
HookProtoEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
HookProtoEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnPreCreateMessage);
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 9dbb8032a8..78ea23d170 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -32,22 +32,6 @@ void CSkypeProto::InitGroupChatModule() CreateProtoService(PS_LEAVECHAT, &CSkypeProto::OnLeaveChatRoom);
}
-void CSkypeProto::CloseAllChatChatSessions()
-{
- GC_INFO gci = { 0 };
- gci.Flags = GCF_BYINDEX | GCF_ID;
- gci.pszModule = m_szModuleName;
-
- int count = pci->SM_GetCount(m_szModuleName);
- for (int i = 0; i < count; i++) {
- gci.iItem = i;
- if (!Chat_GetInfo(&gci)) {
- Chat_Control(m_szModuleName, gci.pszID, SESSION_OFFLINE);
- Chat_Terminate(m_szModuleName, gci.pszID);
- }
- }
-}
-
MCONTACT CSkypeProto::FindChatRoom(const char *chatname)
{
SESSION_INFO *si = pci->SM_FindSession(_A2T(chatname), m_szModuleName);
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 58b7f8ea82..1ee5fbe0a3 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -32,16 +32,6 @@ void CSkypeProto::SetContactStatus(MCONTACT hContact, WORD status) }
}
-void CSkypeProto::SetAllContactsStatus(WORD status)
-{
- for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if (!isChatRoom(hContact))
- SetContactStatus(hContact, status);
- }
- if (status == ID_STATUS_OFFLINE)
- CloseAllChatChatSessions();
-}
-
void CSkypeProto::SetChatStatus(MCONTACT hContact, int iStatus)
{
ptrW tszChatID(getWStringA(hContact, "ChatRoomID"));
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 58406f4630..8535578bde 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -261,7 +261,7 @@ int CSkypeProto::SetStatus(int iNewStatus) ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, ID_STATUS_OFFLINE); if (!Miranda_IsTerminated()) - SetAllContactsStatus(ID_STATUS_OFFLINE); + setAllContactStatuses(ID_STATUS_OFFLINE, true); return 0; } else { diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index cc70467445..21a14c69c1 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -279,7 +279,6 @@ private: // contacts
WORD GetContactStatus(MCONTACT hContact);
void SetContactStatus(MCONTACT hContact, WORD status);
- void SetAllContactsStatus(WORD status);
void SetAvatarUrl(MCONTACT hContact, CMStringW &tszUrl);
void ReloadAvatarInfo(MCONTACT hContact);
@@ -325,15 +324,12 @@ private: // sync
void OnGetServerHistory(const NETLIBHTTPREQUEST *response);
void OnSyncHistory(const NETLIBHTTPREQUEST *response);
- void SyncHistory();
//chats
void InitGroupChatModule();
- void CloseAllChatChatSessions();
MCONTACT FindChatRoom(const char *chatname);
- MCONTACT AddChatRoom(const char *chatname);
int __cdecl OnGroupChatEventHook(WPARAM, LPARAM lParam);
int __cdecl OnGroupChatMenuHook(WPARAM, LPARAM lParam);
|