summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp16
-rw-r--r--protocols/SkypeWeb/src/skype_dialogs.cpp15
-rw-r--r--protocols/SkypeWeb/src/skype_dialogs.h4
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h2
4 files changed, 19 insertions, 18 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index 2c52918dce..353b6064ee 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -562,22 +562,10 @@ INT_PTR CSkypeProto::SvcCreateChat(WPARAM, LPARAM)
if (IsOnline())
{
CSkypeGCCreateDlg dlg(this);
- if (!dlg.DoModal())
- {
- return 1;
- }
- LIST<char>uids(1);
- for (std::vector<MCONTACT>::size_type i = 0; i < dlg.m_hContacts.size(); i++)
- {
- uids.insert(db_get_sa(dlg.m_hContacts[i], m_szModuleName, SKYPE_SETTINGS_ID));
- }
- uids.insert(getStringA(SKYPE_SETTINGS_ID));
+ if (!dlg.DoModal()) { return 1; }
- SendRequest(new CreateChatroomRequest(m_szRegToken, uids, ptrA(getStringA(SKYPE_SETTINGS_ID)), m_szServer));
+ SendRequest(new CreateChatroomRequest(m_szRegToken, dlg.m_ContactsList, ptrA(getStringA(SKYPE_SETTINGS_ID)), m_szServer));
- for (int i = 0; i < uids.getCount(); i++)
- mir_free(uids[i]);
- uids.destroy();
return 0;
}
return 1;
diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp
index 43834306c8..64a5aae03a 100644
--- a/protocols/SkypeWeb/src/skype_dialogs.cpp
+++ b/protocols/SkypeWeb/src/skype_dialogs.cpp
@@ -45,10 +45,16 @@ 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)
+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);
}
+CSkypeGCCreateDlg::~CSkypeGCCreateDlg()
+{
+ for (int i = 0; i < m_ContactsList.getCount(); i++)
+ mir_free(m_ContactsList[i]);
+ m_ContactsList.destroy();
+}
void CSkypeGCCreateDlg::OnInitDialog()
{
@@ -70,12 +76,15 @@ void CSkypeGCCreateDlg::btnOk_OnOk(CCtrlButton*)
{
if (m_clc.GetCheck(hItem))
{
- m_hContacts.push_back(hContact);
+ char *szName = db_get_sa(hContact, m_proto->m_szModuleName, SKYPE_SETTINGS_ID);
+ if (szName != NULL)
+ m_ContactsList.insert(szName);
}
}
}
}
- EndDialog(m_hwnd, 1);
+ m_ContactsList.insert(m_proto->m_szSelfSkypeName);
+ EndDialog(m_hwnd, m_ContactsList.getCount());
}
void CSkypeGCCreateDlg::FilterList(CCtrlClc *)
diff --git a/protocols/SkypeWeb/src/skype_dialogs.h b/protocols/SkypeWeb/src/skype_dialogs.h
index b07265ef1b..ab9c33f71c 100644
--- a/protocols/SkypeWeb/src/skype_dialogs.h
+++ b/protocols/SkypeWeb/src/skype_dialogs.h
@@ -57,8 +57,10 @@ protected:
public:
- std::vector<MCONTACT> m_hContacts;
+ LIST<char> m_ContactsList;
+
CSkypeGCCreateDlg(CSkypeProto *proto);
+ ~CSkypeGCCreateDlg();
};
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 1540ac4c8c..3a565b9df4 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -23,6 +23,8 @@ typedef void(CSkypeProto::*SkypeResponseWithArgCallback)(const NETLIBHTTPREQUEST
struct CSkypeProto : public PROTO < CSkypeProto >
{
+ friend CSkypeGCCreateDlg;
+
public:
//////////////////////////////////////////////////////////////////////////////////////