mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-15 00:20:37 +03:00
Added /unban command to unban a banned fingerprint
This commit is contained in:
parent
cebad1c4c4
commit
15ef0a57b2
15
client.go
15
client.go
@ -309,6 +309,21 @@ func (c *Client) handleShell(channel ssh.Channel) {
|
||||
c.Server.Broadcast(fmt.Sprintf("* %s was banned by %s", parts[1], c.ColoredName()), nil)
|
||||
}
|
||||
}
|
||||
case "/unban":
|
||||
if !c.Server.IsOp(c) {
|
||||
c.SysMsg("You're not an admin.")
|
||||
} else if len(parts) != 2 {
|
||||
c.SysMsg("Missing $FINGERPRINT from: /unban $FINGERPRINT")
|
||||
} else {
|
||||
fingerprint := parts[1]
|
||||
isBanned := c.Server.IsBanned(fingerprint)
|
||||
if !isBanned {
|
||||
c.SysMsg("No such banned fingerprint: %s", fingerprint)
|
||||
} else {
|
||||
c.Server.Unban(fingerprint)
|
||||
c.Server.Broadcast(fmt.Sprintf("* %s was unbanned by %s", fingerprint, c.ColoredName()), nil)
|
||||
}
|
||||
}
|
||||
case "/op":
|
||||
if !c.Server.IsOp(c) {
|
||||
c.SysMsg("You're not an admin.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user