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