Prevent empty disconnect reasons

master
HimbeerserverDE 2021-09-11 10:15:17 +02:00
parent 4845a3fda9
commit ccec89bce6
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,10 @@ import "github.com/anon55555/mt"
// Kick sends mt.ToCltDisco with the specified custom reason
// and closes the ClientConn.
func (cc *ClientConn) Kick(reason string) {
if reason == "" {
reason = "Kicked by proxy."
}
ack, _ := cc.SendCmd(&mt.ToCltDisco{
Reason: mt.Custom,
Custom: reason,