summaryrefslogtreecommitdiff
path: root/protocols/Skype
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype')
-rw-r--r--protocols/Skype/res/Resource.rc41
-rw-r--r--protocols/Skype/src/resource.h7
-rw-r--r--protocols/Skype/src/skype_chat.cpp85
-rw-r--r--protocols/Skype/src/skype_chat.h6
-rw-r--r--protocols/Skype/src/skype_menus.cpp2
-rw-r--r--protocols/Skype/src/skype_proto.h31
6 files changed, 128 insertions, 44 deletions
diff --git a/protocols/Skype/res/Resource.rc b/protocols/Skype/res/Resource.rc
index 8e4fc6c378..5aee137c79 100644
--- a/protocols/Skype/res/Resource.rc
+++ b/protocols/Skype/res/Resource.rc
@@ -41,7 +41,7 @@ END
IDD_CHATROOM_CREATE DIALOGEX 0, 0, 377, 229
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOPMOST
-CAPTION "Create Conference"
+CAPTION "Create conference"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Skype name:",IDC_STATIC,6,201,43,9
@@ -50,20 +50,20 @@ BEGIN
CONTROL "",IDC_CCLIST,"CListControl",WS_TABSTOP | 0x16f,7,4,174,192,WS_EX_CLIENTEDGE
EDITTEXT IDC_EDITSCR,6,211,121,12,ES_AUTOHSCROLL
PUSHBUTTON "Add",IDC_ADDSCR,132,209,49,14
- LTEXT "Topic:",IDC_STATIC,188,4,20,8
+ LTEXT "Topic:",IDC_STATIC,188,4,180,8
EDITTEXT IDC_CHAT_TOPIC,188,14,180,14,ES_AUTOHSCROLL
- LTEXT "Guidline:",IDC_STATIC,188,31,28,8
+ LTEXT "Guidline:",IDC_STATIC,188,31,180,8
EDITTEXT IDC_CHAT_GUIDLINE,188,41,180,14,ES_AUTOHSCROLL
- CONTROL "Enable joining",IDC_CHAT_JOINING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,58,60,10
- LTEXT "User joining as:",IDC_STATIC,197,71,50,8
- COMBOBOX IDC_ROLES,198,82,170,30,CBS_DROPDOWN | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
- CONTROL "Create with password",IDC_CHAT_SECURED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,97,86,10
- LTEXT "Password:",IDC_STATIC,197,110,34,8
- EDITTEXT IDC_EDIT1,198,121,170,14,ES_PASSWORD | ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "Confirmation:",IDC_STATIC,197,138,44,8
- EDITTEXT IDC_EDIT2,198,149,170,14,ES_PASSWORD | ES_AUTOHSCROLL | WS_DISABLED
- LTEXT "Password hint:",IDC_STATIC,198,165,48,8
- EDITTEXT IDC_EDIT3,198,176,170,14,ES_AUTOHSCROLL | WS_DISABLED
+ CONTROL "Enable joining",IDC_CHAT_JOINING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,58,180,10
+ LTEXT "User joining as:",IDC_STATIC,188,73,79,8
+ COMBOBOX IDC_CHAT_ROLES,271,71,97,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Create with password",IDC_CHAT_SECURED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,88,180,10
+ LTEXT "Password:",IDC_STATIC,197,101,171,8
+ EDITTEXT IDC_CHAT_PASSWORD,198,112,170,14,ES_PASSWORD | ES_AUTOHSCROLL | WS_DISABLED
+ LTEXT "Confirmation:",IDC_STATIC,197,129,171,8
+ EDITTEXT IDC_CHAT_CONFIRMATION,198,140,170,14,ES_PASSWORD | ES_AUTOHSCROLL | WS_DISABLED
+ LTEXT "Password hint:",IDC_STATIC,198,156,170,8
+ EDITTEXT IDC_CHAT_HINT,198,167,170,14,ES_AUTOHSCROLL | WS_DISABLED
END
@@ -82,7 +82,7 @@ BEGIN
BOTTOMMARGIN, 173
END
- "IDD_CHATROOM_CREATE", DIALOG
+ IDD_CHATROOM_CREATE, DIALOG
BEGIN
RIGHTMARGIN, 375
VERTGUIDE, 7
@@ -303,21 +303,21 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- GROUPBOX "User Details",IDC_STATIC,7,7,291,60
- LTEXT "Skype login:",IDC_STATIC,15,19,63,8
+ GROUPBOX "Account",IDC_STATIC,7,7,291,60
+ LTEXT "Skype name:",IDC_STATIC,15,19,57,8
EDITTEXT IDC_SL,78,17,121,13,ES_AUTOHSCROLL
- LTEXT "Password:",IDC_STATIC,15,35,63,8
+ LTEXT "Password:",IDC_STATIC,15,35,57,8
EDITTEXT IDC_PW,78,33,121,13,ES_PASSWORD | ES_AUTOHSCROLL
GROUPBOX "Connection",IDC_STATIC,7,69,291,47
- LTEXT "Use port",IDC_STATIC,15,81,44,8
+ LTEXT "Use port",IDC_STATIC,15,81,57,8
EDITTEXT IDC_PORT,78,79,30,14,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "for incoming connections",IDC_STATIC,115,81,176,8
CONTROL "Use ports 80 and 443 as alternative incoming",IDC_USE_ALT_PORTS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,97,276,10
PUSHBUTTON "Register new account",IDC_REGISTER,204,17,87,14,WS_DISABLED
PUSHBUTTON "Change password",IDC_CHANGE_PWD,204,33,87,14,WS_DISABLED
- EDITTEXT IDC_GROUP,90,120,104,14,ES_AUTOHSCROLL
- LTEXT "Default group:",IDC_STATIC,15,121,63,8
+ EDITTEXT IDC_GROUP,78,120,121,14,ES_AUTOHSCROLL
+ LTEXT "Default group:",IDC_STATIC,15,121,57,8
END
@@ -345,6 +345,7 @@ BEGIN
BEGIN
LEFTMARGIN, 7
VERTGUIDE, 15
+ VERTGUIDE, 72
VERTGUIDE, 78
VERTGUIDE, 108
VERTGUIDE, 115
diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h
index 94c55c218c..1362fb3da1 100644
--- a/protocols/Skype/src/resource.h
+++ b/protocols/Skype/src/resource.h
@@ -18,6 +18,7 @@
#define IDI_CONF_INVITE 109
#define IDI_CONF_SPAWN 110
#define IDI_SEND_CONTACTS 111
+#define IDD_CHATROOM_CREATE 111
#define IDC_CCLIST 173
#define IDC_EDITSCR 174
#define IDC_ADDSCR 175
@@ -67,17 +68,21 @@
#define IDC_CHAT_JOINING 1046
#define IDC_COMBO1 1047
#define IDC_ROLES 1047
+#define IDC_CHAT_ROLES 1047
#define IDC_CHAT_JOINING2 1048
#define IDC_CHAT_SECURED 1048
#define IDC_EDIT1 1049
+#define IDC_CHAT_PASSWORD 1049
#define IDC_EDIT2 1050
+#define IDC_CHAT_CONFIRMATION 1050
#define IDC_EDIT3 1051
+#define IDC_CHAT_HINT 1051
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 111
+#define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1052
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp
index 3e54c57399..e562e2a030 100644
--- a/protocols/Skype/src/skype_chat.cpp
+++ b/protocols/Skype/src/skype_chat.cpp
@@ -180,7 +180,7 @@ void ChatRoom::CreateChatSession(bool showWindow)
::CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
}
-void ChatRoom::Create(const StringList &invitedMembers, CSkypeProto *ppro, bool showWindow)
+void ChatRoom::Create(const StringList &invitedMembers, CSkypeProto *ppro, ChatRoomParam *param)
{
SEString data;
ChatRoom *room = NULL;
@@ -188,9 +188,19 @@ void ChatRoom::Create(const StringList &invitedMembers, CSkypeProto *ppro, bool
ConversationRef conversation;
if (ppro->CreateConference(conversation))
{
- conversation->SetOption(CConversation::P_OPT_JOINING_ENABLED, true);
- conversation->SetOption(CConversation::P_OPT_ENTRY_LEVEL_RANK, CParticipant::WRITER);
- conversation->SetOption(CConversation::P_OPT_DISCLOSE_HISTORY, true);
+ conversation->SetOption(Conversation::P_OPT_JOINING_ENABLED, param->enableJoining);
+ conversation->SetOption(Conversation::P_OPT_ENTRY_LEVEL_RANK, (Participant::RANK)param->joinRank);
+ conversation->SetOption(Conversation::P_OPT_DISCLOSE_HISTORY, true);
+ if (::wcslen(param->topic) > 0)
+ conversation->SetTopic((char *)ptrA(::mir_utf8encodeW(param->topic)));
+ if (::wcslen(param->guidline) > 0)
+ conversation->SetGuidelines((char *)ptrA(::mir_utf8encodeW(param->guidline)));
+ if (param->passwordProtection && ::wcslen(param->password) > 0)
+ {
+ conversation->SetPassword(
+ (char *)ptrA(::mir_utf8encodeW(param->password)),
+ (char *)ptrA(::mir_utf8encodeW(param->hint)));
+ }
SEStringList consumers;
for (size_t i = 0; i < invitedMembers.size(); i++)
@@ -852,9 +862,9 @@ void CSkypeProto::GetInvitedContacts(HANDLE hItem, HWND hwndList, StringList &ch
}
}
-INT_PTR CALLBACK CSkypeProto::InviteToChatProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK CSkypeProto::ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- InviteChatParam *param = (InviteChatParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ ChatRoomParam *param = (ChatRoomParam *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg)
{
@@ -862,7 +872,7 @@ INT_PTR CALLBACK CSkypeProto::InviteToChatProc(HWND hwndDlg, UINT msg, WPARAM wP
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- param = (InviteChatParam *)lParam;
+ param = (ChatRoomParam *)lParam;
{
HWND hwndClist = GetDlgItem(hwndDlg, IDC_CCLIST);
SetWindowLongPtr(hwndClist, GWL_STYLE, GetWindowLongPtr(hwndClist, GWL_STYLE) & ~CLS_HIDEOFFLINE);
@@ -873,6 +883,17 @@ INT_PTR CALLBACK CSkypeProto::InviteToChatProc(HWND hwndDlg, UINT msg, WPARAM wP
::EnableWindow(GetDlgItem(hwndDlg, IDC_ADDSCR), FALSE);
::EnableWindow(GetDlgItem(hwndDlg, IDC_CCLIST), FALSE);
}
+
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_JOINING, BM_SETCHECK, param->enableJoining, 0);
+ for (int i = 1; i < SIZEOF(ChatRoom::Roles) - 4; i++)
+ {
+ int nItem = ::SendMessage(::GetDlgItem(hwndDlg, IDC_CHAT_ROLES), CB_ADDSTRING, 0, (LPARAM)::TranslateW(ChatRoom::Roles[i]));
+
+ if (i == Participant::WRITER)
+ ::SendMessage(::GetDlgItem(hwndDlg, IDC_CHAT_ROLES), CB_SETCURSEL, nItem, 0);
+ }
+
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SECURED, BM_SETCHECK, param->passwordProtection, 0);
}
break;
@@ -928,6 +949,28 @@ INT_PTR CALLBACK CSkypeProto::InviteToChatProc(HWND hwndDlg, UINT msg, WPARAM wP
}
break;
+ case IDC_CHAT_SECURED:
+ {
+ BOOL enable = (BOOL)::IsDlgButtonChecked(hwndDlg, IDC_CHAT_SECURED);
+ ::EnableWindow(::GetDlgItem(hwndDlg, IDC_CHAT_PASSWORD), enable);
+ ::EnableWindow(::GetDlgItem(hwndDlg, IDC_CHAT_CONFIRMATION), enable);
+ ::EnableWindow(::GetDlgItem(hwndDlg, IDC_CHAT_HINT), enable);
+ }
+ break;
+
+ case IDC_CHAT_PASSWORD:
+ case IDC_CHAT_CONFIRMATION:
+ {
+ wchar_t pwd[32], cfn[32];
+ GetDlgItemText(hwndDlg, IDC_CHAT_PASSWORD, pwd, SIZEOF(pwd));
+ GetDlgItemText(hwndDlg, IDC_CHAT_CONFIRMATION, cfn, SIZEOF(cfn));
+
+ bool secured = (bool)::IsDlgButtonChecked(hwndDlg, IDC_CHAT_SECURED);
+
+ ::EnableWindow(::GetDlgItem(hwndDlg, IDOK), secured && ::wcscmp(pwd, cfn) == 0);
+ }
+ break;
+
case IDOK:
{
HWND hwndList = ::GetDlgItem(hwndDlg, IDC_CCLIST);
@@ -942,6 +985,20 @@ INT_PTR CALLBACK CSkypeProto::InviteToChatProc(HWND hwndDlg, UINT msg, WPARAM wP
}
else
param->ppro->ShowNotification(::TranslateT("You did not select any contact"));
+
+ GetDlgItemText(hwndDlg, IDC_CHAT_TOPIC, param->topic, SIZEOF(param->topic));
+ GetDlgItemText(hwndDlg, IDC_CHAT_GUIDLINE, param->guidline, SIZEOF(param->guidline));
+
+ param->enableJoining = (bool)::IsDlgButtonChecked(hwndDlg, IDC_CHAT_JOINING);
+ param->joinRank = ::SendMessage(::GetDlgItem(hwndDlg, IDC_CHAT_ROLES), CB_GETCURSEL, 0, 0) + 1;
+
+ param->passwordProtection = (bool)::IsDlgButtonChecked(hwndDlg, IDC_CHAT_SECURED);
+ if (param->passwordProtection)
+ {
+ GetDlgItemText(hwndDlg, IDC_CHAT_PASSWORD, param->password, SIZEOF(param->password));
+ GetDlgItemText(hwndDlg, IDC_CHAT_CONFIRMATION, param->confirmation, SIZEOF(param->confirmation));
+ GetDlgItemText(hwndDlg, IDC_CHAT_HINT, param->hint, SIZEOF(param->hint));
+ }
}
break;
@@ -982,10 +1039,10 @@ HANDLE CSkypeProto::GetChatRoomByCid(const wchar_t *cid)
void CSkypeProto::StartChat(StringList &invitedContacts)
{
- InviteChatParam *param = new InviteChatParam(NULL, invitedContacts, this);
+ ChatRoomParam *param = new ChatRoomParam(NULL, invitedContacts, this);
- if (::DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL, CSkypeProto::InviteToChatProc, (LPARAM)param) == IDOK && param->invitedContacts.size() > 0)
- ChatRoom::Create(param->invitedContacts, this, true);
+ if (::DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHATROOM_CREATE), NULL, CSkypeProto::ChatRoomProc, (LPARAM)param) == IDOK && param->invitedContacts.size() > 0)
+ ChatRoom::Create(param->invitedContacts, this, param);
delete param;
}
@@ -1008,9 +1065,9 @@ void CSkypeProto::InviteToChatRoom(HANDLE hContact)
if (room != NULL && gci.pszUsers != NULL)
{
StringList invitedContacts(_A2T(gci.pszUsers));
- InviteChatParam *param = new InviteChatParam(NULL, invitedContacts, this);
+ ChatRoomParam *param = new ChatRoomParam(NULL, invitedContacts, this);
- if (::DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL, CSkypeProto::InviteToChatProc, (LPARAM)param) == IDOK && param->invitedContacts.size() > 0)
+ if (::DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL, CSkypeProto::ChatRoomProc, (LPARAM)param) == IDOK && param->invitedContacts.size() > 0)
{
SEStringList needToAdd;
for (size_t i = 0; i < param->invitedContacts.size(); i++)
@@ -1181,9 +1238,9 @@ int __cdecl CSkypeProto::OnGCEventHook(WPARAM, LPARAM lParam)
if ( !::CallService(MS_GC_GETINFO, 0, (LPARAM)(GC_INFO *) &gci) && gci.pszUsers != NULL)
{
StringList invitedContacts(_A2T(gci.pszUsers));
- InviteChatParam *param = new InviteChatParam(NULL, invitedContacts, this);
+ ChatRoomParam *param = new ChatRoomParam(NULL, invitedContacts, this);
- if (::DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL, CSkypeProto::InviteToChatProc, (LPARAM)param) == IDOK && param->invitedContacts.size() > 0)
+ if (::DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL, CSkypeProto::ChatRoomProc, (LPARAM)param) == IDOK && param->invitedContacts.size() > 0)
{
SEStringList needToAdd;
for (size_t i = 0; i < param->invitedContacts.size(); i++)
diff --git a/protocols/Skype/src/skype_chat.h b/protocols/Skype/src/skype_chat.h
index 7b1dcd0bf2..32687e4053 100644
--- a/protocols/Skype/src/skype_chat.h
+++ b/protocols/Skype/src/skype_chat.h
@@ -133,8 +133,6 @@ private:
CSkypeProto *ppro;
- static wchar_t *Roles[];
-
ChatRoom(const wchar_t *cid);
inline static int CompareMembers(const ChatMember *p1, const ChatMember *p2) { return ChatMember::Compare(p1, p2); }
@@ -154,10 +152,12 @@ public:
ChatMember *sys;
CConversation::Ref conversation;
+ static wchar_t *Roles[];
+
ChatRoom(const wchar_t *cid, const wchar_t *name, CSkypeProto *ppro);
~ChatRoom();
- static void Create(const StringList &invitedMembers, CSkypeProto *ppro, bool showWindow = false);
+ static void Create(const StringList &invitedMembers, CSkypeProto *ppro, ChatRoomParam *param);
void Start(const ConversationRef &conversation, bool showWindow = false);
diff --git a/protocols/Skype/src/skype_menus.cpp b/protocols/Skype/src/skype_menus.cpp
index 41ffc990ac..26cce7c3b2 100644
--- a/protocols/Skype/src/skype_menus.cpp
+++ b/protocols/Skype/src/skype_menus.cpp
@@ -197,7 +197,7 @@ void CSkypeProto::OnInitStatusMenu()
// Invite Command
::strcpy(tDest, "/InviteCommand");
this->CreateServiceObj(tDest, &CSkypeProto::InviteCommand);
- mi.ptszName = LPGENT("Invite to conference");
+ mi.ptszName = LPGENT("Create conference");
mi.position = 200000 + SMI_CHAT_INVITE;
mi.icolibItem = CSkypeProto::GetIconHandle("confInvite");
::Menu_AddProtoMenuItem(&mi);
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index 3dae01f678..c8b5fd95dd 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -19,16 +19,37 @@ struct ReadMessageParam
CMessage::TYPE msgType;
};
-struct InviteChatParam
+struct ChatRoomParam
{
wchar_t *id;
StringList invitedContacts;
CSkypeProto *ppro;
- InviteChatParam(const wchar_t *id, const StringList &contacts, CSkypeProto *ppro)
- : id(::mir_wstrdup(id)), invitedContacts(contacts), ppro(ppro) { /*this->invitedContacts = contacts;*/ }
+ wchar_t topic[256];
+ wchar_t guidline[256];
- ~InviteChatParam()
+ bool enableJoining;
+ int joinRank;
+
+ bool passwordProtection;
+ wchar_t password[32];
+ wchar_t confirmation[32];
+ wchar_t hint[32];
+
+ ChatRoomParam(const wchar_t *id, const StringList &contacts, CSkypeProto *ppro)
+ : id(::mir_wstrdup(id)), invitedContacts(contacts), ppro(ppro)
+ {
+ this->topic[0] = 0;
+ this->guidline[0] = 0;
+ this->password[0] = 0;
+ this->confirmation[0] = 0;
+ this->hint[0] = 0;
+ this->enableJoining = true;
+ this->joinRank = Participant::WRITER;
+ this->passwordProtection = false;
+ }
+
+ ~ChatRoomParam()
{ ::mir_free(id); }
};
@@ -444,7 +465,7 @@ protected:
static INT_PTR CALLBACK SkypeMainOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
static INT_PTR CALLBACK SkypePasswordRequestProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK SkypePasswordChangeProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
- static INT_PTR CALLBACK InviteToChatProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+ static INT_PTR CALLBACK ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK SkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);