Skip to content

Commit

Permalink
1.0.8:
Browse files Browse the repository at this point in the history
* Fixed Slack message not successfully going through if debug mode is off
* Made raw Slack output JSON use isSlackDebug config
  • Loading branch information
RoyCurtis committed Apr 27, 2016
1 parent 76b6699 commit c2136dd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.rafaskb.ticketmaster</groupId>
<artifactId>TicketMaster</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>

<developers>
<developer>
Expand Down
19 changes: 11 additions & 8 deletions src/main/java/me/rafaskb/ticketmaster/integrations/Slack.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ public static void sendMessage(String message, String username, String world, do
conn.setDoOutput(true);
conn.getOutputStream().write(postDataBytes);

if (ConfigLoader.isSlackDebug()) {
Reader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String response = "";
for (int c = in.read(); c != -1; c = in.read()) {
response += (char) c;
}
// Apparently necessary for post to actually go through
Reader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String response = "";
for (int c = in.read(); c != -1; c = in.read()) {
response += (char) c;
}

TicketMaster.getInstance().getLogger().info("message from Slack server: " + response);
if (ConfigLoader.isSlackDebug()) {
TicketMaster.getInstance().getLogger().info("Message from Slack server: " + response);
}

} catch (IOException e) {
Expand All @@ -70,7 +71,9 @@ private static String generateMessage(String message, String username, String wo
m+= "\"icon_url\":\"https://minotar.net/avatar/"+username+"/100.png\"";
m+= "}";

System.out.println(m);
if (ConfigLoader.isSlackDebug()) {
TicketMaster.getInstance().getLogger().info("Raw outgoing Slack JSON: " + m);
}
return m;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: TicketMaster
main: me.rafaskb.ticketmaster.TicketMaster
version: 1.0.6
version: 1.0.8
author: RafaSKB
description: Ticket manager

Expand Down

0 comments on commit c2136dd

Please sign in to comment.