summaryrefslogtreecommitdiff
path: root/protocols/Skype
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-06-19 20:13:00 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-06-19 20:13:00 +0000
commit119f9233647a964c46be1c0bc0cf2829361a688e (patch)
tree4e08e9f569c54284acef57755daaebb5d5de2565 /protocols/Skype
parentbdfdc655113dba220c066ac1de5998697006cb44 (diff)
Skype:
- added bookmarks for chat rooms (contact menu, srmm button bar, bookmark list window) - added "ignore command" for contact - added "block command" for contact (contact removed from clist and ignored) - changed icons git-svn-id: http://svn.miranda-ng.org/main/trunk@5047 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype')
-rw-r--r--protocols/Skype/Skype_10.vcxproj12
-rw-r--r--protocols/Skype/Skype_10.vcxproj.filters14
-rw-r--r--protocols/Skype/Skype_11.vcxproj20
-rw-r--r--protocols/Skype/Skype_11.vcxproj.filters7
-rw-r--r--protocols/Skype/res/Resource.rc264
-rw-r--r--protocols/Skype/res/block.icobin0 -> 1150 bytes
-rw-r--r--protocols/Skype/res/bookmark.icobin0 -> 5430 bytes
-rw-r--r--protocols/Skype/res/conf_invite.icobin5430 -> 5430 bytes
-rw-r--r--protocols/Skype/res/conf_spawn.icobin5430 -> 5430 bytes
-rw-r--r--protocols/Skype/res/delete.icobin0 -> 1150 bytes
-rw-r--r--protocols/Skype/res/ignore.icobin0 -> 1150 bytes
-rw-r--r--protocols/Skype/res/send_contacts.icobin5430 -> 5430 bytes
-rw-r--r--protocols/Skype/src/resource.h10
-rw-r--r--protocols/Skype/src/skype.h14
-rw-r--r--protocols/Skype/src/skype_bookmarks.cpp203
-rw-r--r--protocols/Skype/src/skype_chat.cpp198
-rw-r--r--protocols/Skype/src/skype_chat.h5
-rw-r--r--protocols/Skype/src/skype_events.cpp68
-rw-r--r--protocols/Skype/src/skype_icons.cpp4
-rw-r--r--protocols/Skype/src/skype_menus.cpp166
-rw-r--r--protocols/Skype/src/skype_proto.h15
-rw-r--r--protocols/Skype/src/skypekit/conversation.cpp13
-rw-r--r--protocols/Skype/src/skypekit/conversation.h11
-rw-r--r--protocols/Skype/src/skypekit/participant.cpp13
-rw-r--r--protocols/Skype/src/skypekit/participant.h7
25 files changed, 779 insertions, 265 deletions
diff --git a/protocols/Skype/Skype_10.vcxproj b/protocols/Skype/Skype_10.vcxproj
index 7d1f72e2e3..4f627dbc2f 100644
--- a/protocols/Skype/Skype_10.vcxproj
+++ b/protocols/Skype/Skype_10.vcxproj
@@ -92,7 +92,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Debug</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -121,7 +121,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Debug</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -151,7 +151,7 @@
<OptimizeReferences>true</OptimizeReferences>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Release</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
@@ -179,7 +179,7 @@
<OptimizeReferences>true</OptimizeReferences>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Release</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
@@ -276,9 +276,13 @@
<None Include="res\auth_grant.ico" />
<None Include="res\auth_request.ico" />
<None Include="res\auth_revoke.ico" />
+ <None Include="res\block.ico" />
+ <None Include="res\bookmark.ico" />
<None Include="res\call.ico" />
<None Include="res\conf_invite.ico" />
<None Include="res\conf_spawn.ico" />
+ <None Include="res\delete.ico" />
+ <None Include="res\ignore.ico" />
<None Include="res\main.ico" />
<None Include="res\send_contacts.ico" />
</ItemGroup>
diff --git a/protocols/Skype/Skype_10.vcxproj.filters b/protocols/Skype/Skype_10.vcxproj.filters
index 35857ae69e..02dc39d2ad 100644
--- a/protocols/Skype/Skype_10.vcxproj.filters
+++ b/protocols/Skype/Skype_10.vcxproj.filters
@@ -204,10 +204,22 @@
<None Include="res\conf_invite.ico">
<Filter>Resource Files\Icons</Filter>
</None>
+ <None Include="res\send_contacts.ico">
+ <Filter>Resource Files\Icons</Filter>
+ </None>
<None Include="res\conf_spawn.ico">
<Filter>Resource Files\Icons</Filter>
</None>
- <None Include="res\send_contacts.ico">
+ <None Include="res\bookmark.ico">
+ <Filter>Resource Files\Icons</Filter>
+ </None>
+ <None Include="res\delete.ico">
+ <Filter>Resource Files\Icons</Filter>
+ </None>
+ <None Include="res\ignore.ico">
+ <Filter>Resource Files\Icons</Filter>
+ </None>
+ <None Include="res\block.ico">
<Filter>Resource Files\Icons</Filter>
</None>
</ItemGroup>
diff --git a/protocols/Skype/Skype_11.vcxproj b/protocols/Skype/Skype_11.vcxproj
index 6c5e5286c6..75ce8401db 100644
--- a/protocols/Skype/Skype_11.vcxproj
+++ b/protocols/Skype/Skype_11.vcxproj
@@ -96,7 +96,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Debug</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -126,7 +126,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Debug</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -156,7 +156,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x86.lib;skypekit-cppwrapper_2_lib_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Release</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
@@ -184,7 +184,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
- <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib_x64.lib;skypekit-cppwrapper_2_lib_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\bin11\lib;$(ProfileDir)..\..\..\SkypeKit\SDK\lib\Release</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
@@ -224,34 +224,28 @@
</ClCompile>
<ClCompile Include="src\skypekit\contact.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\conversation.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\group.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\message.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\participant.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\search.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\transfer.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skype_account.cpp" />
<ClCompile Include="src\skype_avatars.cpp" />
+ <ClCompile Include="src\skype_bookmarks.cpp" />
<ClCompile Include="src\skype_chat.cpp" />
<ClCompile Include="src\skype_contacts.cpp" />
<ClCompile Include="src\skype_database.cpp" />
@@ -294,6 +288,10 @@
<None Include="res\main.ico" />
</ItemGroup>
<ItemGroup>
+ <Image Include="res\block.ico" />
+ <Image Include="res\bookmark.ico" />
+ <Image Include="res\delete.ico" />
+ <Image Include="res\ignore.ico" />
<Image Include="res\send_contacts.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
diff --git a/protocols/Skype/Skype_11.vcxproj.filters b/protocols/Skype/Skype_11.vcxproj.filters
index 7c590b924d..913527bcaf 100644
--- a/protocols/Skype/Skype_11.vcxproj.filters
+++ b/protocols/Skype/Skype_11.vcxproj.filters
@@ -120,6 +120,9 @@
<ClCompile Include="src\stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\skype_bookmarks.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\resource.h">
@@ -212,5 +215,9 @@
<Image Include="res\send_contacts.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
+ <Image Include="res\delete.ico" />
+ <Image Include="res\bookmark.ico" />
+ <Image Include="res\ignore.ico" />
+ <Image Include="res\block.ico" />
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/protocols/Skype/res/Resource.rc b/protocols/Skype/res/Resource.rc
index 1ab8bdbb5a..c80ea60be2 100644
--- a/protocols/Skype/res/Resource.rc
+++ b/protocols/Skype/res/Resource.rc
@@ -13,11 +13,11 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Neutral resources
+// Neutral (Default) resources
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-#pragma code_page(1250)
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
+LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
+#pragma code_page(1251)
/////////////////////////////////////////////////////////////////////////////
//
@@ -90,64 +90,6 @@ BEGIN
EDITTEXT IDC_CHAT_GUIDLINE4,84,164,152,14,ES_AUTOHSCROLL
END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_CHATROOM_INVITE, DIALOG
- BEGIN
- RIGHTMARGIN, 188
- TOPMARGIN, 4
- BOTTOMMARGIN, 173
- END
-
- IDD_CHATROOM_CREATE, DIALOG
- BEGIN
- RIGHTMARGIN, 375
- VERTGUIDE, 7
- VERTGUIDE, 181
- VERTGUIDE, 188
- VERTGUIDE, 198
- VERTGUIDE, 368
- TOPMARGIN, 4
- BOTTOMMARGIN, 223
- END
-
- IDD_CHATROOM_CONFIG, DIALOG
- BEGIN
- RIGHTMARGIN, 241
- VERTGUIDE, 5
- VERTGUIDE, 16
- VERTGUIDE, 78
- VERTGUIDE, 84
- VERTGUIDE, 236
- TOPMARGIN, 4
- BOTTOMMARGIN, 310
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // Neutral resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Neutral (Default) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
-LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
-#pragma code_page(1250)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
IDD_PASSWORD_REQUEST DIALOGEX 0, 0, 157, 71
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Enter password"
@@ -182,22 +124,22 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Full name:",IDC_STATIC,5,7,51,8
- EDITTEXT IDC_FULLNAME,58,5,159,12,ES_AUTOHSCROLL
- LTEXT "Date of birth:",IDC_STATIC,5,20,51,8
- COMBOBOX IDC_BIRTH_DAY,58,18,25,12,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Full name:",IDC_STATIC,6,7,54,8
+ EDITTEXT IDC_FULLNAME,60,5,156,12,ES_AUTOHSCROLL
+ LTEXT "Date of birth:",IDC_STATIC,6,20,54,8
+ COMBOBOX IDC_BIRTH_DAY,60,18,25,12,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_BIRTH_MONTH,84,18,25,12,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_BIRTH_YEAR,110,18,35,12,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
- LTEXT "Gender:",IDC_STATIC,5,34,51,8
- COMBOBOX IDC_GENDER,58,32,62,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
- LTEXT "Homepage:",IDC_STATIC,6,119,51,8
- EDITTEXT IDC_HOMEPAGE,58,117,159,12,ES_AUTOHSCROLL
- LTEXT "Language:",IDC_STATIC,6,47,51,8
- COMBOBOX IDC_LANGUAGE,58,46,86,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
- LTEXT "About:",IDC_STATIC,5,90,51,8
- EDITTEXT IDC_ABOUT,57,88,159,24,ES_MULTILINE | WS_VSCROLL
- LTEXT "Mood:",IDC_STATIC,6,62,51,8
- EDITTEXT IDC_MOOD,58,61,159,24,ES_MULTILINE | WS_VSCROLL
+ COMBOBOX IDC_BIRTH_YEAR,109,18,35,12,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Gender:",IDC_STATIC,6,34,54,8
+ COMBOBOX IDC_GENDER,60,32,84,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Homepage:",IDC_STATIC,6,119,54,8
+ EDITTEXT IDC_HOMEPAGE,60,117,156,12,ES_AUTOHSCROLL
+ LTEXT "Language:",IDC_STATIC,6,47,54,8
+ COMBOBOX IDC_LANGUAGE,60,46,84,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
+ LTEXT "About:",IDC_STATIC,6,90,54,8
+ EDITTEXT IDC_ABOUT,60,88,156,24,ES_MULTILINE | WS_VSCROLL
+ LTEXT "Mood:",IDC_STATIC,6,62,54,8
+ EDITTEXT IDC_MOOD,60,61,156,24,ES_MULTILINE | WS_VSCROLL
END
IDD_OWNINFO_CONTACT DIALOGEX 0, 0, 222, 132
@@ -249,6 +191,51 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,142,69,51,14
END
+IDD_ACCMGR DIALOGEX 0, 0, 199, 92
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "Skype name:",IDC_STATIC,12,8,54,12
+ EDITTEXT IDC_SL,66,7,120,12,ES_AUTOHSCROLL
+ LTEXT "Password:",IDC_STATIC,12,24,54,12
+ EDITTEXT IDC_PW,66,23,120,12,ES_PASSWORD | ES_AUTOHSCROLL
+ PUSHBUTTON "Register new account",IDC_REGISTER,66,39,120,14,WS_DISABLED
+END
+
+IDD_OPT_MAIN DIALOGEX 0, 0, 305, 238
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ GROUPBOX "Account",IDC_STATIC,7,7,291,60
+ LTEXT "Skype name:",IDC_STATIC,15,19,63,8
+ EDITTEXT IDC_SL,78,17,121,13,ES_AUTOHSCROLL
+ LTEXT "Password:",IDC_STATIC,15,35,63,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,63,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,78,120,121,14,ES_AUTOHSCROLL
+ LTEXT "Default group:",IDC_STATIC,15,121,63,8
+END
+
+IDD_BOOKMARKS DIALOGEX 0, 0, 296, 262
+STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "Skype bookmarks"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ CONTROL "Server side bookmarks\nControl conference bookmarks on server.",IDC_HEADERBAR,
+ "MHeaderbarCtrl",0x0,0,0,296,25
+ CONTROL "List1",IDC_BM_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,6,38,282,216
+END
+
/////////////////////////////////////////////////////////////////////////////
//
@@ -258,6 +245,37 @@ END
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
+ IDD_CHATROOM_INVITE, DIALOG
+ BEGIN
+ RIGHTMARGIN, 188
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 173
+ END
+
+ IDD_CHATROOM_CREATE, DIALOG
+ BEGIN
+ RIGHTMARGIN, 375
+ VERTGUIDE, 7
+ VERTGUIDE, 181
+ VERTGUIDE, 188
+ VERTGUIDE, 198
+ VERTGUIDE, 368
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 223
+ END
+
+ IDD_CHATROOM_CONFIG, DIALOG
+ BEGIN
+ RIGHTMARGIN, 241
+ VERTGUIDE, 5
+ VERTGUIDE, 16
+ VERTGUIDE, 78
+ VERTGUIDE, 84
+ VERTGUIDE, 236
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 310
+ END
+
IDD_PASSWORD_REQUEST, DIALOG
BEGIN
LEFTMARGIN, 7
@@ -282,6 +300,10 @@ BEGIN
IDD_OWNINFO_PERSONAL, DIALOG
BEGIN
+ VERTGUIDE, 6
+ VERTGUIDE, 60
+ VERTGUIDE, 144
+ VERTGUIDE, 216
END
IDD_OWNINFO_CONTACT, DIALOG
@@ -303,76 +325,14 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 83
END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // Neutral (Default) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Russian (Russia) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
-#pragma code_page(1251)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ACCMGR DIALOGEX 0, 0, 199, 92
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- LTEXT "Skype name:",IDC_STATIC,14,8,46,12
- EDITTEXT IDC_SL,66,7,119,12,ES_AUTOHSCROLL
- LTEXT "Password:",IDC_STATIC,14,24,46,12
- EDITTEXT IDC_PW,66,23,119,12,ES_PASSWORD | ES_AUTOHSCROLL
- PUSHBUTTON "Register new account",IDC_REGISTER,66,39,119,14,WS_DISABLED
-END
-
-IDD_OPT_MAIN DIALOGEX 0, 0, 305, 238
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- 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,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,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,78,120,121,14,ES_AUTOHSCROLL
- LTEXT "Default group:",IDC_STATIC,15,121,57,8
-END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
IDD_ACCMGR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 192
- VERTGUIDE, 14
- VERTGUIDE, 60
+ VERTGUIDE, 12
VERTGUIDE, 66
- VERTGUIDE, 185
+ VERTGUIDE, 186
TOPMARGIN, 7
BOTTOMMARGIN, 85
END
@@ -381,7 +341,6 @@ BEGIN
BEGIN
LEFTMARGIN, 7
VERTGUIDE, 15
- VERTGUIDE, 72
VERTGUIDE, 78
VERTGUIDE, 108
VERTGUIDE, 115
@@ -392,9 +351,26 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 231
END
+
+ IDD_BOOKMARKS, DIALOG
+ BEGIN
+ VERTGUIDE, 6
+ VERTGUIDE, 288
+ HORZGUIDE, 254
+ END
END
#endif // APSTUDIO_INVOKED
+#endif // Neutral (Default) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian (Russia) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
/////////////////////////////////////////////////////////////////////////////
//
@@ -408,6 +384,10 @@ IDI_CALL ICON "call.ico"
IDI_CONF_INVITE ICON "conf_invite.ico"
IDI_CONF_SPAWN ICON "conf_spawn.ico"
IDI_SEND_CONTACTS ICON "send_contacts.ico"
+IDI_DELETE ICON "delete.ico"
+IDI_BOOKMARK ICON "bookmark.ico"
+IDI_IGNORE ICON "ignore.ico"
+IDI_BLOCK ICON "block.ico"
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/protocols/Skype/res/block.ico b/protocols/Skype/res/block.ico
new file mode 100644
index 0000000000..26c0a6d040
--- /dev/null
+++ b/protocols/Skype/res/block.ico
Binary files differ
diff --git a/protocols/Skype/res/bookmark.ico b/protocols/Skype/res/bookmark.ico
new file mode 100644
index 0000000000..63052a4a45
--- /dev/null
+++ b/protocols/Skype/res/bookmark.ico
Binary files differ
diff --git a/protocols/Skype/res/conf_invite.ico b/protocols/Skype/res/conf_invite.ico
index 51c5dce0b6..785cff9b52 100644
--- a/protocols/Skype/res/conf_invite.ico
+++ b/protocols/Skype/res/conf_invite.ico
Binary files differ
diff --git a/protocols/Skype/res/conf_spawn.ico b/protocols/Skype/res/conf_spawn.ico
index 69e0773f11..85948b134a 100644
--- a/protocols/Skype/res/conf_spawn.ico
+++ b/protocols/Skype/res/conf_spawn.ico
Binary files differ
diff --git a/protocols/Skype/res/delete.ico b/protocols/Skype/res/delete.ico
new file mode 100644
index 0000000000..ac630347c2
--- /dev/null
+++ b/protocols/Skype/res/delete.ico
Binary files differ
diff --git a/protocols/Skype/res/ignore.ico b/protocols/Skype/res/ignore.ico
new file mode 100644
index 0000000000..d8801af182
--- /dev/null
+++ b/protocols/Skype/res/ignore.ico
Binary files differ
diff --git a/protocols/Skype/res/send_contacts.ico b/protocols/Skype/res/send_contacts.ico
index 32b5105c15..c29ed475e0 100644
--- a/protocols/Skype/res/send_contacts.ico
+++ b/protocols/Skype/res/send_contacts.ico
Binary files differ
diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h
index 9e22a18bf4..f65b27c7e5 100644
--- a/protocols/Skype/src/resource.h
+++ b/protocols/Skype/src/resource.h
@@ -20,6 +20,11 @@
#define IDI_SEND_CONTACTS 111
#define IDD_CHATROOM_CREATE 111
#define IDD_CHATROOM_CONFIG 112
+#define IDI_DELETE 112
+#define IDI_BOOKMARK 113
+#define IDI_IGNORE 114
+#define IDI_ICON1 115
+#define IDI_BLOCK 115
#define IDC_CCLIST 173
#define IDC_EDITSCR 174
#define IDC_ADDSCR 175
@@ -85,12 +90,15 @@
#define IDC_CHECK1 1052
#define IDC_COMBO2 1053
#define IDC_CHECK2 1054
+#define IDC_HEADERBAR 1320
+#define IDD_BOOKMARKS 3001
+#define IDC_BM_LIST 3002
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 112
+#define _APS_NEXT_RESOURCE_VALUE 116
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1054
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h
index ffa6f36ce2..f5eb253a88 100644
--- a/protocols/Skype/src/skype.h
+++ b/protocols/Skype/src/skype.h
@@ -21,6 +21,7 @@
#include <m_clui.h>
#include <m_core.h>
#include <m_database.h>
+#include <m_ignore.h>
#include <m_langpack.h>
#include <m_message.h>
#include <m_netlib.h>
@@ -60,18 +61,21 @@
#define BBB_ID_CONF_INVITE 2001
#define BBB_ID_CONF_SPAWN 2002
+#define BBB_ID_CONF_BOOKMARK 2003
#define SKYPE_DB_EVENT_TYPE_EMOTE 10001
#define SKYPE_DB_EVENT_TYPE_CONTACTS 10002
#define SKYPE_DB_EVENT_TYPE_CALL 10010
-#define CMI_AUTH_REVOKE 1
-#define CMI_AUTH_REQUEST 2
-#define CMI_AUTH_GRANT 3
-
-#define CMI_TEMS_COUNT 4
+#define CMI_AUTH_REQUEST 1
+#define CMI_AUTH_GRANT 2
+#define CMI_AUTH_REVOKE 3
+#define CMI_CHAT_BOOKMARK 4
+#define CMI_IGNORE 5
+#define CMI_BLOCK 6
#define SMI_CHAT_INVITE 1
+#define SMI_CHAT_BOOKMARKS 2
#include "string_list.h"
diff --git a/protocols/Skype/src/skype_bookmarks.cpp b/protocols/Skype/src/skype_bookmarks.cpp
new file mode 100644
index 0000000000..e95b9c7e84
--- /dev/null
+++ b/protocols/Skype/src/skype_bookmarks.cpp
@@ -0,0 +1,203 @@
+#include "skype.h"
+#include "skype_chat.h"
+
+INT_PTR CSkypeProto::SetBookmarkCommand(WPARAM wParam, LPARAM)
+{
+ HANDLE hContact = (HANDLE)wParam;
+ if (this->IsOnline() && this->IsChatRoom(hContact))
+ this->BookmarkChatRoom(hContact);
+
+ return 0;
+}
+
+static WNDPROC oldWndProc = NULL;
+
+static LRESULT CALLBACK BookmarkListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ if (msg == WM_LBUTTONDOWN)
+ {
+ LVHITTESTINFO hi;
+ hi.pt.x = LOWORD(lParam); hi.pt.y = HIWORD(lParam);
+ ListView_SubItemHitTest(hwnd, &hi);
+ if (hi.iSubItem == 1)
+ {
+ LVITEM lvi = {0};
+ lvi.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_GROUPID;
+ lvi.stateMask = -1;
+ lvi.iItem = hi.iItem;
+ if (ListView_GetItem(hwnd, &lvi) && lvi.iGroupId == 1)
+ {
+ CConversation *convo = (CConversation *)lvi.lParam;
+
+ if (convo->SetBookmark(false))
+ ListView_DeleteItem(hwnd, lvi.iItem);
+ }
+ }
+ }
+
+ return ::CallWindowProc(oldWndProc, hwnd, msg, wParam, lParam);
+}
+
+int ImageList_AddIconFromIconLib(HIMAGELIST hIml, const char *name)
+{
+ HICON icon = ::Skin_GetIconByHandle(::Skin_GetIconHandle(name));
+ int res = ImageList_AddIcon(hIml, icon);
+ ::Skin_ReleaseIcon(icon);
+ return res;
+}
+
+INT_PTR CALLBACK CSkypeProto::SkypeBookmarksProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ CSkypeProto *ppro = (CSkypeProto *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ if (lParam)
+ {
+ ppro = (CSkypeProto *)lParam;
+ ::TranslateDialogDefault(hwndDlg);
+
+ ::SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ ::SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)::Skin_GetIcon("Skype_bookmark", ICON_BIG));
+ ::SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)::Skin_GetIcon("Skype_bookmark"));
+
+ HWND hwndList = ::GetDlgItem(hwndDlg, IDC_BM_LIST);
+ { // IDC_BM_LIST setup
+ oldWndProc = (WNDPROC)::SetWindowLongPtr(hwndList, GWLP_WNDPROC, (LONG_PTR)BookmarkListWndProc);
+
+ HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 4, 0);
+ ImageList_AddIconFromIconLib(hIml, "Skype_bookmark");
+ ImageList_AddIconFromIconLib(hIml, "Skype_delete");
+ ListView_SetImageList(hwndList, hIml, LVSIL_SMALL);
+
+ ///
+ LVCOLUMN lvc = {0};
+ lvc.mask = LVCF_WIDTH | LVCF_TEXT;
+
+ //lvc.fmt = LVCFMT_JUSTIFYMASK;
+ lvc.pszText = TranslateT("Name");
+ lvc.cx = 220; // width of column in pixels
+ ListView_InsertColumn(hwndList, 0, &lvc);
+
+ //lvc.fmt = LVCFMT_RIGHT;
+ lvc.pszText = L"";
+ lvc.cx = 32 - GetSystemMetrics(SM_CXVSCROLL); // width of column in pixels
+ ListView_InsertColumn(hwndList, 1, &lvc);
+
+ ///
+ LVGROUP lvg;
+ lvg.cbSize = sizeof(LVGROUP);
+ lvg.mask = LVGF_HEADER | LVGF_GROUPID;
+
+ lvg.pszHeader = ::TranslateT("Conferences");
+ lvg.iGroupId = 1;
+ ListView_InsertGroup(hwndList, 0, &lvg);
+
+ /*lvg.pszHeader = ::TranslateT("Contacts");
+ lvg.iGroupId = 2;
+ ListView_InsertGroup(hwndList, 0, &lvg);*/
+
+ ListView_EnableGroupView(hwndList, TRUE);
+
+ ::SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP);
+
+ if ( !ppro->IsOnline())
+ ::EnableWindow(hwndList, FALSE);
+ }
+
+ SEString data;
+ ConversationRefs conversations;
+ ppro->GetConversationList(conversations, Conversation::BOOKMARKED_CONVERSATIONS);
+ for (size_t i = 0; i < conversations.size(); i++)
+ {
+ auto conversation = conversations[i];
+
+ uint type = conversation->GetUintProp(Conversation::P_TYPE);
+ if (type != Conversation::CONFERENCE)
+ continue;
+
+ conversation->GetPropDisplayname(data);
+ ptrW name = ::mir_utf8decodeW(data);
+
+ LVITEM lvi = {0};
+ lvi.mask = LVIF_GROUPID | LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
+ lvi.iItem = i;
+ lvi.iGroupId = 1;
+ lvi.iImage = 0;
+ lvi.lParam = (LPARAM)conversation.fetch();
+ lvi.pszText = name;
+ int iRow = ListView_InsertItem(hwndList, &lvi);
+
+ if (iRow != -1)
+ {
+ lvi.iItem = iRow;
+ lvi.mask = LVIF_IMAGE;
+ lvi.iSubItem = 1;
+ lvi.iImage = 1;
+ ListView_SetItem(hwndList, &lvi);
+ }
+ };
+
+ ::Utils_RestoreWindowPosition(hwndDlg, 0, MODULE, "BookmarksWindow");
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch(LOWORD(wParam))
+ {
+ case IDC_BM_LIST:
+ if (((LPNMHDR)lParam)->code == NM_DBLCLK)
+ {
+ HWND hwndList = ::GetDlgItem(hwndDlg, IDC_BM_LIST);
+ int iItem = ListView_GetNextItem(hwndList, -1, LVNI_ALL | LVNI_SELECTED);
+ if (iItem < 0) break;
+ LVITEM lvi = {0};
+ lvi.mask = LVIF_PARAM;
+ lvi.stateMask = -1;
+ lvi.iItem = iItem;
+ if (ListView_GetItem(hwndList, &lvi))
+ {
+ //ppro->FindChatRoom
+
+ CConversation *conversation = (CConversation *)lvi.lParam;
+
+ SEString data;
+ conversation->GetPropIdentity(data);
+ ptrW cid = ::mir_utf8decodeW(data);
+ CSkypeProto::ReplaceSpecialChars(cid);
+
+ ChatRoom *room = ppro->FindChatRoom(cid);
+ if (room != NULL)
+ ::CallProtoService(ppro->m_szModuleName, PS_JOINCHAT, (WPARAM)room->GetContactHandle(), 0);
+ else
+ {
+ conversation->GetPropDisplayname(data);
+ ptrW name = ::mir_utf8decodeW(data);
+
+ ChatRoom *room = new ChatRoom(cid, name, ppro);
+ room->Start(conversation->ref(), true);
+ }
+ }
+ }
+ }
+ break;
+
+ case WM_COMMAND:
+ if (HIWORD( wParam ) == BN_CLICKED)
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDCANCEL:
+ ::Utils_SaveWindowPosition(hwndDlg, NULL, MODULE, "BookmarksWindow");
+ ::Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_BIG, 0));
+ ::Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, 0));
+ ::DestroyWindow(hwndDlg);
+ return TRUE;
+ }
+ }
+ break;
+ }
+ return FALSE;
+} \ No newline at end of file
diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp
index 373abebd14..eb84e2aff3 100644
--- a/protocols/Skype/src/skype_chat.cpp
+++ b/protocols/Skype/src/skype_chat.cpp
@@ -1,7 +1,7 @@
#include "skype.h"
#include "skype_chat.h"
-enum CHAT_LIST_MENU
+enum CHAT_LIST_MENU
{
ICM_CANCEL,
@@ -143,6 +143,11 @@ ChatRoom::~ChatRoom()
this->members.destroy();
}
+HANDLE ChatRoom::GetContactHandle() const
+{
+ return this->hContact;
+}
+
void ChatRoom::CreateChatSession(bool showWindow)
{
SEString data;
@@ -222,6 +227,7 @@ void ChatRoom::Start(const ConversationRef &conversation, bool showWindow)
this->conversation = conversation;
this->conversation.fetch();
+ this->conversation->SetChatRoom(this);
GC_INFO gci = {0};
gci.Flags = BYID | HCONTACT;
@@ -230,6 +236,7 @@ void ChatRoom::Start(const ConversationRef &conversation, bool showWindow)
if ( !::CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
{
+ this->hContact = gci.hContact;
ptrW joinBlob = ::db_get_wsa(gci.hContact, ppro->m_szModuleName, "JoinBlob");
if ( joinBlob == NULL)
{
@@ -376,7 +383,8 @@ void ChatRoom::AddMember(const ChatMember &item, const ChatMember &author, DWORD
{
ChatMember *newMember = new ChatMember(item);
newMember->participant.fetch();
- newMember->participant->SetOnChangedCallback(&ChatRoom::OnParticipantChanged, this);
+ newMember->participant->SetChatRoom(this);
+ //newMember->participant->SetOnChangedCallback(&ChatRoom::OnParticipantChanged, this);
this->members.insert(newMember);
this->SendEvent(item, GC_EVENT_JOIN, timestamp, GCEF_ADDTOLOG, 0, ::TranslateW(ChatRoom::Roles[item.GetRank()]));
@@ -389,7 +397,8 @@ void ChatRoom::AddMember(const ChatMember &item, const ChatMember &author, DWORD
{
this->me->participant = item.participant;
this->me->participant.fetch();
- this->me->participant->SetOnChangedCallback(&ChatRoom::OnParticipantChanged, this);
+ this->me->participant->SetChatRoom(this);
+ //this->me->participant->SetOnChangedCallback(&ChatRoom::OnParticipantChanged, this);
}
if (this->me->GetRank() != item.GetRank())
{
@@ -514,6 +523,12 @@ void ChatRoom::RemoveMember(const wchar_t *sid, DWORD timestamp)
void ChatRoom::OnEvent(const ConversationRef &conversation, const MessageRef &message)
{
+ if ( !this->conversation)
+ this->conversation = conversation;
+
+ if ( this->conversation != conversation)
+ return;
+
uint messageType;
messageType = message->GetUintProp(Message::P_TYPE);
@@ -729,7 +744,7 @@ void ChatRoom::OnEvent(const ConversationRef &conversation, const MessageRef &me
// }
// break;
- case CMessage::STARTED_LIVESESSION:
+ /*case CMessage::STARTED_LIVESESSION:
{
SEString data;
@@ -753,16 +768,16 @@ void ChatRoom::OnEvent(const ConversationRef &conversation, const MessageRef &me
NULL,
::TranslateT("Incoming group call received"));
}
- break;
+ break;*/
case CMessage::ENDED_LIVESESSION:
{
SEString data;
- Message::CONSUMPTION_STATUS status;
- message->GetPropConsumptionStatus(status);
- if (status != Message::UNCONSUMED_NORMAL)
- break;
+ //Message::CONSUMPTION_STATUS status;
+ //message->GetPropConsumptionStatus(status);
+ //if (status != Message::UNCONSUMED_NORMAL)
+ // break;
message->GetPropAuthor(data);
ptrW sid = ::mir_utf8decodeW(data);
@@ -771,7 +786,7 @@ void ChatRoom::OnEvent(const ConversationRef &conversation, const MessageRef &me
message->GetPropTimestamp(timestamp);
this->SendEvent(
- sid,
+ *this->sys,
GC_EVENT_INFORMATION,
timestamp,
GCEF_ADDTOLOG,
@@ -783,6 +798,106 @@ void ChatRoom::OnEvent(const ConversationRef &conversation, const MessageRef &me
}
}
+void ChatRoom::OnChange(const ConversationRef &conversation, int prop)
+{
+ if ( !this->conversation)
+ this->conversation = conversation;
+
+ if ( this->conversation != conversation)
+ return;
+
+ switch (prop)
+ {
+ case Conversation::P_MY_STATUS:
+ {
+ Conversation::MY_STATUS status;
+ conversation->GetPropMyStatus(status);
+ if (status == Conversation::INVALID_ACCESS_TOKEN)
+ {
+ //todo: password request;
+ CSkypeProto::ShowNotification(::TranslateT("The password is incorrect"), 0, this->hContact);
+ GCDEST gcd = { ppro->m_szModuleName, { NULL }, GC_EVENT_CONTROL };
+ gcd.ptszID = this->cid;
+
+ GCEVENT gce = {0};
+ gce.cbSize = sizeof(GCEVENT);
+ gce.dwFlags = GC_TCHAR;
+ gce.pDest = &gcd;
+ ::CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
+ ::CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
+ }
+ else if (status == Conversation::APPLICATION_DENIED)
+ {
+ //
+ CSkypeProto::ShowNotification(::TranslateT("Your application to join the conference was denied"), 0, this->hContact);
+ GCDEST gcd = { ppro->m_szModuleName, { NULL }, GC_EVENT_CONTROL };
+ gcd.ptszID = this->cid;
+
+ GCEVENT gce = {0};
+ gce.cbSize = sizeof(GCEVENT);
+ gce.dwFlags = GC_TCHAR;
+ gce.pDest = &gcd;
+ ::CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
+ ::CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
+ }
+ }
+ break;
+
+ case Conversation::P_IS_BOOKMARKED:
+ {
+ if (conversation->GetBoolProp(Conversation::P_IS_BOOKMARKED))
+ ::db_set_b(hContact, this->ppro->m_szModuleName, "IsBookmarked", 1);
+ else
+ ::db_unset(hContact, this->ppro->m_szModuleName, "IsBookmarked");
+
+ if (this->hContact)
+ {
+ BBButton bbd = { sizeof(bbd) };
+ bbd.pszModuleName = MODULE;
+ bbd.bbbFlags = 0;
+ if (::strcmp(::GetContactProto(this->hContact), this->ppro->m_szModuleName) != 0)
+ bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED;
+ else if (this->ppro->IsChatRoomBookmarked(this->hContact))
+ bbd.bbbFlags = BBSF_DISABLED;
+ bbd.dwButtonID = BBB_ID_CONF_BOOKMARK;
+ ::CallService(MS_BB_SETBUTTONSTATE, (WPARAM)this->hContact, (LPARAM)&bbd);
+ }
+ }
+ break;
+
+ case Conversation::P_LOCAL_LIVESTATUS:
+ {
+ Conversation::LOCAL_LIVESTATUS liveStatus;
+ conversation->GetPropLocalLivestatus(liveStatus);
+ if (liveStatus == Conversation::RINGING_FOR_ME)
+ {
+ SEString data;
+
+ /*Message::CONSUMPTION_STATUS status;
+ message->GetPropConsumptionStatus(status);
+ if (status != Message::UNCONSUMED_NORMAL)
+ break;*/
+
+ /*message->GetPropAuthor(data);
+ ptrW sid = ::mir_utf8decodeW(data);*/
+
+ /*uint timestamp;
+ message->GetPropTimestamp(timestamp);*/
+
+ this->SendEvent(
+ *this->sys,
+ GC_EVENT_INFORMATION,
+ time(NULL),
+ GCEF_ADDTOLOG,
+ 0,
+ NULL,
+ ::TranslateT("Incoming group call received"));
+ }
+ }
+ break;
+ }
+}
+
void ChatRoom::OnParticipantChanged(const ParticipantRef &participant, int prop)
{
if (prop == Participant::P_RANK)
@@ -1024,6 +1139,11 @@ bool CSkypeProto::IsChatRoom(HANDLE hContact)
return ::db_get_b(hContact, this->m_szModuleName, "ChatRoom", 0) == 1;
}
+bool CSkypeProto::IsChatRoomBookmarked(HANDLE hContact)
+{
+ return ::db_get_b(hContact, this->m_szModuleName, "IsBookmarked", 0) == 1;
+}
+
HANDLE CSkypeProto::GetChatRoomByCid(const wchar_t *cid)
{
HANDLE hContact = NULL;
@@ -1091,6 +1211,17 @@ void CSkypeProto::InviteToChatRoom(HANDLE hContact)
::mir_free(gci.pszID);
}
+void CSkypeProto::BookmarkChatRoom(HANDLE hContact)
+{
+ ptrW cid = ::db_get_wsa(hContact, this->m_szModuleName, "ChatRoomID");
+ ChatRoom *room = (ChatRoom *)this->FindChatRoom(cid);
+ if (room != NULL && room->conversation)
+ {
+ bool state = room->conversation->GetBoolProp(Conversation::P_IS_BOOKMARKED);
+ room->conversation->SetBookmark(!state);
+ }
+}
+
void CSkypeProto::CloseAllChatSessions()
{
GC_INFO gci = {0};
@@ -1448,7 +1579,7 @@ void CSkypeProto:: UpdateChatUserNick(CContact::Ref contact)
contact->GetPropFullname(data);
ptrW nick(::mir_utf8decodeW(data));
if (data.length() == 0)
- nick = (WCHAR*)sid;
+ nick = ::mir_wstrdup(sid);
GC_INFO gci = {0};
gci.Flags = BYINDEX | DATA;
@@ -1475,24 +1606,43 @@ INT_PTR __cdecl CSkypeProto::OnJoinChat(WPARAM wParam, LPARAM)
HANDLE hContact = (HANDLE)wParam;
if (hContact)
{
- ptrW joinBlob(::db_get_wsa(hContact, this->m_szModuleName, "JoinBlob"));
+ if (::db_get_w(hContact, this->m_szModuleName, SKYPE_SETTINGS_STATUS, ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ {
+ ptrW joinBlob(::db_get_wsa(hContact, this->m_szModuleName, "JoinBlob"));
- SEString data;
- ConversationRef conversation;
+ SEString data;
+ ConversationRef conversation;
- this->GetConversationByBlob(::mir_utf8encodeW(joinBlob), conversation);
- if (conversation)
- {
- conversation->GetPropDisplayname(data);
- ptrW name(::mir_utf8decodeW(data));
+ this->GetConversationByBlob(::mir_utf8encodeW(joinBlob), conversation);
+ if (conversation)
+ {
+ conversation->GetPropDisplayname(data);
+ ptrW name(::mir_utf8decodeW(data));
- conversation->GetJoinBlob(data);
- joinBlob = ::mir_utf8decodeW(data);
- ::db_set_ws(hContact, this->m_szModuleName, "JoinBlob", joinBlob);
+ conversation->GetJoinBlob(data);
+ joinBlob = ::mir_utf8decodeW(data);
+ ::db_set_ws(hContact, this->m_szModuleName, "JoinBlob", joinBlob);
+ ptrW cid(::db_get_wsa(hContact, this->m_szModuleName, "ChatRoomID"));
+ ChatRoom *room = new ChatRoom(cid, name, this);
+ room->Start(conversation, true);
+ }
+ }
+ else
+ {
ptrW cid(::db_get_wsa(hContact, this->m_szModuleName, "ChatRoomID"));
- ChatRoom *room = new ChatRoom(cid, name, this);
- room->Start(conversation, true);
+
+ GCDEST gcd = { this->m_szModuleName, { NULL }, GC_EVENT_CONTROL };
+ gcd.ptszID = cid;
+
+ GCEVENT gce = {0};
+ gce.cbSize = sizeof(GCEVENT);
+ gce.dwFlags = GC_TCHAR;
+ gce.pDest = &gcd;
+
+ // show window
+ gcd.iType = GC_EVENT_CONTROL;
+ ::CallServiceSync(MS_GC_EVENT, WINDOW_VISIBLE, (LPARAM)&gce);
}
}
diff --git a/protocols/Skype/src/skype_chat.h b/protocols/Skype/src/skype_chat.h
index 32687e4053..b40d4c7f52 100644
--- a/protocols/Skype/src/skype_chat.h
+++ b/protocols/Skype/src/skype_chat.h
@@ -155,7 +155,9 @@ public:
static wchar_t *Roles[];
ChatRoom(const wchar_t *cid, const wchar_t *name, CSkypeProto *ppro);
- ~ChatRoom();
+ ~ChatRoom();
+
+ HANDLE GetContactHandle() const;
static void Create(const StringList &invitedMembers, CSkypeProto *ppro, ChatRoomParam *param);
@@ -183,6 +185,7 @@ public:
void RemoveMember(const wchar_t *sid, DWORD timestamp = time(NULL));
void OnEvent(const ConversationRef &conversation, const MessageRef &message);
+ void OnChange(const ConversationRef &conversation, int prop);
void OnParticipantChanged(const ParticipantRef &participant, int prop);
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp
index 2bcece5129..87a9346fd7 100644
--- a/protocols/Skype/src/skype_events.cpp
+++ b/protocols/Skype/src/skype_events.cpp
@@ -26,7 +26,14 @@ int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM)
bbd.dwDefPos = 100 + bbd.dwButtonID;
::CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
- HookEvent(ME_MSG_WINDOWEVENT, &CSkypeProto::OnSrmmWindowOpen);
+ bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
+ bbd.ptszTooltip = ::TranslateT("Bookmark");
+ bbd.hIcon = CSkypeProto::GetIconHandle("bookmark");
+ bbd.dwButtonID = BBB_ID_CONF_BOOKMARK;
+ bbd.dwDefPos = 100 + bbd.dwButtonID;
+ ::CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
+
+ this->HookEvent(ME_MSG_WINDOWEVENT, &CSkypeProto::OnSrmmWindowOpen);
}
return 0;
@@ -44,6 +51,9 @@ int CSkypeProto::OnPreShutdown(WPARAM, LPARAM)
bbd.dwButtonID = BBB_ID_CONF_SPAWN;
::CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd);
+
+ bbd.dwButtonID = BBB_ID_CONF_BOOKMARK;
+ ::CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bbd);
}
this->SetStatus(ID_STATUS_OFFLINE);
@@ -149,13 +159,21 @@ int __cdecl CSkypeProto::OnSrmmWindowOpen(WPARAM, LPARAM lParam)
{
BBButton bbd = { sizeof(bbd) };
bbd.pszModuleName = MODULE;
- bbd.bbbFlags = (!strcmp( GetContactProto(ev->hContact), this->m_szModuleName)) ? 0 : BBSF_HIDDEN | BBSF_DISABLED;
+ bbd.bbbFlags = (!::strcmp(::GetContactProto(ev->hContact), this->m_szModuleName)) ? 0 : BBSF_HIDDEN | BBSF_DISABLED;
bbd.dwButtonID = BBB_ID_CONF_INVITE;
::CallService(MS_BB_SETBUTTONSTATE, (WPARAM)ev->hContact, (LPARAM)&bbd);
bbd.dwButtonID = BBB_ID_CONF_SPAWN;
::CallService(MS_BB_SETBUTTONSTATE, (WPARAM)ev->hContact, (LPARAM)&bbd);
+
+ bbd.bbbFlags = 0;
+ if (::strcmp(::GetContactProto(ev->hContact), this->m_szModuleName) != 0)
+ bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED;
+ else if (this->IsChatRoomBookmarked(ev->hContact))
+ bbd.bbbFlags = BBSF_DISABLED;
+ bbd.dwButtonID = BBB_ID_CONF_BOOKMARK;
+ ::CallService(MS_BB_SETBUTTONSTATE, (WPARAM)ev->hContact, (LPARAM)&bbd);
}
return 0;
}
@@ -181,6 +199,10 @@ int __cdecl CSkypeProto::OnTabSRMMButtonPressed(WPARAM wParam, LPARAM lParam)
this->StartChat(targets);
}
break;
+
+ case BBB_ID_CONF_BOOKMARK:
+ this->SetBookmarkCommand(wParam, 0);
+ break;
}
return 1;
@@ -235,46 +257,4 @@ void CSkypeProto::OnMessage(
//case CMessage::BLOCKED:
// break;
}
-}
-
-void CSkypeProto::OnConversationChanged(const ConversationRef &conversation, int prop)
-{
- if (prop == Conversation::P_LOCAL_LIVESTATUS)
- {
- Conversation::LOCAL_LIVESTATUS liveStatus;
- conversation->GetPropLocalLivestatus(liveStatus);
- if (liveStatus == Conversation::RINGING_FOR_ME)
- {
- SEString data;
-
- CConversation::TYPE type;
- conversation->GetPropType(type);
- if (type == 0 || type == CConversation::DIALOG)
- {
- ParticipantRefs participants;
- conversation->GetParticipants(participants, Conversation::OTHER_CONSUMERS);
-
- participants[0]->GetPropIdentity(data);
-
- ContactRef author;
- this->GetContact(data, author);
-
- HANDLE hContact = this->AddContact(author);
-
- char *message = ::mir_utf8encode(::Translate("Incoming call received"));
-
- this->AddDBEvent(
- hContact,
- SKYPE_DB_EVENT_TYPE_CALL,
- time(NULL),
- DBEF_UTF,
- (DWORD)::strlen(message) + 1,
- (PBYTE)message);
- }
- //temp popup
- TCHAR popuptext[MAX_PATH];
- mir_sntprintf(popuptext, SIZEOF(popuptext), TranslateT("Incoming call from %s. Use offical skype for calling."), ptrW(::mir_utf8decodeW(data)));
- this->ShowNotification(popuptext);
- }
- }
} \ No newline at end of file
diff --git a/protocols/Skype/src/skype_icons.cpp b/protocols/Skype/src/skype_icons.cpp
index f3bf880b66..ceb520dc69 100644
--- a/protocols/Skype/src/skype_icons.cpp
+++ b/protocols/Skype/src/skype_icons.cpp
@@ -8,6 +8,10 @@ _tag_iconList CSkypeProto::IconList[] =
{ LPGENT("Invite to conference"), "confInvite", IDI_CONF_INVITE },
{ LPGENT("Spawn conference"), "confSpawn", IDI_CONF_SPAWN },
{ LPGENT("Send contact"), "sendContacts", IDI_SEND_CONTACTS },
+ { LPGENT("Bookmark"), "bookmark", IDI_BOOKMARK },
+ { LPGENT("Delete"), "delete", IDI_DELETE },
+ { LPGENT("Ignore"), "ignore", IDI_IGNORE },
+ { LPGENT("Block"), "block", IDI_BLOCK },
};
void CSkypeProto::InitIcons()
diff --git a/protocols/Skype/src/skype_menus.cpp b/protocols/Skype/src/skype_menus.cpp
index 26cce7c3b2..2b2aca93d1 100644
--- a/protocols/Skype/src/skype_menus.cpp
+++ b/protocols/Skype/src/skype_menus.cpp
@@ -1,8 +1,7 @@
#include "skype.h"
HANDLE CSkypeProto::hChooserMenu;
-HANDLE CSkypeProto::contactMenuItems[CMI_TEMS_COUNT];
-HANDLE CSkypeProto::contactMenuServices[CMI_TEMS_COUNT];
+std::map<int, HANDLE> CSkypeProto::contactMenuItems;
INT_PTR CSkypeProto::MenuChooseService(WPARAM wParam, LPARAM lParam)
{
@@ -30,16 +29,64 @@ int CSkypeProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
if (hContact == NULL)
return 0;
- if (this->IsOnline() && !this->IsChatRoom(hContact))
+ if ( !this->IsOnline())
{
- bool ctrlPressed = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+ if (::db_get_b(hContact, this->m_szModuleName, "IsSkypeOut", 0) > 0)
+ {
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_REQUEST], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_GRANT], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_REVOKE], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_CHAT_BOOKMARK], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_IGNORE], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_BLOCK], false);
+ }
+ return 0;
+ }
+ if ( !this->IsChatRoom(hContact))
+ {
+ bool ctrlPressed = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
+
bool authNeed = ::db_get_b(hContact, this->m_szModuleName, "Auth", 0) > 0;
bool grantNeed = ::db_get_b(hContact, this->m_szModuleName, "Grant", 0) > 0;
+ bool ignored = ::db_get_b(hContact, this->m_szModuleName, "Ignore", 0) > 0;
CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_REQUEST], ctrlPressed || authNeed);
CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_GRANT], ctrlPressed || grantNeed);
CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_REVOKE], ctrlPressed || (!grantNeed && !authNeed));
+
+ { // ignore
+ CLISTMENUITEM clmi = {0};
+ clmi.cbSize = sizeof(CLISTMENUITEM);
+ clmi.flags = CMIM_FLAGS;
+
+ if (::db_get_b(hContact, this->m_szModuleName, "Ignore", 0) == 1)
+ clmi.flags |= CMIF_CHECKED;
+
+ ::CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)CSkypeProto::contactMenuItems[CMI_IGNORE], (LPARAM)&clmi);
+ }
+
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_BLOCK], ctrlPressed);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_CHAT_BOOKMARK], false);
+ }
+ else
+ {
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_REQUEST], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_GRANT], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_AUTH_REVOKE], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_IGNORE], false);
+ CSkypeProto::ShowMenuItem(CSkypeProto::contactMenuItems[CMI_BLOCK], false);
+
+ { // bookmark
+ CLISTMENUITEM clmi = {0};
+ clmi.cbSize = sizeof(CLISTMENUITEM);
+ clmi.flags = CMIM_FLAGS;
+
+ if (this->IsChatRoomBookmarked(hContact))
+ clmi.flags |= CMIF_CHECKED;
+
+ ::CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)CSkypeProto::contactMenuItems[CMI_CHAT_BOOKMARK], (LPARAM)&clmi);
+ }
}
return 0;
@@ -92,14 +139,51 @@ int CSkypeProto::RevokeAuth(WPARAM wParam, LPARAM lParam)
{
CContact::Ref contact;
HANDLE hContact = (HANDLE)wParam;
- SEString sid(::mir_u2a(mir_ptr<wchar_t>(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID))));
+ SEString sid(_T2A(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID)));
if (this->GetContact(sid, contact))
{
if (contact->SetBuddyStatus(false))
- {
::db_set_b(hContact, this->m_szModuleName, "Grant", 1);
+ this->contactList.remove_val(contact);
+ }
+
+ return 0;
+}
+
+INT_PTR CSkypeProto::IgnoreCommand(WPARAM wParam, LPARAM)
+{
+ CContact::Ref contact;
+ HANDLE hContact = (HANDLE)wParam;
+ SEString sid(_T2A(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID)));
+ if (this->GetContact(sid, contact))
+ {
+ bool state = ::db_get_b(hContact, this->m_szModuleName, "Ignore", 0) > 0;
+ if (contact->SetBlocked(!state))
+ {
+ ::CallService(!state ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, wParam, IGNOREEVENT_ALL);
+ ::db_set_b(hContact, this->m_szModuleName, "Ignore", (int)!state);
}
+ }
+
+ return 0;
+}
+
+INT_PTR CSkypeProto::BlockCommand(WPARAM wParam, LPARAM)
+{
+ CContact::Ref contact;
+ HANDLE hContact = (HANDLE)wParam;
+ SEString sid(_T2A(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID)));
+ if (this->GetContact(sid, contact))
+ {
+ if (contact->SetBuddyStatus(false))
+ ::db_set_b(hContact, this->m_szModuleName, "Grant", 1);
this->contactList.remove_val(contact);
+
+ bool state = ::db_get_b(hContact, this->m_szModuleName, "Ignore", 0) > 0;
+ if (contact->SetBlocked(!state))
+ ::db_set_b(hContact, this->m_szModuleName, "Ignore", (int)!state);
+
+ ::db_set_b(hContact, "CList", "Hidden", 1);
}
return 0;
@@ -112,6 +196,13 @@ INT_PTR CSkypeProto::InviteCommand(WPARAM, LPARAM)
return 0;
}
+INT_PTR CSkypeProto::ShowBookmarksCommand(WPARAM, LPARAM)
+{
+ ::DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_BOOKMARKS), NULL, CSkypeProto::SkypeBookmarksProc, (LPARAM)this);
+
+ return 0;
+}
+
int CSkypeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
for (size_t i = 0; i < SIZEOF(CSkypeProto::contactMenuItems); i++)
@@ -134,31 +225,56 @@ void CSkypeProto::InitMenus()
CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(CLISTMENUITEM);
- mi.flags = CMIF_TCHAR;
-
- // "Revoke authorization"
- mi.pszService = "Skype/RevokeAuth";
- mi.ptszName = LPGENT("Revoke authorization");
- mi.position = -2000001000 - CMI_AUTH_REVOKE;
- mi.icolibItem = ::LoadSkinnedIconHandle(SKINICON_AUTH_REVOKE);
- CSkypeProto::contactMenuItems[CMI_AUTH_REVOKE] = ::Menu_AddContactMenuItem(&mi);
- CSkypeProto::contactMenuServices[CMI_AUTH_REVOKE] = ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::RevokeAuth>);
+ mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
// "Request authorization"
- mi.pszService = "Skype/RequestAuth";
+ mi.pszService = MODULE"/RequestAuth";
mi.ptszName = LPGENT("Request authorization");
- mi.position = -2000001000 - CMI_AUTH_REQUEST;
+ mi.position = -201001000 + CMI_AUTH_REQUEST;
mi.icolibItem = ::LoadSkinnedIconHandle(SKINICON_AUTH_REQUEST);
CSkypeProto::contactMenuItems[CMI_AUTH_REQUEST] = ::Menu_AddContactMenuItem(&mi);
- CSkypeProto::contactMenuServices[CMI_AUTH_REQUEST] = ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::RequestAuth>);
+ ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::RequestAuth>);
// "Grant authorization"
- mi.pszService = "Skype/GrantAuth";
+ mi.pszService = MODULE"/GrantAuth";
mi.ptszName = LPGENT("Grant authorization");
- mi.position = -2000001000 - CMI_AUTH_GRANT;
+ mi.position = -201001000 + CMI_AUTH_GRANT;
mi.icolibItem = ::LoadSkinnedIconHandle(SKINICON_AUTH_GRANT);
CSkypeProto::contactMenuItems[CMI_AUTH_GRANT] = ::Menu_AddContactMenuItem(&mi);
- CSkypeProto::contactMenuServices[CMI_AUTH_GRANT] = ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::GrantAuth>);
+ ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::GrantAuth>);
+
+ // "Revoke authorization"
+ mi.pszService = MODULE"/RevokeAuth";
+ mi.ptszName = LPGENT("Revoke authorization");
+ mi.position = -201001000 + CMI_AUTH_REVOKE;
+ mi.icolibItem = ::LoadSkinnedIconHandle(SKINICON_AUTH_REVOKE);
+ CSkypeProto::contactMenuItems[CMI_AUTH_REVOKE] = ::Menu_AddContactMenuItem(&mi);
+ ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::RevokeAuth>);
+
+ // "Bookmark"
+ mi.pszService = MODULE"/SetBookmark";
+ mi.ptszName = LPGENT("Set bookmark");
+ mi.position = -200001000 + CMI_CHAT_BOOKMARK;
+ mi.icolibItem = NULL;//CSkypeProto::GetIconHandle("bookmark");
+ CSkypeProto::contactMenuItems[CMI_CHAT_BOOKMARK] = ::Menu_AddContactMenuItem(&mi);
+ ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::SetBookmarkCommand>);
+
+ // "Ignore"
+ mi.pszService = MODULE"/Ignore";
+ mi.ptszName = LPGENT("Ignore");
+ mi.position = -200001000 + CMI_IGNORE;
+ mi.icolibItem = NULL;//CSkypeProto::GetIconHandle("ignore");
+ CSkypeProto::contactMenuItems[CMI_IGNORE] = ::Menu_AddContactMenuItem(&mi);
+ ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::IgnoreCommand>);
+
+ // "Block"
+ mi.pszService = MODULE"/Block";
+ mi.ptszName = LPGENT("Block");
+ //mi.flags |= CMIF_HIDDEN;
+ mi.position = -200001000 + CMI_BLOCK;
+ mi.icolibItem = CSkypeProto::GetIconHandle("block");
+ CSkypeProto::contactMenuItems[CMI_BLOCK] = ::Menu_AddContactMenuItem(&mi);
+ ::CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::BlockCommand>);
}
void CSkypeProto::UninitMenus()
@@ -201,4 +317,12 @@ void CSkypeProto::OnInitStatusMenu()
mi.position = 200000 + SMI_CHAT_INVITE;
mi.icolibItem = CSkypeProto::GetIconHandle("confInvite");
::Menu_AddProtoMenuItem(&mi);
+
+ // Invite Command
+ ::strcpy(tDest, "/BookmarksCommand");
+ this->CreateServiceObj(tDest, &CSkypeProto::ShowBookmarksCommand);
+ mi.ptszName = LPGENT("Bookmarks");
+ mi.position = 200000 + SMI_CHAT_BOOKMARKS;
+ mi.icolibItem = CSkypeProto::GetIconHandle("bookmark");
+ ::Menu_AddProtoMenuItem(&mi);
} \ No newline at end of file
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index 71c1d8ca4a..f60d88faa9 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -275,6 +275,7 @@ protected:
// chat
bool IsChatRoom(HANDLE hContact);
+ bool IsChatRoomBookmarked(HANDLE hContact);
HANDLE GetChatRoomByCid(const wchar_t *cid);
HANDLE AddChatRoom(CConversation::Ref conversation);
@@ -291,6 +292,7 @@ protected:
void StartChat();
void StartChat(StringList &invitedContacts);
void InviteToChatRoom(HANDLE hContact);
+ void BookmarkChatRoom(HANDLE hContact);
void CloseAllChatSessions();
@@ -430,8 +432,7 @@ protected:
// menus
HGENMENU m_hMenuRoot;
static HANDLE hChooserMenu;
- static HANDLE contactMenuItems[CMI_TEMS_COUNT];
- static HANDLE contactMenuServices[CMI_TEMS_COUNT];
+ static std::map<int, HANDLE> contactMenuItems;
virtual int __cdecl RequestAuth(WPARAM, LPARAM);
virtual int __cdecl GrantAuth(WPARAM, LPARAM);
@@ -441,8 +442,14 @@ protected:
static INT_PTR MenuChooseService(WPARAM wParam, LPARAM lParam);
+ INT_PTR __cdecl IgnoreCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl BlockCommand(WPARAM, LPARAM);
+
INT_PTR __cdecl InviteCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl SetBookmarkCommand(WPARAM, LPARAM);
+ INT_PTR __cdecl ShowBookmarksCommand(WPARAM, LPARAM);
+
static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam);
int OnPrebuildContactMenu(WPARAM wParam, LPARAM);
@@ -471,6 +478,8 @@ protected:
static INT_PTR CALLBACK ContactSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+ static INT_PTR CALLBACK SkypeBookmarksProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
// skype runtime
char *LoadKeyPair();
int StartSkypeRuntime(const wchar_t *profileName);
@@ -488,6 +497,4 @@ protected:
int __cdecl OnMessagePreCreate(WPARAM, LPARAM);
int __cdecl OnTabSRMMButtonPressed(WPARAM, LPARAM);
-
- void OnConversationChanged(const ConversationRef &conversation, int prop);
};
diff --git a/protocols/Skype/src/skypekit/conversation.cpp b/protocols/Skype/src/skypekit/conversation.cpp
index 3aa6fe39f2..ff393c8efb 100644
--- a/protocols/Skype/src/skypekit/conversation.cpp
+++ b/protocols/Skype/src/skypekit/conversation.cpp
@@ -1,7 +1,20 @@
#include "..\skype.h"
#include "conversation.h"
+#include "..\skype_chat.h"
CConversation::CConversation(unsigned int oid, SERootObject* root) :
Conversation(oid, root)
{
+ this->room = NULL;
}
+
+void CConversation::SetChatRoom(ChatRoom *room)
+{
+ this->room = room;
+}
+
+void CConversation::OnChange(int prop)
+{
+ if (this->room != NULL)
+ this->room->OnChange(this->ref(), prop);
+} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/conversation.h b/protocols/Skype/src/skypekit/conversation.h
index e8631dcac8..3441743328 100644
--- a/protocols/Skype/src/skypekit/conversation.h
+++ b/protocols/Skype/src/skypekit/conversation.h
@@ -2,13 +2,22 @@
#include "common.h"
+class ChatRoom;
+
class CConversation : public Conversation
{
public:
- typedef void (CSkypeProto::* OnConvoChanged)(const ConversationRef &conversation, int);
+ //typedef void (CSkypeProto::* OnConvoChanged)(const ConversationRef &conversation, int);
typedef DRef<CConversation, Conversation> Ref;
typedef DRefs<CConversation, Conversation> Refs;
CConversation(unsigned int oid, SERootObject* root);
+
+ void SetChatRoom(ChatRoom *room);
+
+private:
+ ChatRoom *room;
+
+ void OnChange(int prop);
}; \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/participant.cpp b/protocols/Skype/src/skypekit/participant.cpp
index 513f532a0f..41e183821b 100644
--- a/protocols/Skype/src/skypekit/participant.cpp
+++ b/protocols/Skype/src/skypekit/participant.cpp
@@ -1,5 +1,6 @@
#include "..\skype.h"
#include "participant.h"
+#include "..\skype_chat.h"
CParticipant::CParticipant(unsigned int oid, SERootObject* root) :
Participant(oid, root)
@@ -7,14 +8,20 @@ CParticipant::CParticipant(unsigned int oid, SERootObject* root) :
this->room = NULL;
}
-void CParticipant::SetOnChangedCallback(OnChanged callback, ChatRoom *room)
+//void CParticipant::SetOnChangedCallback(OnChanged callback, ChatRoom *room)
+//{
+// this->room = room;
+// this->callback = callback;
+//}
+
+void CParticipant::SetChatRoom(ChatRoom *room)
{
this->room = room;
- this->callback = callback;
}
void CParticipant::OnChange(int prop)
{
if (this->room != NULL)
- (room->*callback)(this->ref(), prop);
+ this->room->OnParticipantChanged(this->ref(), prop);
+ //(room->*callback)(this->ref(), prop);
} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/participant.h b/protocols/Skype/src/skypekit/participant.h
index e6db40ca1f..170c14f1b7 100644
--- a/protocols/Skype/src/skypekit/participant.h
+++ b/protocols/Skype/src/skypekit/participant.h
@@ -7,18 +7,19 @@ class ChatRoom;
class CParticipant : public Participant
{
public:
- typedef void (ChatRoom::* OnChanged)(const ParticipantRef &participant, int);
+ //typedef void (ChatRoom::* OnChanged)(const ParticipantRef &participant, int);
typedef DRef<CParticipant, Participant> Ref;
typedef DRefs<CParticipant, Participant> Refs;
CParticipant(unsigned int oid, SERootObject* root);
- void SetOnChangedCallback(OnChanged callback, ChatRoom *room);
+ //void SetOnChangedCallback(OnChanged callback, ChatRoom *room);
+ void SetChatRoom(ChatRoom *room);
private:
ChatRoom *room;
- OnChanged callback;
+ //OnChanged callback;
void OnChange(int prop);
}; \ No newline at end of file