This commit is contained in:
MathMan05
2025-09-29 12:44:10 -05:00
parent ac17a65a8d
commit 13bdcc0db5
4 changed files with 34 additions and 2 deletions
+19 -2
View File
@@ -1368,7 +1368,18 @@ class Channel extends SnowFlake {
};
live.classList.add("callVoiceIcon");
buttonRow.append(mute, video, live, call);
const chat = document.createElement("div");
const chatspan = document.createElement("span");
chatspan.classList.add("svg-frmessage");
chat.append(chatspan);
updateLiveIcon();
chat.onclick = async () => {
this.voiceMode = this.voiceMode === "VoiceOnly" ? "ChatAndVoice" : "VoiceOnly";
this.getHTML(true);
};
chat.classList.add("callVoiceIcon");
buttonRow.append(mute, video, live, call, chat);
const users = document.createElement("div");
const mut = new MutationObserver(() => {
@@ -1466,7 +1477,11 @@ class Channel extends SnowFlake {
if (getMessages) {
chatArea.style.removeProperty("display");
} else {
chatArea.style.setProperty("display", "none");
if (this.voiceMode === "VoiceOnly") {
chatArea.style.setProperty("display", "none");
} else {
chatArea.style.removeProperty("display");
}
this.setUpVoiceArea();
}
@@ -2372,6 +2387,7 @@ class Channel extends SnowFlake {
});
notification.addEventListener("click", (_) => {
window.focus();
this.getHTML(true, true);
});
} else if (Notification.permission !== "denied") {
@@ -2383,6 +2399,7 @@ class Channel extends SnowFlake {
});
}
}
voiceMode: "VoiceOnly" | "ChatAndVoice" = "VoiceOnly";
async addRoleToPerms(role: Role) {
await fetch(this.info.api + "/channels/" + this.id + "/permissions/" + role.id, {
method: "PUT",
+13
View File
@@ -182,7 +182,20 @@ class Message extends SnowFlake {
color: "red",
},
);
Message.contextmenu.addSeperator();
Message.contextmenu.addButton(
() => I18n.usedFermi(),
() => {},
{
visable: function () {
return this.nonce.length <= 9;
},
enabled: () => false,
},
);
}
nonce: string = "";
setEdit() {
const prev = this.channel.editing;
this.channel.editing = this;
+1
View File
@@ -229,6 +229,7 @@ body {
#voiceArea {
background: var(--black);
position: relative;
min-width: 60%;
}
.voiceUsers {
padding: 20px;
+1
View File
@@ -225,6 +225,7 @@
"left":"Left voice chat"
}
},
"usedFermi":"Used Fermi",
"delete": "Delete",
"webhooks": {
"createdAt": "Created at $1",