From a191708db7a3edc99d9567efa523c75d03c134f3 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 8 May 2021 20:11:37 +0200 Subject: Support mpim_aware RTM API Apparently, the API now sends an mpim_joined event when an MPIM is created instead of a group_joined event, even if we don't set mpim_aware to true. Instead of just handling mpim_joined in addition to group_joined (which could cause issues if both are called for MPIMs, though I haven't experienced that), it's better to properly support mpim_aware. Fixes #825, fixes #833 --- _pytest/data/http/rtm.start.json | 154 ++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 76 deletions(-) (limited to '_pytest/data') diff --git a/_pytest/data/http/rtm.start.json b/_pytest/data/http/rtm.start.json index 8caee41..972df4b 100644 --- a/_pytest/data/http/rtm.start.json +++ b/_pytest/data/http/rtm.start.json @@ -501,82 +501,6 @@ } ], "groups": [ - { - "id": "G3ZGMF4RZ", - "name": "mpdm-bob--alice--charles-1", - "is_group": true, - "created": 1485975690, - "creator": "U407ABLLW", - "is_archived": false, - "is_mpim": true, - "has_pins": false, - "is_open": true, - "last_read": "0000000000.000000", - "latest": { - "type": "message", - "subtype": "file_share", - "text": "<@U407ABLLW|alice> uploaded a file: ", - "file": { - "id": "F3ZLY6K5J", - "created": 1485975715, - "timestamp": 1485975715, - "name": "-.txt", - "title": "Untitled", - "mimetype": "text\/plain", - "filetype": "text", - "pretty_type": "Plain Text", - "user": "U407ABLLW", - "editable": true, - "size": 14, - "mode": "snippet", - "is_external": false, - "external_type": "", - "is_public": false, - "public_url_shared": false, - "display_as_bot": false, - "username": "", - "url_private": "https:\/\/files.slack.com\/files-pri\/T3YS5EAL9-F3ZLY6K5J\/-.txt", - "url_private_download": "https:\/\/files.slack.com\/files-pri\/T3YS5EAL9-F3ZLY6K5J\/download\/-.txt", - "permalink": "https:\/\/weeslacktest.slack.com\/files\/alice\/F3ZLY6K5J\/-.txt", - "permalink_public": "https:\/\/slack-files.com\/T3YS5EAL9-F3ZLY6K5J-39c2c4f739", - "edit_link": "https:\/\/weeslacktest.slack.com\/files\/alice\/F3ZLY6K5J\/-.txt\/edit", - "preview": "some code here", - "preview_highlight": "
\n
\n
some code here<\/pre><\/div>\n<\/div>\n<\/div>\n",
-                    "lines": 1,
-                    "lines_more": 0,
-                    "preview_is_truncated": false,
-                    "channels": [],
-                    "groups": [
-                        "G3ZGMF4RZ"
-                    ],
-                    "ims": [],
-                    "comments_count": 0
-                },
-                "user": "U407ABLLW",
-                "upload": true,
-                "display_as_bot": false,
-                "username": "<@U407ABLLW|alice>",
-                "bot_id": null,
-                "ts": "1485975715.000005"
-            },
-            "unread_count": 1,
-            "unread_count_display": 1,
-            "members": [
-                "U407ABLLW",
-                "U3ZKBBDL5",
-                "U4096CBHC"
-            ],
-            "topic": {
-                "value": "Group messaging",
-                "creator": "U407ABLLW",
-                "last_set": 1485975690
-            },
-            "purpose": {
-                "value": "Group messaging with: @bob @alice @charles",
-                "creator": "U407ABLLW",
-                "last_set": 1485975690
-            }
-        },
         {
             "id": "G3ZJKP7GA",
             "name": "some-private-channel",
@@ -716,6 +640,84 @@
     "cache_ts": 1485977062,
     "read_only_channels": [],
     "can_manage_shared_channels": false,
+    "mpims": [
+        {
+            "id": "G3ZGMF4RZ",
+            "name": "mpdm-bob--alice--charles-1",
+            "is_group": true,
+            "created": 1485975690,
+            "creator": "U407ABLLW",
+            "is_archived": false,
+            "is_mpim": true,
+            "has_pins": false,
+            "is_open": true,
+            "last_read": "0000000000.000000",
+            "latest": {
+                "type": "message",
+                "subtype": "file_share",
+                "text": "<@U407ABLLW|alice> uploaded a file: ",
+                "file": {
+                    "id": "F3ZLY6K5J",
+                    "created": 1485975715,
+                    "timestamp": 1485975715,
+                    "name": "-.txt",
+                    "title": "Untitled",
+                    "mimetype": "text\/plain",
+                    "filetype": "text",
+                    "pretty_type": "Plain Text",
+                    "user": "U407ABLLW",
+                    "editable": true,
+                    "size": 14,
+                    "mode": "snippet",
+                    "is_external": false,
+                    "external_type": "",
+                    "is_public": false,
+                    "public_url_shared": false,
+                    "display_as_bot": false,
+                    "username": "",
+                    "url_private": "https:\/\/files.slack.com\/files-pri\/T3YS5EAL9-F3ZLY6K5J\/-.txt",
+                    "url_private_download": "https:\/\/files.slack.com\/files-pri\/T3YS5EAL9-F3ZLY6K5J\/download\/-.txt",
+                    "permalink": "https:\/\/weeslacktest.slack.com\/files\/alice\/F3ZLY6K5J\/-.txt",
+                    "permalink_public": "https:\/\/slack-files.com\/T3YS5EAL9-F3ZLY6K5J-39c2c4f739",
+                    "edit_link": "https:\/\/weeslacktest.slack.com\/files\/alice\/F3ZLY6K5J\/-.txt\/edit",
+                    "preview": "some code here",
+                    "preview_highlight": "
\n
\n
some code here<\/pre><\/div>\n<\/div>\n<\/div>\n",
+                    "lines": 1,
+                    "lines_more": 0,
+                    "preview_is_truncated": false,
+                    "channels": [],
+                    "groups": [
+                        "G3ZGMF4RZ"
+                    ],
+                    "ims": [],
+                    "comments_count": 0
+                },
+                "user": "U407ABLLW",
+                "upload": true,
+                "display_as_bot": false,
+                "username": "<@U407ABLLW|alice>",
+                "bot_id": null,
+                "ts": "1485975715.000005"
+            },
+            "unread_count": 1,
+            "unread_count_display": 1,
+            "members": [
+                "U407ABLLW",
+                "U3ZKBBDL5",
+                "U4096CBHC"
+            ],
+            "topic": {
+                "value": "Group messaging",
+                "creator": "U407ABLLW",
+                "last_set": 1485975690
+            },
+            "purpose": {
+                "value": "Group messaging with: @bob @alice @charles",
+                "creator": "U407ABLLW",
+                "last_set": 1485975690
+            }
+        }
+    ],
     "subteams": {
         "all": [
           {
-- 
cgit