We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5969c97 commit 17354faCopy full SHA for 17354fa
viewerstate.go
@@ -48,6 +48,14 @@ type ViewerState struct {
48
Channel *StreamChannel `json:"channel"`
49
}
50
51
+// Equals check if two ViewerStates are identical
52
+func (s *ViewerState) Equals(o *ViewerState) bool {
53
+ if s == nil || o == nil {
54
+ return s == o
55
+ }
56
+ return s.Online == o.Online && s.EnablePublicState == o.EnablePublicState && s.Channel.Equals(o.Channel)
57
+}
58
+
59
// StreamChannel rustla channel definition
60
type StreamChannel struct {
61
Channel string `json:"channel"`
@@ -147,7 +155,7 @@ func (v *ViewerStateStore) updatePublicState(state *ViewerState) {
147
155
return
148
156
149
157
150
- if ok && prev.Channel.Equals(state.Channel) {
158
+ if ok && prev.Equals(state) {
151
159
152
160
153
161
0 commit comments