w31slack
A proof-of-concept Slack client for Windows for Workgroups (WFW) 3.11 with tests. As there are no native HTTPS APIs for the ancient version of Winsock on WFW, a HTTP-to-HTTPS proxy like this one I've written is needed.
Screenshot of the app
Video of the app in action with a modern Mac Slack client on the side for verification.
Development and compilation setup
To compile and run the application, you'll need Visual C++ (VC++) 1.52 running on a 32-bit Windows OS up to Windows 10. Windows 3.1 is not required. I use a Windows 2000 VM as it is the oldest and lightest 32-bit Windows OS with full Virtualbox support.
Coding the app can thus be done on a native Mac or Windows OS with modern text editors.
Even though a 16-bit app can run on modern 32-bit OS, I still recommend occasional testing on a native Windows 3.1 system as VMs can be too perfect sometimes.
- Install Windows 2000 VM on a host PC. If you want to share files out of the Win 2K VM, set the network to
Bridged
. - Install VC++ 1.52
- Set up Virtualbox shared folder between the host and Win 2K WM
- Map a network drive to the local shared folder
- VC++ 1.52 can see a network drive and open the
w31slack.mak
- Just click Project -> Rebuild all.
The w16slack.exe
binary should be available in the same directory.
Executing the unit tests
I wrote a custom unit test framework as I could not find a testing framework for C89 that'll work with VC++ 1.52. 2 Go Programs acting as mock servers are required to be run to test the network APIs.
go run mockprox.go
will reply the GET and POST requests by replaying the contents of theou*.txt
files.go run replay.go 30000
will replay whatever was received on a pure TCP socket connection.- Edit the file
tstconst.h
to suit your system especially theTEST_MOCK_SERVER_IP
- Open the file
test.mak
- Build Project as per normal and run the binary in debug mode. You'll see the following
Running the app
- Make sure to grab the binary and sample config files from the release directory.
- First create an app for your associated workspace.
- Add these permissions to your app
channels:history
,channels:read
,chat:write:user
,groups:history
,identify
,im:history
,users:read
. - Go to "OAuth & Permissions" section and get your OAuth Access Token. The URL should be https://api.slack.com/apps/XXXappIDXXX/oauth?
- Start up http-to-https-proxy
- Modify the file
w31slack.ini
configuration file to suit your needs. Fields in this order, token, server polling rate in milliseconds, IP address of proxy, port of proxy, number of messages to get to display. - Start up the
w31slack.exe
. The binary and example config file is in therelease
folder. - Profit!
Workaround to large numbers of users and channels
The app may fail if the number of users and channels in the workspace are huge. That results in too large a Json reply. To mitigate this, you can provide a file containing the id and channel/user combination for manual loading into app.
- Create the file
userchan.ids
in the same directory as the binary. - Fill in line by line in this format
channelID channelname
- Users are also filled in the same file and format
userID username
Take a look at the sample file sample-userchan.ids
.
To get the IDs, you can use these curl commands to get the Json and manually populate the file.
curl -H "Authorization: Bearer xoxp-821448956678-818775000324-818797461140-4d175b4e14b948d630f195e51478bb0e" -X GET "https://slack.com/api/conversations.list"
curl -H "Authorization: Bearer xoxp-821448956678-818775000324-818797461140-4d175b4e14b948d630f195e51478bb0e" -X GET "https://slack.com/api/users.list"