mirror of
https://github.com/shazow/ssh-chat.git
synced 2026-10-22 23:52:12 +03:00
Added /unban command to unban a banned fingerprint
This commit is contained in:
1 parent
cebad1c4c4
commit
15ef0a57b2
1 file changed
+15
@@ -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.")
|
||||
|
||||
Reference in new issue
Block a user