mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-07-05 11:00:50 +00:00
fixed bugs + added no permission message
This commit is contained in:
parent
c1f567144c
commit
775dcb6537
1 changed files with 29 additions and 2 deletions
|
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<edit-panel v-if="editMessage" :data="editMessage" />
|
<edit-panel v-if="editMessage" :data="editMessage" />
|
||||||
<div class="message-area">
|
<div class="message-area" v-if="sendMessagePermission === true || editMessage">
|
||||||
<input type="file" ref="sendFileBrowse" @change="attachmentChange" class="hidden" />
|
<input type="file" ref="sendFileBrowse" @change="attachmentChange" class="hidden" />
|
||||||
<div class="attachment-button" @click="attachmentButton">
|
<div class="attachment-button" @click="attachmentButton">
|
||||||
<i class="material-icons">attach_file</i>
|
<i class="material-icons">attach_file</i>
|
||||||
|
|
@ -61,11 +61,12 @@
|
||||||
:recipients="typingRecipients[selectedChannelID]"
|
:recipients="typingRecipients[selectedChannelID]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="sendMessagePermission === true || editMessage"
|
||||||
:class="{'message-count': true, 'error-info': messageLength > 5000 }"
|
:class="{'message-count': true, 'error-info': messageLength > 5000 }"
|
||||||
>{{messageLength}}/5000</div>
|
>{{messageLength}}/5000</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="no-message-permission" v-if="sendMessagePermission === false">You don't have permission to send messages.</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -235,6 +236,7 @@ export default {
|
||||||
},
|
},
|
||||||
resize() {
|
resize() {
|
||||||
let input = this.$refs["input-box"];
|
let input = this.$refs["input-box"];
|
||||||
|
if (!input) return;
|
||||||
if (input.scrollHeight < 50 || !this.message) {
|
if (input.scrollHeight < 50 || !this.message) {
|
||||||
input.style.height = "1em";
|
input.style.height = "1em";
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -542,6 +544,22 @@ export default {
|
||||||
channel() {
|
channel() {
|
||||||
return this.$store.getters.channels[this.selectedChannelID];
|
return this.$store.getters.channels[this.selectedChannelID];
|
||||||
},
|
},
|
||||||
|
server () {
|
||||||
|
if (!this.channel) return false;
|
||||||
|
if (!this.channel.server_id) return false;
|
||||||
|
return this.$store.getters["servers/servers"][this.channel.server_id] || undefined;
|
||||||
|
},
|
||||||
|
sendMessagePermission() {
|
||||||
|
if (this.type !== 1) return true;
|
||||||
|
if (!this.channel) return null
|
||||||
|
|
||||||
|
if (!this.server) return false;
|
||||||
|
|
||||||
|
if (this.server.creator.uniqueID === this.user.uniqueID) return true;
|
||||||
|
if (!this.channel.permissions) return true;
|
||||||
|
if (this.channel.permissions.send_message === undefined) return true;
|
||||||
|
return this.channel.permissions.send_message;
|
||||||
|
},
|
||||||
selectedChannelMessages() {
|
selectedChannelMessages() {
|
||||||
const selectedChannel = this.$store.getters.selectedChannelID;
|
const selectedChannel = this.$store.getters.selectedChannelID;
|
||||||
return this.$store.getters.messages[selectedChannel];
|
return this.$store.getters.messages[selectedChannel];
|
||||||
|
|
@ -800,4 +818,13 @@ export default {
|
||||||
font-size: 35px;
|
font-size: 35px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-message-permission {
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
padding: 5px;
|
||||||
|
user-select: none;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue