diff options
| -rw-r--r-- | bin15/mir_icons.sln | 26 | ||||
| -rw-r--r-- | bin16/mir_icons.sln | 26 | ||||
| -rw-r--r-- | bin17/mir_icons.sln | 26 | ||||
| -rw-r--r-- | protocols/Teams/proto_teams/Proto_Teams.vcxproj | 34 | ||||
| -rw-r--r-- | protocols/Teams/proto_teams/Proto_Teams.vcxproj.filters | 14 | ||||
| -rw-r--r-- | protocols/Teams/proto_teams/res/Proto_Teams.rc | 74 | ||||
| -rw-r--r-- | protocols/Teams/proto_teams/src/resource.h | 20 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_chatrooms.cpp | 4 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_contacts.cpp | 8 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_endpoint.cpp | 24 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_login.cpp | 11 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_options.cpp | 6 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_proto.cpp | 3 | ||||
| -rw-r--r-- | protocols/Teams/src/teams_proto.h | 12 |
14 files changed, 213 insertions, 75 deletions
diff --git a/bin15/mir_icons.sln b/bin15/mir_icons.sln index bc2c0e8c50..78cbb7e6fd 100644 --- a/bin15/mir_icons.sln +++ b/bin15/mir_icons.sln @@ -60,6 +60,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Discord", "..\protoco EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TabSRMM_icons", "..\plugins\TabSRMM\TabSRMM_icons\ICONS_NOVA_15.vcxproj", "{F553F140-B7D3-4984-90B1-00D4831B8A6E}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Teams", "..\protocols\Teams\proto_teams\Proto_Teams.vcxproj", "{9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -148,14 +150,6 @@ Global {B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|Win32.Build.0 = Release|Win32
{B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|x64.ActiveCfg = Release|x64
{B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|x64.Build.0 = Release|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.ActiveCfg = Debug|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.Build.0 = Debug|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.ActiveCfg = Debug|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.Build.0 = Debug|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.ActiveCfg = Release|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.Build.0 = Release|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.ActiveCfg = Release|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.Build.0 = Release|x64
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|Win32.ActiveCfg = Debug|Win32
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|Win32.Build.0 = Debug|Win32
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|x64.ActiveCfg = Debug|x64
@@ -300,6 +294,22 @@ Global {6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|Win32.Build.0 = Release|Win32
{6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|x64.ActiveCfg = Release|x64
{6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|x64.Build.0 = Release|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.Build.0 = Debug|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.ActiveCfg = Debug|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.Build.0 = Debug|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.ActiveCfg = Release|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.Build.0 = Release|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.ActiveCfg = Release|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.Build.0 = Release|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|Win32.Build.0 = Debug|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|x64.ActiveCfg = Debug|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|x64.Build.0 = Debug|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|Win32.ActiveCfg = Release|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|Win32.Build.0 = Release|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|x64.ActiveCfg = Release|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/bin16/mir_icons.sln b/bin16/mir_icons.sln index 39fa89ede7..f5b98324bd 100644 --- a/bin16/mir_icons.sln +++ b/bin16/mir_icons.sln @@ -60,6 +60,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Discord", "..\protoco EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TabSRMM_icons", "..\plugins\TabSRMM\TabSRMM_icons\ICONS_NOVA_16.vcxproj", "{F553F140-B7D3-4984-90B1-00D4831B8A6E}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Teams", "..\protocols\Teams\proto_teams\Proto_Teams.vcxproj", "{9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -148,14 +150,6 @@ Global {B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|Win32.Build.0 = Release|Win32
{B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|x64.ActiveCfg = Release|x64
{B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|x64.Build.0 = Release|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.ActiveCfg = Debug|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.Build.0 = Debug|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.ActiveCfg = Debug|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.Build.0 = Debug|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.ActiveCfg = Release|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.Build.0 = Release|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.ActiveCfg = Release|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.Build.0 = Release|x64
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|Win32.ActiveCfg = Debug|Win32
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|Win32.Build.0 = Debug|Win32
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|x64.ActiveCfg = Debug|x64
@@ -300,6 +294,22 @@ Global {6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|Win32.Build.0 = Release|Win32
{6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|x64.ActiveCfg = Release|x64
{6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|x64.Build.0 = Release|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.Build.0 = Debug|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.ActiveCfg = Debug|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.Build.0 = Debug|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.ActiveCfg = Release|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.Build.0 = Release|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.ActiveCfg = Release|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.Build.0 = Release|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|Win32.Build.0 = Debug|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|x64.ActiveCfg = Debug|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|x64.Build.0 = Debug|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|Win32.ActiveCfg = Release|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|Win32.Build.0 = Release|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|x64.ActiveCfg = Release|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/bin17/mir_icons.sln b/bin17/mir_icons.sln index 4b538f169f..0e4a0f0422 100644 --- a/bin17/mir_icons.sln +++ b/bin17/mir_icons.sln @@ -60,6 +60,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Discord", "..\protoco EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TabSRMM_icons", "..\plugins\TabSRMM\TabSRMM_icons\ICONS_NOVA_17.vcxproj", "{F553F140-B7D3-4984-90B1-00D4831B8A6E}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Teams", "..\protocols\Teams\proto_teams\Proto_Teams.vcxproj", "{9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -148,14 +150,6 @@ Global {B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|Win32.Build.0 = Release|Win32
{B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|x64.ActiveCfg = Release|x64
{B2E0D5C5-D418-4962-812A-FBC5C7FFC4B6}.Release|x64.Build.0 = Release|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.ActiveCfg = Debug|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.Build.0 = Debug|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.ActiveCfg = Debug|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.Build.0 = Debug|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.ActiveCfg = Release|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.Build.0 = Release|Win32
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.ActiveCfg = Release|x64
- {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.Build.0 = Release|x64
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|Win32.ActiveCfg = Debug|Win32
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|Win32.Build.0 = Debug|Win32
{2BCC460C-E7C0-4AA8-B680-B9DE561A8408}.Debug|x64.ActiveCfg = Debug|x64
@@ -300,6 +294,22 @@ Global {6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|Win32.Build.0 = Release|Win32
{6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|x64.ActiveCfg = Release|x64
{6B8BA5EE-3815-44A6-A13B-2A22E8B3A311}.Release|x64.Build.0 = Release|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|Win32.Build.0 = Debug|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.ActiveCfg = Debug|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Debug|x64.Build.0 = Debug|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.ActiveCfg = Release|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|Win32.Build.0 = Release|Win32
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.ActiveCfg = Release|x64
+ {F553F140-B7D3-4984-90B1-00D4831B8A6E}.Release|x64.Build.0 = Release|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|Win32.Build.0 = Debug|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|x64.ActiveCfg = Debug|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Debug|x64.Build.0 = Debug|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|Win32.ActiveCfg = Release|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|Win32.Build.0 = Release|Win32
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|x64.ActiveCfg = Release|x64
+ {9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/protocols/Teams/proto_teams/Proto_Teams.vcxproj b/protocols/Teams/proto_teams/Proto_Teams.vcxproj new file mode 100644 index 0000000000..bedc42ba98 --- /dev/null +++ b/protocols/Teams/proto_teams/Proto_Teams.vcxproj @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectName>Proto_Teams</ProjectName> + <ProjectGuid>{9C0BBF52-FE1D-4F07-9422-2B3321CFBE88}</ProjectGuid> + </PropertyGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(ProjectDir)..\..\..\build\vc.common\icons.props" /> + </ImportGroup> + <ItemGroup> + <ClInclude Include="src\resource.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="res\Proto_Teams.rc" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/protocols/Teams/proto_teams/Proto_Teams.vcxproj.filters b/protocols/Teams/proto_teams/Proto_Teams.vcxproj.filters new file mode 100644 index 0000000000..fc4b59ab56 --- /dev/null +++ b/protocols/Teams/proto_teams/Proto_Teams.vcxproj.filters @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(ProjectDir)..\..\..\build\vc.common\common.filters" /> + <ItemGroup> + <ClInclude Include="src\resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="res\Proto_Teams.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/protocols/Teams/proto_teams/res/Proto_Teams.rc b/protocols/Teams/proto_teams/res/Proto_Teams.rc new file mode 100644 index 0000000000..b3a2af10e0 --- /dev/null +++ b/protocols/Teams/proto_teams/res/Proto_Teams.rc @@ -0,0 +1,74 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\src\resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Russian (Russia) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "..\\src\\resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "Offline.ico" +IDI_ICON2 ICON "Online.ico" +IDI_ICON3 ICON "Away.ico" +IDI_ICON4 ICON "Invisible.ico" +IDI_ICON6 ICON "DND.ico" + +#endif // Russian (Russia) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/protocols/Teams/proto_teams/src/resource.h b/protocols/Teams/proto_teams/src/resource.h new file mode 100644 index 0000000000..ee4121b6bd --- /dev/null +++ b/protocols/Teams/proto_teams/src/resource.h @@ -0,0 +1,20 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Proto_IRC.rc +// +#define IDI_ICON1 105 +#define IDI_ICON2 104 +#define IDI_ICON3 128 +#define IDI_ICON4 130 +#define IDI_ICON6 158 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 104 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/protocols/Teams/src/teams_chatrooms.cpp b/protocols/Teams/src/teams_chatrooms.cpp index dcb2451911..42c5f269ce 100644 --- a/protocols/Teams/src/teams_chatrooms.cpp +++ b/protocols/Teams/src/teams_chatrooms.cpp @@ -200,7 +200,7 @@ int CTeamsProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) INT_PTR CTeamsProto::OnJoinChatRoom(WPARAM hContact, LPARAM) { if (hContact) { - ptrW idT(getWStringA(hContact, SKYPE_SETTINGS_ID)); + ptrW idT(getWStringA(hContact, DBKEY_ID)); ptrW nameT(getWStringA(hContact, "Nick")); StartChatRoom(idT, nameT != NULL ? nameT : idT); } @@ -213,7 +213,7 @@ INT_PTR CTeamsProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) return 1; if (hContact && IDYES == MessageBox(nullptr, TranslateT("This chat is going to be destroyed forever with all its contents. This action cannot be undone. Are you sure?"), TranslateT("Warning"), MB_YESNO | MB_ICONQUESTION)) { - ptrW idT(getWStringA(hContact, SKYPE_SETTINGS_ID)); + ptrW idT(getWStringA(hContact, DBKEY_ID)); auto *si = Chat_Find(idT, m_szModuleName); Chat_Control(si, SESSION_OFFLINE); Chat_Terminate(si); diff --git a/protocols/Teams/src/teams_contacts.cpp b/protocols/Teams/src/teams_contacts.cpp index fa4577ecfc..b8f94be72d 100644 --- a/protocols/Teams/src/teams_contacts.cpp +++ b/protocols/Teams/src/teams_contacts.cpp @@ -34,7 +34,7 @@ void CTeamsProto::SetContactStatus(MCONTACT hContact, uint16_t status) void CTeamsProto::SetChatStatus(MCONTACT hContact, int iStatus) { - ptrW tszChatID(getWStringA(hContact, SKYPE_SETTINGS_ID)); + ptrW tszChatID(getWStringA(hContact, DBKEY_ID)); if (tszChatID != NULL) Chat_Control(Chat_Find(tszChatID, m_szModuleName), (iStatus == ID_STATUS_OFFLINE) ? SESSION_OFFLINE : SESSION_ONLINE); } @@ -60,7 +60,7 @@ MCONTACT CTeamsProto::GetContactFromAuthEvent(MEVENT hEvent) MCONTACT CTeamsProto::FindContact(const char *skypeId) { for (auto &hContact : AccContacts()) - if (!mir_strcmpi(skypeId, ptrA(getUStringA(hContact, SKYPE_SETTINGS_ID)))) + if (!mir_strcmpi(skypeId, ptrA(getUStringA(hContact, DBKEY_ID)))) return hContact; return 0; @@ -69,7 +69,7 @@ MCONTACT CTeamsProto::FindContact(const char *skypeId) MCONTACT CTeamsProto::FindContact(const wchar_t *skypeId) { for (auto &hContact : AccContacts()) - if (!mir_wstrcmpi(skypeId, getMStringW(hContact, SKYPE_SETTINGS_ID))) + if (!mir_wstrcmpi(skypeId, getMStringW(hContact, DBKEY_ID))) return hContact; return 0; @@ -84,7 +84,7 @@ MCONTACT CTeamsProto::AddContact(const char *skypeId, const char *nick, bool isT hContact = db_add_contact(); Proto_AddToContact(hContact, m_szModuleName); - setString(hContact, SKYPE_SETTINGS_ID, skypeId); + setString(hContact, DBKEY_ID, skypeId); setUString(hContact, "Nick", (nick) ? nick : GetSkypeNick(skypeId)); if (m_wstrCListGroup) { diff --git a/protocols/Teams/src/teams_endpoint.cpp b/protocols/Teams/src/teams_endpoint.cpp index d0431cd3b2..047e41c5dd 100644 --- a/protocols/Teams/src/teams_endpoint.cpp +++ b/protocols/Teams/src/teams_endpoint.cpp @@ -17,30 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" -void CTeamsProto::CheckConvert() -{ - m_szSkypename = getMStringA(SKYPE_SETTINGS_ID); - if (m_szSkypename.IsEmpty()) { - m_szSkypename = getMStringA(SKYPE_SETTINGS_LOGIN); - if (!m_szSkypename.IsEmpty()) { // old settings format, need to update all settings - m_szSkypename.Insert(0, "8:"); - setString(SKYPE_SETTINGS_ID, m_szSkypename); - - for (auto &hContact : AccContacts()) { - CMStringA id(ptrA(getUStringA(hContact, "Skypename"))); - if (!id.IsEmpty()) - setString(hContact, SKYPE_SETTINGS_ID, (isChatRoom(hContact)) ? "19:" + id : "8:" + id); - - ptrW wszNick(getWStringA(hContact, "Nick")); - if (wszNick == nullptr) - setUString(hContact, "Nick", id); - - delSetting(hContact, "Skypename"); - } - } - } -} - void CTeamsProto::ProcessTimer() { if (!IsOnline()) diff --git a/protocols/Teams/src/teams_login.cpp b/protocols/Teams/src/teams_login.cpp index 72324355ac..515d84fa98 100644 --- a/protocols/Teams/src/teams_login.cpp +++ b/protocols/Teams/src/teams_login.cpp @@ -220,25 +220,22 @@ void CTeamsProto::OauthRefreshServices() void CTeamsProto::Login() { - CMStringA szLogin(getMStringA("Login")), szPassword(getMStringA("Password")); - if (szLogin.IsEmpty() || szPassword.IsEmpty()) { - LoginError(); - return; - } - - // login + // set plugin status to connect int oldStatus = m_iStatus; m_iStatus = ID_STATUS_CONNECTING; ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); + // launch http queue StartQueue(); + // if refresh token doesn't exist, perform a device code authentication m_szAccessToken = getMStringA("RefreshToken"); if (m_szAccessToken.IsEmpty()) { auto *pReq = new AsyncHttpRequest(REQUEST_POST, HOST_LOGIN, "/common/oauth2/devicecode", &CTeamsProto::OnReceiveDeviceToken); pReq << CHAR_PARAM("client_id", TEAMS_CLIENT_ID) << CHAR_PARAM("resource", TEAMS_OAUTH_RESOURCE); PushRequest(pReq); } + // or use a refresh token otherwise else { RefreshToken(TEAMS_OAUTH_SCOPE SCOPE_SUFFIX, &CTeamsProto::OnRefreshAccessToken); OauthRefreshServices(); diff --git a/protocols/Teams/src/teams_options.cpp b/protocols/Teams/src/teams_options.cpp index e5334a0985..6191f15a41 100644 --- a/protocols/Teams/src/teams_options.cpp +++ b/protocols/Teams/src/teams_options.cpp @@ -45,7 +45,7 @@ public: bool OnInitDialog() override { - m_login.SetTextA(ptrA(m_proto->getStringA(SKYPE_SETTINGS_ID))); + m_login.SetTextA(ptrA(m_proto->getStringA(DBKEY_ID))); m_password.SetTextA(pass_ptrA(m_proto->getStringA("Password"))); m_place.Enable(!m_proto->m_bUseHostnameAsPlace); m_login.SendMsg(EM_LIMITTEXT, 128, 0); @@ -57,12 +57,12 @@ public: bool OnApply() override { ptrA szNewSkypename(m_login.GetTextA()), - szOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID)); + szOldSkypename(m_proto->getStringA(DBKEY_ID)); pass_ptrA szNewPassword(m_password.GetTextA()), szOldPassword(m_proto->getStringA("Password")); if (mir_strcmpi(szNewSkypename, szOldSkypename) || mir_strcmp(szNewPassword, szOldPassword)) m_proto->delSetting("TokenExpiresIn"); - m_proto->setString(SKYPE_SETTINGS_ID, szNewSkypename); + m_proto->setString(DBKEY_ID, szNewSkypename); m_proto->setString("Password", szNewPassword); ptrW group(m_group.GetText()); if (mir_wstrlen(group) > 0 && !Clist_GroupExists(group)) diff --git a/protocols/Teams/src/teams_proto.cpp b/protocols/Teams/src/teams_proto.cpp index c2dabdfc1c..9dfa1baab0 100644 --- a/protocols/Teams/src/teams_proto.cpp +++ b/protocols/Teams/src/teams_proto.cpp @@ -9,7 +9,7 @@ CTeamsProto::CTeamsProto(const char *protoName, const wchar_t *userName) : m_bAutoHistorySync(this, "AutoSync", true), m_bUseHostnameAsPlace(this, "UseHostName", true), m_bUseBBCodes(this, "UseBBCodes", true), - m_wstrCListGroup(this, SKYPE_SETTINGS_GROUP, L"Skype"), + m_wstrCListGroup(this, DBKEY_GROUP, L"Skype"), m_wstrPlace(this, "Place", L""), m_iMood(this, "Mood", 0), m_wstrMoodEmoji(this, "MoodEmoji", L""), @@ -43,7 +43,6 @@ CTeamsProto::CTeamsProto(const char *protoName, const wchar_t *userName) : g_plugin.addSound("skype_inc_call", L"SkypeWeb", LPGENW("Incoming call")); g_plugin.addSound("skype_call_canceled", L"SkypeWeb", LPGENW("Incoming call canceled")); - CheckConvert(); InitGroupChatModule(); } diff --git a/protocols/Teams/src/teams_proto.h b/protocols/Teams/src/teams_proto.h index 9066d56079..850aae8808 100644 --- a/protocols/Teams/src/teams_proto.h +++ b/protocols/Teams/src/teams_proto.h @@ -1,10 +1,7 @@ #define TEAMS_CLIENT_ID "8ec6bc83-69c8-4392-8f08-b3c986009232" -#define SKYPE_SETTINGS_ID "SkypeId" -#define SKYPE_SETTINGS_LOGIN "Skypename" -#define SKYPE_SETTINGS_USERTYPE "UserType" -#define SKYPE_SETTINGS_PASSWORD "Password" -#define SKYPE_SETTINGS_GROUP "DefaultGroup" +#define DBKEY_ID "id" +#define DBKEY_GROUP "DefaultGroup" struct COwnMessage { @@ -172,7 +169,7 @@ public: MCONTACT m_hMyContact; __forceinline CMStringA getId(MCONTACT hContact) { - return getMStringA(hContact, SKYPE_SETTINGS_ID); + return getMStringA(hContact, DBKEY_ID); } void OnSearch(MHttpResponse *response, AsyncHttpRequest *pRequest); @@ -211,9 +208,6 @@ public: void OnGetChatInfo(MHttpResponse *response, AsyncHttpRequest *pRequest); void OnGetChatMembers(MHttpResponse *response, AsyncHttpRequest *pRequest); - void CheckConvert(void); - bool CheckOauth(const char *szResponse); - void LoadProfile(MHttpResponse *response, AsyncHttpRequest *pRequest); static INT_PTR __cdecl GlobalParseSkypeUriService(WPARAM, LPARAM lParam); |
