summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp17
-rw-r--r--protocols/SkypeWeb/src/skype_dialogs.cpp19
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h7
4 files changed, 36 insertions, 11 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index 353b6064ee..839a1191d0 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -179,16 +179,19 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam)
{
case 10: {
CSkypeInviteDlg dlg(this);
- if(!dlg.DoModal())
- {
- break;
- }
+
+ { mir_cslock lck(m_InviteDialogsLock); m_InviteDialogs.insert(&dlg); }
+
+ if(!dlg.DoModal()) break;
MCONTACT hContact = dlg.m_hContact;
if (hContact != NULL)
{
ptrA username(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID));
SendRequest(new InviteUserToChatRequest(m_szRegToken, chat_id, username, "User", m_szServer));
}
+
+ { mir_cslock lck(m_InviteDialogsLock); m_InviteDialogs.remove(&dlg); }
+
break;
}
case 20:
@@ -562,10 +565,14 @@ INT_PTR CSkypeProto::SvcCreateChat(WPARAM, LPARAM)
if (IsOnline())
{
CSkypeGCCreateDlg dlg(this);
+
+ { mir_cslock lck(m_GCCreateDialogsLock); m_GCCreateDialogs.insert(&dlg); }
+
if (!dlg.DoModal()) { return 1; }
SendRequest(new CreateChatroomRequest(m_szRegToken, dlg.m_ContactsList, ptrA(getStringA(SKYPE_SETTINGS_ID)), m_szServer));
-
+
+ { mir_cslock lck(m_GCCreateDialogsLock); m_GCCreateDialogs.remove(&dlg); }
return 0;
}
return 1;
diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp
index 64a5aae03a..9cf2c4f2ec 100644
--- a/protocols/SkypeWeb/src/skype_dialogs.cpp
+++ b/protocols/SkypeWeb/src/skype_dialogs.cpp
@@ -17,8 +17,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-//CSkypeInvideDlg
+void CSkypeProto::CloseDialogs()
+{
+ {
+ mir_cslock lck(m_GCCreateDialogsLock);
+ for (int i = 0; i < m_GCCreateDialogs.getCount(); i++)
+ m_GCCreateDialogs[i]->Close();
+ }
+
+ {
+ mir_cslock lck(m_InviteDialogsLock);
+ for (int i = 0; i < m_InviteDialogs.getCount(); i++)
+ m_InviteDialogs[i]->Close();
+ }
+}
+//CSkypeInvideDlg
CSkypeInviteDlg::CSkypeInviteDlg(CSkypeProto *proto) :
CSkypeDlgBase(proto, IDD_GC_INVITE, false), m_ok(this, IDOK), m_cancel(this, IDCANCEL), m_combo(this, IDC_CONTACT)
{
@@ -43,9 +57,8 @@ void CSkypeInviteDlg::btnOk_OnOk(CCtrlButton*)
}
//CSkypeGCCreateDlg
-
CSkypeGCCreateDlg::CSkypeGCCreateDlg(CSkypeProto *proto) :
-CSkypeDlgBase(proto, IDD_GC_CREATE, false), m_ok(this, IDOK), m_cancel(this, IDCANCEL), m_clc(this, IDC_CLIST), m_ContactsList(1)
+ CSkypeDlgBase(proto, IDD_GC_CREATE, false), m_ok(this, IDOK), m_cancel(this, IDCANCEL), m_clc(this, IDC_CLIST), m_ContactsList(1)
{
m_ok.OnClick = Callback(this, &CSkypeGCCreateDlg::btnOk_OnOk);
}
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index fc2cbfecd4..78b44fe2e2 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) :
-PROTO<CSkypeProto>(protoName, userName), m_PopupClasses(1)
+ PROTO<CSkypeProto>(protoName, userName), m_PopupClasses(1), m_InviteDialogs(1), m_GCCreateDialogs(1)
{
m_hProtoIcon = Icons[0].Handle;
@@ -243,7 +243,7 @@ int CSkypeProto::SetStatus(int iNewStatus)
delSetting("expires");
}
requestQueue->Stop();
-
+ CloseDialogs();
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, ID_STATUS_OFFLINE);
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 3a565b9df4..876b51e655 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -100,8 +100,12 @@ private:
TRInfo TRouter;
- LIST <void> m_PopupClasses;
+ LIST<void> m_PopupClasses;
+ LIST<CSkypeInviteDlg> m_InviteDialogs;
+ LIST<CSkypeGCCreateDlg> m_GCCreateDialogs;
+ mir_cs m_InviteDialogsLock;
+ mir_cs m_GCCreateDialogsLock;
// accounts
ptrA m_szServer,
@@ -314,6 +318,7 @@ private:
time_t GetLastMessageTime(MCONTACT hContact);
CMString RunConfirmationCode();
CMString ChangeTopicForm();
+ void CloseDialogs();
//events
void InitDBEvents();
int __cdecl ProcessSrmmEvent(WPARAM, LPARAM);