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

Issue #251 - Fix Warning "event of type UNKNOWN not handled" #252

Closed
wants to merge 1 commit into from
Closed
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
385 changes: 0 additions & 385 deletions simpleslackapi.ipr

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public enum EventType
PIN_ADDED("pin_added"),
PIN_REMOVED("pin_removed"),
USER_TYPING("user_typing"),
HELLO("hello"),
OTHER("-");

private static final Map<String, EventType> CODE_MAP = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.ullink.slack.simpleslackapi.events;

public class Hello implements SlackEvent {
@Override
public SlackEventType getEventType() {
return SlackEventType.HELLO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ public enum SlackEventType {
PIN_REMOVED,
USER_TYPING,
UNKNOWN,
SLACK_DISCONNECTED;
SLACK_DISCONNECTED,
HELLO
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class SlackJSONMessageParser {
private static final Logger LOGGER = LoggerFactory.getLogger(SlackJSONMessageParser.class);

public static enum SlackMessageSubType
public enum SlackMessageSubType
{
CHANNEL_JOIN("channel_join"), CHANNEL_LEAVE("channel_leave"), MESSAGE_CHANGED("message_changed"), MESSAGE_DELETED("message_deleted"), OTHER("-"), FILE_SHARE("file_share"), MESSAGE_REPLIED("message_replied");

Expand Down Expand Up @@ -96,6 +96,8 @@ static SlackEvent decode(SlackSession slackSession, JsonObject obj) {
return extractPinRemovedEvent(slackSession, obj);
case USER_TYPING:
return extractUserTypingEvent(slackSession, obj);
case HELLO:
return new Hello();
default:
return new UnknownEvent(obj.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ void dispatch(SlackEvent event) {
case USER_TYPING:
dispatchImpl((UserTyping) event, userTypingListener);
break;
case HELLO:
// don't need to dispatch this
break;
default:
LOGGER.warn("event of type " + event.getEventType() + " not handled: " + ((UnknownEvent)event).getJsonPayload());
}
Expand Down