Bugfixes with user status
This commit is contained in:
parent
2e9c02f84e
commit
dd9f4b4dd4
|
@ -238,6 +238,28 @@ func (s *Server) OnMe(sub *Subscriber, msg Message) {
|
|||
log.Debug("User %s turns on their video feed", sub.Username)
|
||||
}
|
||||
|
||||
// Hidden status: for operators only, + fake a join/exit chat message.
|
||||
if sub.JWTClaims != nil && sub.JWTClaims.IsAdmin {
|
||||
if sub.ChatStatus != "hidden" && msg.ChatStatus == "hidden" {
|
||||
// Going hidden - fake leave message
|
||||
s.Broadcast(Message{
|
||||
Action: ActionPresence,
|
||||
Username: sub.Username,
|
||||
Message: "has exited the room!",
|
||||
})
|
||||
} else if sub.ChatStatus == "hidden" && msg.ChatStatus != "hidden" {
|
||||
// Leaving hidden - fake join message
|
||||
s.Broadcast(Message{
|
||||
Action: ActionPresence,
|
||||
Username: sub.Username,
|
||||
Message: "has joined the room!",
|
||||
})
|
||||
}
|
||||
} else if msg.ChatStatus == "hidden" {
|
||||
// normal users can not set this status
|
||||
msg.ChatStatus = "away"
|
||||
}
|
||||
|
||||
sub.VideoActive = msg.VideoActive
|
||||
sub.VideoNSFW = msg.NSFW
|
||||
sub.ChatStatus = msg.ChatStatus
|
||||
|
|
|
@ -697,7 +697,7 @@
|
|||
<option value="online">☀️ Active</option>
|
||||
<option value="away">🕒 Away</option>
|
||||
<option value="idle" v-show="status==='idle'">🕒 Idle</option>
|
||||
<option value="hidden" v-show="jwt.claims != undefined && jwt.claims.op">🕵️ Hidden</option>
|
||||
<option value="hidden" v-if="jwt.claims != undefined && jwt.claims.op">🕵️ Hidden</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user