File tree Expand file tree Collapse file tree 3 files changed +46
-3
lines changed Expand file tree Collapse file tree 3 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 1
1
package streamcontrol
2
2
3
- import "time"
3
+ import (
4
+ "fmt"
5
+ "time"
6
+ )
4
7
5
8
type ChatUserID string
6
9
type ChatMessageID string
@@ -32,3 +35,35 @@ const (
32
35
EventTypeStreamOffline
33
36
EventTypeOther
34
37
)
38
+
39
+ func (t EventType ) String () string {
40
+ switch t {
41
+ case EventTypeUndefined :
42
+ return "undefined"
43
+ case EventTypeChatMessage :
44
+ return "chat_message"
45
+ case EventTypeCheer :
46
+ return "cheer"
47
+ case EventTypeAutoModHold :
48
+ return "automod_hold"
49
+ case EventTypeAdBreak :
50
+ return "ad_break"
51
+ case EventTypeBan :
52
+ return "ban"
53
+ case EventTypeFollow :
54
+ return "follow"
55
+ case EventTypeRaid :
56
+ return "raid"
57
+ case EventTypeChannelShoutoutReceive :
58
+ return "channel_shoutout_receive"
59
+ case EventTypeSubscribe :
60
+ return "subscribe"
61
+ case EventTypeStreamOnline :
62
+ return "stream_online"
63
+ case EventTypeStreamOffline :
64
+ return "stream_offline"
65
+ case EventTypeOther :
66
+ return "other"
67
+ }
68
+ return fmt .Sprintf ("unknown_%d" , int (t ))
69
+ }
Original file line number Diff line number Diff line change @@ -351,7 +351,11 @@ func (ui *chatUIAsList) listUpdateItem(
351
351
removeMsgButton .Enable ()
352
352
}
353
353
}
354
- item .TimestampSegment .Text = msg .CreatedAt .Format ("15:04:05" )
354
+ newText := msg .CreatedAt .Format ("05" )
355
+ if msg .EventType != streamcontrol .EventTypeChatMessage {
356
+ newText += fmt .Sprintf (" %s" , msg .EventType .String ())
357
+ }
358
+ item .TimestampSegment .Text = newText
355
359
item .TimestampSegment .Style .ColorName = colorForPlatform (msg .Platform )
356
360
item .UsernameSegment .Text = msg .Username
357
361
item .UsernameSegment .Style .ColorName = colorForUsername (msg .Username )
Original file line number Diff line number Diff line change @@ -307,7 +307,11 @@ func (ui *chatUIAsText) newItem(
307
307
removeMsgButton .Enable ()
308
308
}
309
309
}
310
- item .TimestampSegment .Text = msg .CreatedAt .Format ("15:04:05" )
310
+ newText := msg .CreatedAt .Format ("05" )
311
+ if msg .EventType != streamcontrol .EventTypeChatMessage {
312
+ newText += fmt .Sprintf (" %s" , msg .EventType .String ())
313
+ }
314
+ item .TimestampSegment .Text = newText
311
315
item .TimestampSegment .Style .ColorName = colorForPlatform (msg .Platform )
312
316
item .UsernameSegment .Text = msg .Username
313
317
item .UsernameSegment .Style .ColorName = colorForUsername (msg .Username )
You can’t perform that action at this time.
0 commit comments