From 631aa6353c6df9b20d96f60970c53c27e6a92f84 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Tue, 1 Oct 2019 19:35:13 +0200 Subject: Add basic support for private channels converted from public This is for channels which initially were public, but then are changed to private. They look the same as groups (channels initially created as private) in the official clients, but can only be used with the conversations api. They are listed in the channels list of rtm.start with is_private set to true. There are some remaining issues, which are documented in the readme. I'm not sure if we can support read sync and showing unread on load without changes from Slack to the API. Showing thread messages in the channel is possible to fix, but we would have to send requests to load the thread history for all the messages in the history that has replies. Fixes most of #644 --- _pytest/data/http/rtm.start.json | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to '_pytest/data') diff --git a/_pytest/data/http/rtm.start.json b/_pytest/data/http/rtm.start.json index 1d395b4..8caee41 100644 --- a/_pytest/data/http/rtm.start.json +++ b/_pytest/data/http/rtm.start.json @@ -311,6 +311,7 @@ "is_org_shared": false, "has_pins": false, "is_member": true, + "is_private": false, "last_read": "1485976236.000019", "latest": { "type": "message", @@ -398,6 +399,7 @@ "is_org_shared": false, "has_pins": false, "is_member": false, + "is_private": false, "previous_names": [] }, { @@ -412,6 +414,7 @@ "is_org_shared": false, "has_pins": false, "is_member": true, + "is_private": false, "last_read": "1485969592.000002", "latest": { "user": "U4096CBHC", @@ -451,9 +454,50 @@ "is_org_shared": false, "has_pins": false, "is_member": false, + "is_private": false, "previous_names": [ "some-channel2" ] + }, + { + "id": "CNZQKUU9M", + "name": "channel-created-as-public-then-converted-to-private", + "is_channel": true, + "is_group": false, + "is_im": false, + "created": 1569952842, + "is_archived": false, + "is_general": false, + "unlinked": 0, + "name_normalized": "channel-created-as-public-then-converted-to-private", + "is_shared": false, + "parent_conversation": null, + "creator": "U407ABLLW", + "is_ext_shared": false, + "is_org_shared": false, + "shared_team_ids": [ + "T3YS5EAL9" + ], + "pending_shared": [], + "pending_connected_team_ids": [], + "is_pending_ext_shared": false, + "has_pins": false, + "is_member": true, + "is_private": true, + "is_mpim": false, + "last_read": "1569952877.000300", + "is_open": true, + "topic": { + "value": "", + "creator": "", + "last_set": 0 + }, + "purpose": { + "value": "", + "creator": "", + "last_set": 0 + }, + "priority": 0 } ], "groups": [ -- cgit