commit 32a47300936c0a3751e668eeabf19e8381d54274
Author: ValdikSS <iam@valdikss.org.ru>
Date: Sat Jan 05 17:42:36 2019 +0000
diff --git a/bridge/sshchat/sshchat.go b/bridge/sshchat/sshchat.go
index ca427a8..5a8029c 100644
--- a/bridge/sshchat/sshchat.go
+++ b/bridge/sshchat/sshchat.go
@@ -337 +337 @@ func (b *Bsshchat) Connect() error {
b.r = bufio.NewScanner(r)
b.r.Scan()
b.w = w
- if _, err := b.w.Write([]byte("/theme mono\r\n")); err != nil {
+ if _, err := b.w.Write([]byte("/theme mono\r\n/quiet\r\n")); err != nil {
return err
}
close(connSignal) // Connection is established so we can signal the success.
@@ -1286 +1289 @@ func (b *Bsshchat) handleSSHChat() error {
if !strings.Contains(b.r.Text(), "\033[K") {
continue
}
+ if strings.Contains(b.r.Text(), "Rate limiting is in effect") {
+ continue
+ }
res := strings.Split(stripPrompt(b.r.Text()), ":")
if res[0] == "-> Set theme" {
wait = false
@@ -1367 +1397 @@ func (b *Bsshchat) handleSSHChat() error {
}
if !wait {
b.Log.Debugf("<= Message %#v", res)
- rmsg := config.Message{Username: res[0], Text: strings.Join(res[1:], ":"), Channel: "sshchat", Account: b.Account, UserID: "nick"}
+ rmsg := config.Message{Username: res[0], Text: strings.TrimSpace(strings.Join(res[1:], ":")), Channel: "sshchat", Account: b.Account, UserID: "nick"}
b.Remote <- rmsg
}
}
@@ -1557 +1587 @@ func (b *Bsshchat) handleUploadFile(msg *config.Message) (string, error) {
msg.Text = fi.Comment + ": " + fi.URL
}
}
- if _, err := b.w.Write([]byte(msg.Username + msg.Text)); err != nil {
+ if _, err := b.w.Write([]byte(msg.Username + msg.Text + "\r\n")); err != nil {
b.Log.Errorf("Could not send file message: %#v", err)
}
}