mirror of
https://github.com/shazow/ssh-chat.git
synced 2026-10-22 23:52:12 +03:00
Merge branch 'master' of https://github.com/shazow/ssh-chat
This commit is contained in:
commit
96828c25ac
3 files changed
+6
-2
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user