Skip to content
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
1 change: 1 addition & 0 deletions json-logs/samples/api/conversations.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"is_read_only": false,
"is_thread_only": false,
"is_non_threadable": false,
"is_file": false,
"internal_team_ids": [
"T00000000"
],
Expand Down
1 change: 1 addition & 0 deletions json-logs/samples/api/conversations.list.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"is_mpim": false,
"is_private": false,
"is_general": false,
"is_file": false,
"unlinked": 12345,
"name_normalized": "",
"is_shared": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

import com.slack.api.methods.response.conversations.ConversationsInfoResponse;
import com.slack.api.methods.response.conversations.ConversationsListResponse;
import com.slack.api.util.json.GsonFactory;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class ConversationTest implements Verifier {

@Test
Expand All @@ -16,4 +20,12 @@ public void parseConversationsListResponse() throws Exception {
verifyParsing("conversations.list", ConversationsListResponse.class);
}

@Test
public void parseFileConversation() {
String json = "{\"ok\":true,\"channel\":{\"id\":\"C0123456789\",\"is_channel\":true,\"is_private\":true,"
+ "\"is_file\":true,\"is_thread_only\":true,\"name_normalized\":\"FC:F0123456789:Project notes\"}}";
ConversationsInfoResponse resp = GsonFactory.createSnakeCase().fromJson(json, ConversationsInfoResponse.class);
assertThat(resp.getChannel().isFile(), is(true));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public class Conversation {
private boolean isThreadOnly;
@SerializedName("is_non_threadable")
private boolean isNonThreadable;
@SerializedName("is_file")
private boolean isFile;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

praise: Thanks for adding is_file here! It matches how ChannelCreatedEvent.Channel already maps it, so canvas conversations are easy to spot now.

@SerializedName("is_shared")
private boolean isShared;
@SerializedName("is_ext_shared")
Expand Down
Loading