mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-14 16:17:17 +03:00
Made whitelisting user async.
This commit is contained in:
parent
932410d057
commit
8329c8d7fd
14
client.go
14
client.go
@ -416,12 +416,14 @@ func (c *Client) handleShell(channel ssh.Channel) {
|
||||
c.SysMsg("Missing $FINGERPRINT from: /whitelist $FINGERPRINT")
|
||||
} else {
|
||||
fingerprint := parts[1]
|
||||
err = c.Server.Whitelist(fingerprint)
|
||||
if err != nil {
|
||||
c.SysMsg("Error adding to whitelist: %s", err)
|
||||
} else {
|
||||
c.SysMsg("Added %s to the whitelist", fingerprint)
|
||||
}
|
||||
go func() {
|
||||
err = c.Server.Whitelist(fingerprint)
|
||||
if err != nil {
|
||||
c.SysMsg("Error adding to whitelist: %s", err)
|
||||
} else {
|
||||
c.SysMsg("Added %s to the whitelist", fingerprint)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user