From a1a24d7c19aab41c3f10da921cf3e345a00e63e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pailler?= Date: Mon, 7 Jun 2021 09:41:43 +0800 Subject: [PATCH] Replace retired *History() methods with GetConversationsHistory() (#22) * Add SlackAPI as submodule * Use locally built SlackAPI instead of the NuGet package to get the latest improvements/bugfixes * Use GetConversationHistory method to replace retired methods. Use Parallel.Foreach to speed up initial synchronization * Update appveyor.yml to initialize submodules --- .gitmodules | 3 ++ Luxa4Slack.sln | 6 +++ appveyor.yml | 9 +++- src/Luxa4Slack/Luxa4Slack.csproj | 10 ++-- .../MessageHandlers/ChannelHandlerBase.cs | 6 +-- .../MessageHandlers/Channelhandler.cs | 2 +- .../MessageHandlers/GroupHandler.cs | 2 +- src/Luxa4Slack/MessageHandlers/ImHandler.cs | 51 ++++++++++++++----- .../MessageHandlers/MessageHandlerBase.cs | 13 +++++ src/Luxa4Slack/packages.config | 1 - vendor/SlackAPI | 1 + 11 files changed, 79 insertions(+), 25 deletions(-) create mode 100644 .gitmodules create mode 160000 vendor/SlackAPI diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..54146ec --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/SlackAPI"] + path = vendor/SlackAPI + url = https://github.com/Inumedia/SlackAPI.git diff --git a/Luxa4Slack.sln b/Luxa4Slack.sln index 2d2223f..b18973e 100644 --- a/Luxa4Slack.sln +++ b/Luxa4Slack.sln @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luxa4Slack.OAuth.AzureFunct EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{C8AD61D9-1BAA-4B0E-A980-AC7CBF60C29C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SlackAPI", "vendor\SlackAPI\SlackAPI\SlackAPI.csproj", "{72DA7C19-43C1-4829-97BA-34D85E83290E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -43,6 +45,10 @@ Global {97C3955F-215E-4E71-942F-7BE2A9749A59}.Debug|Any CPU.Build.0 = Debug|Any CPU {97C3955F-215E-4E71-942F-7BE2A9749A59}.Release|Any CPU.ActiveCfg = Release|Any CPU {97C3955F-215E-4E71-942F-7BE2A9749A59}.Release|Any CPU.Build.0 = Release|Any CPU + {72DA7C19-43C1-4829-97BA-34D85E83290E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72DA7C19-43C1-4829-97BA-34D85E83290E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72DA7C19-43C1-4829-97BA-34D85E83290E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72DA7C19-43C1-4829-97BA-34D85E83290E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/appveyor.yml b/appveyor.yml index 383c5ed..53dba9a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,13 @@ image: - Visual Studio 2019 +clone_script: + - cmd: >- + git clone -q --branch=%APPVEYOR_REPO_BRANCH% https://github.com/%APPVEYOR_REPO_NAME%.git %APPVEYOR_BUILD_FOLDER% + && cd %APPVEYOR_BUILD_FOLDER% + && git checkout -qf %APPVEYOR_REPO_COMMIT% + && git submodule update --init --recursive + build_script: - ps: .\build.ps1 Pack BuildInstaller @@ -9,4 +16,4 @@ artifacts: name: Artifact - path: artifacts/Luxa4Slack.Installer-*.exe - name: Installer \ No newline at end of file + name: Installer diff --git a/src/Luxa4Slack/Luxa4Slack.csproj b/src/Luxa4Slack/Luxa4Slack.csproj index d8538cf..2bcf88f 100644 --- a/src/Luxa4Slack/Luxa4Slack.csproj +++ b/src/Luxa4Slack/Luxa4Slack.csproj @@ -50,10 +50,6 @@ ..\..\packages\NLog.4.6.8\lib\net45\NLog.dll True - - ..\..\packages\SlackAPI.1.2.0-pullrequest0016\lib\net45\SlackAPI.dll - True - @@ -111,6 +107,12 @@ + + + {72da7c19-43c1-4829-97ba-34d85e83290e} + SlackAPI + +