Feat: Adding GUILDS! #12
4
app.js
4
app.js
@ -1047,7 +1047,6 @@ function addFileMessage(name, fileName, fileUrl, fileType, avatar, topic) {
|
|||||||
container.scrollTop = container.scrollHeight;
|
container.scrollTop = container.scrollHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addAudioMessage(name, audioUrl, avatar, topic) {
|
function addAudioMessage(name, audioUrl, avatar, topic) {
|
||||||
const container = document.querySelector('#messages');
|
const container = document.querySelector('#messages');
|
||||||
if (!container) {
|
if (!container) {
|
||||||
@ -1076,7 +1075,10 @@ function addAudioMessage(name, audioUrl, avatar, topic) {
|
|||||||
const audioElement = document.createElement('audio');
|
const audioElement = document.createElement('audio');
|
||||||
audioElement.src = audioUrl;
|
audioElement.src = audioUrl;
|
||||||
audioElement.controls = true;
|
audioElement.controls = true;
|
||||||
|
// Autoplay only if the message is from a peer
|
||||||
|
if (name !== config.userName) {
|
||||||
audioElement.autoplay = true;
|
audioElement.autoplay = true;
|
||||||
|
}
|
||||||
audioElement.classList.add('message-audio');
|
audioElement.classList.add('message-audio');
|
||||||
|
|
||||||
messageContent.appendChild(senderName);
|
messageContent.appendChild(senderName);
|
||||||
|
Loading…
Reference in New Issue
Block a user