mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-14 16:17:17 +03:00
Merge branch 'master' of https://github.com/shazow/ssh-chat
This commit is contained in:
commit
96828c25ac
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
host_key
|
||||
host_key.pub
|
||||
ssh-chat
|
||||
*.log
|
||||
|
@ -95,7 +95,7 @@ func (c *Client) ColoredName() string {
|
||||
|
||||
// SysMsg sends a message in continuous format over the message channel
|
||||
func (c *Client) SysMsg(msg string, args ...interface{}) {
|
||||
c.Msg <- ContinuousFormat(systemMessageFormat, "-> "+fmt.Sprintf(msg, args...))
|
||||
c.Send(ContinuousFormat(systemMessageFormat, "-> "+fmt.Sprintf(msg, args...)))
|
||||
}
|
||||
|
||||
// Write writes the given message
|
||||
@ -256,7 +256,7 @@ func (c *Client) handleShell(channel ssh.Channel) {
|
||||
c.SysMsg("Missing $NAME from: /nick $NAME")
|
||||
}
|
||||
case "/whois":
|
||||
if len(parts) == 2 {
|
||||
if len(parts) >= 2 {
|
||||
client := c.Server.Who(parts[1])
|
||||
if client != nil {
|
||||
version := reStripText.ReplaceAllString(string(client.Conn.ClientVersion()), "")
|
||||
|
@ -80,6 +80,9 @@ func NewServer(privateKey []byte) (*Server, error) {
|
||||
perm := &ssh.Permissions{Extensions: map[string]string{"fingerprint": fingerprint}}
|
||||
return perm, nil
|
||||
},
|
||||
KeyboardInteractiveCallback: func(conn ssh.ConnMetadata, challenge ssh.KeyboardInteractiveChallenge) (*ssh.Permissions, error) {
|
||||
return nil, nil
|
||||
},
|
||||
}
|
||||
config.AddHostKey(signer)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user