Skip to content

Commit

Permalink
FIX integrations are now listed in users
Browse files Browse the repository at this point in the history
  • Loading branch information
bcorne committed Aug 22, 2016
1 parent 987e2ae commit ed61f2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ void parse() throws ParseException {
for (Object jsonObject : integrationsJson)
{
JSONObject jsonIntegration = (JSONObject) jsonObject;
SlackUser slackUser = SlackJSONParsingUtils.buildSlackUser(jsonIntegration);
SlackIntegration slackIntegration = SlackJSONParsingUtils.buildSlackIntegration(jsonIntegration);
LOGGER.debug("slack integration found : " + slackIntegration.getId());
integrations.put(slackIntegration.getId(), slackIntegration);
users.put(slackUser.getId(), slackUser);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void testParsingSessionDescription() throws Exception
parser.parse();

assertThat(parser.getChannels()).containsOnlyKeys("CHANNELID1", "CHANNELID2", "CHANNELID3", "GROUPID1", "DIM01");
assertThat(parser.getUsers()).containsOnlyKeys("USERID1","USERID2","USERID3","USERID4","BOTID1","BOTID2");
assertThat(parser.getUsers()).containsOnlyKeys("USERID1","USERID2","USERID3","USERID4","BOTID1","BOTID2","INTEGRATION1","INTEGRATION2");
assertThat(parser.getWebSocketURL()).isEqualTo("wss://mywebsocketurl");
assertThat(parser.getUsers().get("USERID1").getTimeZone()).isEqualTo("Europe/Amsterdam");
assertThat(parser.getUsers().get("USERID1").getTimeZoneLabel()).isEqualTo("Central European Summer Time");
Expand Down

3 comments on commit ed61f2b

@redcraft
Copy link
Contributor

Choose a reason for hiding this comment

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

@bcorne this commit brings back an issue which I was fixing in previous pull request. We can't merge users and integrations together, as they are completely different entities. You can't request presence for integration but you can request it for user. Please review comment from my previous commit for more details. If you still have question feel free to contact me directly.

@bcorne
Copy link
Contributor Author

@bcorne bcorne commented on ed61f2b Aug 22, 2016

Choose a reason for hiding this comment

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

so we need to have a way to search for integrations since they can post messages. Right now the library fails to parse messages sent by such integrations

@bcorne
Copy link
Contributor Author

@bcorne bcorne commented on ed61f2b Aug 22, 2016

Choose a reason for hiding this comment

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

I'll handle that

Please sign in to comment.