-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathChatMessage.java
93 lines (74 loc) · 2.2 KB
/
ChatMessage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package com.perflyst.twire.model;
import androidx.annotation.NonNull;
import com.perflyst.twire.chat.ChatManager;
import java.util.List;
public class ChatMessage {
private final String message;
private final String name;
private final String color;
private final List<Badge> badges;
private final List<ChatEmote> emotes;
private boolean highlight;
private String id = null;
public String systemMessage = "";
public ChatMessage(String message, String name, String color, List<Badge> badges, List<ChatEmote> emotes, boolean highlight) {
this.message = message;
this.name = name;
this.color = color;
this.badges = badges;
this.emotes = emotes;
this.highlight = highlight;
if (ChatManager.ffzBadgeMap == null) return;
// Load any special FFZ badges the user has
for (Badge badge : ChatManager.ffzBadgeMap.get(name.toLowerCase())) {
if (badge.replaces != null) {
for (int i = 0; i < badges.size(); i++) {
if (badges.get(i).name.equals(badge.replaces)) {
badges.set(i, badge);
break;
}
}
} else {
badges.add(badge);
}
}
}
public String getMessage() {
return message;
}
public String getName() {
return name;
}
public String getColor() {
return color;
}
public List<Badge> getBadges() {
return badges;
}
public List<ChatEmote> getEmotes() {
return emotes;
}
public boolean isHighlight() {
return highlight;
}
public void setHighlight(boolean highlight) {
this.highlight = highlight;
}
public String getID() {
return id;
}
public void setID(String id) {
this.id = id;
}
@Override
@NonNull
public String toString() {
return "ChatMessage{" +
"message='" + message + '\'' +
", name='" + name + '\'' +
", color='" + color + '\'' +
", badges=" + badges +
", emotes=" + emotes +
'}';
}
}