Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Chat: Added Purge Message/UserUpdate Events, Fixed Delete Message Event #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -21,6 +21,8 @@ public static enum EventType {
@SerializedName("Stats") STATS (StatusEvent.class),
@SerializedName("UserJoin") USER_JOIN (UserJoinEvent.class),
@SerializedName("UserLeave") USER_LEAVE (UserLeaveEvent.class);
@SerializedName("UserUpdate") USER_UPDATE (UserUpdateEvent.class),
@SerializedName("PurgeMessage") PURGE_MESSAGE (PurgeMessageEvent.class);

private final Class<? extends AbstractChatEvent> correspondingClass;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

public class DeleteMessageEvent extends AbstractChatEvent<DeleteMessageData> {
public DeleteMessageEvent() {
this.type = Type.EVENT;
this.event = EventType.DELETE_MESSAGE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.mixer.api.resource.chat.events;

import com.mixer.api.resource.chat.AbstractChatEvent;
import com.mixer.api.resource.chat.events.data.PurgeMessageData;

public class PurgeMessageEvent extends AbstractChatEvent<PurgeMessageData> {
public PurgeMessageEvent() {
this.event = EventType.PURGE_MESSAGE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.mixer.api.resource.chat.events;

import com.mixer.api.resource.chat.AbstractChatEvent;
import com.mixer.api.resource.chat.events.data.UserUpdateData;

public class UserUpdateEvent extends AbstractChatEvent<UserUpdateData> {
public UserUpdateEvent() {
this.event = EventType.USER_UPDATE;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package com.mixer.api.resource.chat.events.data;

import com.mixer.api.resource.MixerUser;
import com.mixer.api.resource.chat.AbstractChatEvent;

import java.util.List;
import java.util.UUID;

public class DeleteMessageData extends AbstractChatEvent.EventData {
public UUID id;
public String user_name;
public int user_id;
public List<MixerUser.Role> user_roles;
public int user_level;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.mixer.api.resource.chat.events.data;

import com.google.gson.annotations.SerializedName;
import com.mixer.api.resource.MixerUser;
import com.mixer.api.resource.chat.AbstractChatEvent;

import java.util.List;

public class PurgeMessageData extends AbstractChatEvent.EventData {
public String user_name;
public int user_id;
public List<MixerUser.Role> user_roles;
public int user_level;
@SerializedName("user_id")public int message_owner_id;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.mixer.api.resource.chat.events.data;

import com.mixer.api.resource.MixerUser;
import com.mixer.api.resource.chat.AbstractChatEvent;

import java.util.List;

public class UserUpdateData extends AbstractChatEvent.EventData {
public List<MixerUser.Role> roles;
public int user;
}