Safety for the operator-only hidden status
This commit is contained in:
parent
5f1b282c65
commit
3ddb321bf4
|
@ -480,6 +480,9 @@ func (s *Server) OnOpen(sub *Subscriber, msg messages.Message) {
|
|||
// Look up the other subscriber.
|
||||
other, err := s.GetSubscriber(msg.Username)
|
||||
if err != nil {
|
||||
sub.ChatServer(
|
||||
"Could not open that video: %s appears to be offline.", msg.Username,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
28
src/App.vue
28
src/App.vue
|
@ -503,6 +503,14 @@ export default {
|
|||
LocalStorage.set('scrollback', this.scrollback);
|
||||
},
|
||||
status() {
|
||||
// Notify if going hidden.
|
||||
if (this.status === 'hidden' && this.isOp) {
|
||||
this.ChatClient(
|
||||
"Your status is now set to 'hidden' which makes it appear as though you have logged out of chat.\n\n" +
|
||||
"Try not to break the illusion by interacting with chat in this state. For safety, your message " +
|
||||
"entry box will be disabled in public channels.",
|
||||
);
|
||||
}
|
||||
// Send presence updates to the server.
|
||||
this.sendMe();
|
||||
},
|
||||
|
@ -1070,6 +1078,12 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
// Safety for hidden status.
|
||||
if (this.status === 'hidden' && !this.isDM) {
|
||||
this.ChatClient("Your status is currently set to 'hidden' and it would break the illusion to talk in public channels.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Spammy links.
|
||||
if (this.message.toLowerCase().indexOf("onlyfans.com") > -1 ||
|
||||
this.message.toLowerCase().indexOf("justfor.fans") > -1 ||
|
||||
|
@ -2049,7 +2063,9 @@ export default {
|
|||
this.makeLinksExternal();
|
||||
|
||||
// Focus the message entry box.
|
||||
this.messageBox.focus();
|
||||
window.requestAnimationFrame(() => {
|
||||
this.messageBox.focus();
|
||||
});
|
||||
},
|
||||
hasAnyUnread() {
|
||||
// Returns total unread count (for mobile responsive view to show in the left drawer button)
|
||||
|
@ -2478,6 +2494,12 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
// Operator safety when hidden.
|
||||
if (this.status === 'hidden') {
|
||||
this.ChatClient("Your chat status is currently set to 'hidden' and you would break the illusion by opening this camera.");
|
||||
return;
|
||||
}
|
||||
|
||||
// A chat moderation rule?
|
||||
if (this.jwt.rules.IsNoVideoRule) {
|
||||
return this.modalAlert({
|
||||
|
@ -5055,8 +5077,8 @@ export default {
|
|||
|
||||
<!-- My text box -->
|
||||
<input type="text" class="input" id="messageBox" v-model="message"
|
||||
placeholder="Write a message" @keydown="sendTypingNotification()" autocomplete="off"
|
||||
:disabled="!client.connected">
|
||||
:placeholder="status === 'hidden' ? 'Your status is hidden, be careful not to break the illusion' : 'Write a message'" @keydown="sendTypingNotification()" autocomplete="off"
|
||||
:disabled="!client.connected || (status === 'hidden' && !isDM)">
|
||||
|
||||
<!-- At Mention templates-->
|
||||
<template #no-result>
|
||||
|
|
|
@ -9,6 +9,19 @@ export default {
|
|||
dontShowAgain: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('keyup', (e) => {
|
||||
if (!this.visible) return;
|
||||
|
||||
if (e.key === 'Enter') {
|
||||
return this.accept();
|
||||
}
|
||||
|
||||
if (e.key == 'Escape') {
|
||||
return this.cancel();
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
accept() {
|
||||
if (this.dontShowAgain) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user