From 7639dcb4995b13c2756f9d59e0a67e22cba57a38 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 3 Feb 2024 11:38:33 +0100 Subject: Correctly show reactions with more than 50 users in v3.0.0 If a reaction has more than 50 users, the list of users will be cropped to just 50 users. This made the counts wrong since we used the number of users rather than the count property. Fix it by using the count property instead and adding "and others" to the list of users if show_reaction_nicks is enabled (the same as the Slack client shows when you hover over the reaction). This is the same fix as in commit 6b388cd9, but for version 3.0.0. --- mock_data/slack_users_info_person.json | 49 ------------------------------ mock_data/slack_users_info_person_1.json | 51 ++++++++++++++++++++++++++++++++ mock_data/slack_users_info_person_2.json | 51 ++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 49 deletions(-) delete mode 100644 mock_data/slack_users_info_person.json create mode 100644 mock_data/slack_users_info_person_1.json create mode 100644 mock_data/slack_users_info_person_2.json (limited to 'mock_data') diff --git a/mock_data/slack_users_info_person.json b/mock_data/slack_users_info_person.json deleted file mode 100644 index 14e80f8..0000000 --- a/mock_data/slack_users_info_person.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "ok": true, - "user": { - "id": "U017V7T2D40", - "team_id": "T0FC8BFQR", - "name": "trygveaa_wee-slack-te", - "deleted": false, - "color": "684b6c", - "real_name": "Test 1", - "tz": "Europe/Amsterdam", - "tz_label": "Central European Time", - "tz_offset": 3600, - "profile": { - "title": "", - "phone": "", - "skype": "", - "real_name": "Test 1", - "real_name_normalized": "Test 1", - "display_name": "Test 1", - "display_name_normalized": "Test 1", - "fields": {}, - "status_text": "", - "status_emoji": "", - "status_emoji_display_info": [], - "status_expiration": 0, - "avatar_hash": "g57ba37781eb", - "email": "trygveaa+wee-slack-test.1@gmail.com", - "image_24": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-24.png", - "image_32": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-32.png", - "image_48": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-48.png", - "image_72": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-72.png", - "image_192": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-192.png", - "image_512": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-512.png", - "status_text_canonical": "", - "team": "T0FC8BFQR" - }, - "is_admin": false, - "is_owner": false, - "is_primary_owner": false, - "is_restricted": false, - "is_ultra_restricted": false, - "is_bot": false, - "is_app_user": false, - "updated": 1664912039, - "is_email_confirmed": true, - "has_2fa": false, - "who_can_share_contact_card": "EVERYONE" - } -} diff --git a/mock_data/slack_users_info_person_1.json b/mock_data/slack_users_info_person_1.json new file mode 100644 index 0000000..60dff7d --- /dev/null +++ b/mock_data/slack_users_info_person_1.json @@ -0,0 +1,51 @@ +{ + "ok": true, + "user": { + "id": "U017V7T2D40", + "team_id": "T0FC8BFQR", + "name": "trygveaa_wee-slack-te", + "deleted": false, + "color": "684b6c", + "real_name": "Test 1", + "tz": "Europe/Amsterdam", + "tz_label": "Central European Time", + "tz_offset": 3600, + "profile": { + "title": "", + "phone": "", + "skype": "", + "real_name": "Test 1", + "real_name_normalized": "Test 1", + "display_name": "Test 1", + "display_name_normalized": "Test 1", + "fields": null, + "status_text": "", + "status_emoji": "", + "status_emoji_display_info": [], + "status_expiration": 0, + "avatar_hash": "g57ba37781eb", + "email": "trygveaa+wee-slack-test.1@gmail.com", + "first_name": "Test", + "last_name": "1", + "image_24": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-24.png", + "image_32": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-32.png", + "image_48": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-48.png", + "image_72": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-72.png", + "image_192": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-192.png", + "image_512": "https://secure.gravatar.com/avatar/57ba37781ebc7fcdf8cc9812dce9c407.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-512.png", + "status_text_canonical": "", + "team": "T0FC8BFQR" + }, + "is_admin": false, + "is_owner": false, + "is_primary_owner": false, + "is_restricted": false, + "is_ultra_restricted": false, + "is_bot": false, + "is_app_user": false, + "updated": 1703064325, + "is_email_confirmed": true, + "has_2fa": false, + "who_can_share_contact_card": "EVERYONE" + } +} diff --git a/mock_data/slack_users_info_person_2.json b/mock_data/slack_users_info_person_2.json new file mode 100644 index 0000000..3927802 --- /dev/null +++ b/mock_data/slack_users_info_person_2.json @@ -0,0 +1,51 @@ +{ + "ok": true, + "user": { + "id": "U0175CGFJRY", + "team_id": "T0FC8BFQR", + "name": "trygveaa_wee-slack195", + "deleted": false, + "color": "5b89d5", + "real_name": "Test 2", + "tz": "Europe/Amsterdam", + "tz_label": "Central European Time", + "tz_offset": 3600, + "profile": { + "title": "", + "phone": "", + "skype": "", + "real_name": "Test 2", + "real_name_normalized": "Test 2", + "display_name": "Test 2", + "display_name_normalized": "Test 2", + "fields": null, + "status_text": "", + "status_emoji": "", + "status_emoji_display_info": [], + "status_expiration": 0, + "avatar_hash": "g7da9d26b2e9", + "email": "trygveaa+wee-slack-test.2@gmail.com", + "first_name": "Test", + "last_name": "2", + "image_24": "https://secure.gravatar.com/avatar/7da9d26b2e952f62a1b1755dbb798975.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-24.png", + "image_32": "https://secure.gravatar.com/avatar/7da9d26b2e952f62a1b1755dbb798975.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-32.png", + "image_48": "https://secure.gravatar.com/avatar/7da9d26b2e952f62a1b1755dbb798975.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-48.png", + "image_72": "https://secure.gravatar.com/avatar/7da9d26b2e952f62a1b1755dbb798975.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-72.png", + "image_192": "https://secure.gravatar.com/avatar/7da9d26b2e952f62a1b1755dbb798975.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-192.png", + "image_512": "https://secure.gravatar.com/avatar/7da9d26b2e952f62a1b1755dbb798975.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0006-512.png", + "status_text_canonical": "", + "team": "T0FC8BFQR" + }, + "is_admin": false, + "is_owner": false, + "is_primary_owner": false, + "is_restricted": false, + "is_ultra_restricted": false, + "is_bot": false, + "is_app_user": false, + "updated": 1664912039, + "is_email_confirmed": true, + "has_2fa": false, + "who_can_share_contact_card": "EVERYONE" + } +} -- cgit