Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reactions to conversation history #239

Merged
merged 5 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public interface LiteMessageIF {

List<Block> getBlocks();

List<Reaction> getReactions();

@JsonProperty("ts")
String getTimestamp();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.hubspot.slack.client.models;

import java.util.List;

import org.immutables.value.Value.Immutable;

import com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.hubspot.immutables.style.HubSpotStyle;

@Immutable
@HubSpotStyle
@JsonNaming(SnakeCaseStrategy.class)
public interface ReactionIF {
String getName();
int getCount();
List<String> getUsers();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public void itDeserializesWithRepliesAndNewFields() throws IOException {
assertThat(response.getMessages().get(0).getReplyUserIds().get()).isEqualTo(Arrays.asList("U061F7AUR", "U061F7AUR", "U061F7AUR"));
assertThat(response.getMessages().get(0).getReplyUsersCount().get()).isEqualTo(3);
assertThat(response.getMessages().get(0).getLatestReplyTimestamp().get()).isEqualTo("1483125339.020269");
assertThat(response.getMessages().get(1).getReactions().size()).isEqualTo(2);
assertThat(response.getMessages().get(1).getReactions().get(0).getName()).isEqualTo("astonished");
assertThat(response.getMessages().get(1).getReactions().get(0).getCount()).isEqualTo(3);
assertThat(response.getMessages().get(1).getReactions().get(1).getName()).isEqualTo("facepalm");
assertThat(response.getMessages().get(1).getReactions().get(1).getCount()).isEqualTo(34);
assertThat(response.getMessages().get(1).getReactions().get(1).getUsers()).isEqualTo(Arrays.asList("U061F7AUR", "U062F7AUR", "U063F7AUR", "U064F7AUR", "U065F7AUR"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@
"text": "Shutters shut and shutters and so shutters shut and shutters and so and so shutters and so shutters shut and so shutters shut and shutters and so.",
"thread_ts": "1482960137.003543",
"parent_user_id": "U061F7AUR",
"ts": "1483037603.017503"
"ts": "1483037603.017503",
"reactions": [
{
"name": "astonished",
"count": 3,
"users": [ "U061F7AUR", "U062F7AUR", "U063F7AUR"]
},
{
"name": "facepalm",
"count": 34,
"users": [ "U061F7AUR", "U062F7AUR", "U063F7AUR", "U064F7AUR", "U065F7AUR" ]
}
]
Comment on lines +39 to +50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these.
Can we also please make sure that these reactions are parsed in the corresponding integration test?

},
{
"type": "message",
Expand Down