No pictures shared over chat DMs
This commit is contained in:
parent
fbae93d4f9
commit
f3517bec87
|
@ -104,7 +104,10 @@ func (s *Server) OnLogin(sub *Subscriber, msg Message) {
|
||||||
|
|
||||||
// OnMessage handles a chat message posted by the user.
|
// OnMessage handles a chat message posted by the user.
|
||||||
func (s *Server) OnMessage(sub *Subscriber, msg Message) {
|
func (s *Server) OnMessage(sub *Subscriber, msg Message) {
|
||||||
log.Info("[%s] %s", sub.Username, msg.Message)
|
if !strings.HasPrefix(msg.Channel, "@") {
|
||||||
|
log.Info("[%s to #%s] %s", sub.Username, msg.Channel, msg.Message)
|
||||||
|
}
|
||||||
|
|
||||||
if sub.Username == "" {
|
if sub.Username == "" {
|
||||||
sub.ChatServer("You must log in first.")
|
sub.ChatServer("You must log in first.")
|
||||||
return
|
return
|
||||||
|
|
|
@ -1760,6 +1760,10 @@ const app = Vue.createApp({
|
||||||
|
|
||||||
// The image upload button handler.
|
// The image upload button handler.
|
||||||
uploadFile() {
|
uploadFile() {
|
||||||
|
if (this.isDM) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let input = document.createElement('input');
|
let input = document.createElement('input');
|
||||||
input.type = 'file';
|
input.type = 'file';
|
||||||
input.accept = 'image/*';
|
input.accept = 'image/*';
|
||||||
|
|
|
@ -923,7 +923,8 @@
|
||||||
<div class="card-content p-2">
|
<div class="card-content p-2">
|
||||||
|
|
||||||
<div class="columns is-mobile">
|
<div class="columns is-mobile">
|
||||||
<div class="column pr-1">
|
<div class="column"
|
||||||
|
:class="{'pr-1': !isDM}">
|
||||||
<form @submit.prevent="sendMessage()">
|
<form @submit.prevent="sendMessage()">
|
||||||
<input type="text" class="input"
|
<input type="text" class="input"
|
||||||
v-model="message"
|
v-model="message"
|
||||||
|
@ -932,7 +933,7 @@
|
||||||
:disabled="!ws.connected">
|
:disabled="!ws.connected">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="column pl-1 is-narrow">
|
<div class="column pl-1 is-narrow" v-if="!isDM">
|
||||||
<button type="button" class="button"
|
<button type="button" class="button"
|
||||||
@click="uploadFile()">
|
@click="uploadFile()">
|
||||||
<i class="fa fa-image"></i>
|
<i class="fa fa-image"></i>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user