Small tweaks

This commit is contained in:
Noah 2023-08-29 07:56:43 +07:00
parent fd82a463f3
commit 4cbc919793
3 changed files with 8 additions and 5 deletions

View File

@ -2114,7 +2114,9 @@ const app = Vue.createApp({
// Are we ignoring DMs?
if (this.prefs.closeDMs && channel.indexOf('@') === 0) {
// Don't allow an (incoming) DM to initialize a new chat room for us.
if (username !== this.username && this.channels[channel] == undefined) return;
// Unless the user is an operator.
let isSenderOp = this.whoMap[username] != undefined && this.whoMap[username].op;
if (username !== this.username && this.channels[channel] == undefined && !isSenderOp) return;
}
// Initialize this channel's history?

View File

@ -40,6 +40,6 @@ var DefaultSounds = {
DM: "Trill",
Enter: "Quiet",
Leave: "Quiet",
Watch: "Up Chime",
Watch: "Quiet",
Unwatch: "Quiet",
};

View File

@ -1123,7 +1123,7 @@
@click="openDMs({username: msg.username})"
:title="isUsernameDND(msg.username) ? 'This person is not accepting new DMs' : 'Open a Direct Message (DM) thread'"
:disabled="isUsernameDND(msg.username)">
<i class="fa fa-message"></i>
<i class="fa fa-comment"></i>
</button>
<!-- Mute button -->
@ -1433,9 +1433,10 @@
<button type="button" v-else
class="button is-small px-2 py-1"
@click="openDMs(u)"
:disabled="u.username === username || u.dnd"
:disabled="u.username === username || (u.dnd && !isOp)"
:title="u.dnd ? 'This person is not accepting new DMs' : 'Send a Direct Message'">
<i class="fa fa-message"></i>
<i class="fa"
:class="{'fa-comment': !u.dnd, 'fa-comment-slash': u.dnd}"></i>
</button>
<!-- Video button -->