Merge branch 'master' into IQ_Roster

This commit is contained in:
remicorniere 2019-12-23 08:09:39 +00:00 committed by GitHub
commit f8f820170e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ import (
) )
const ( const (
// Windows // Windows
chatLogWindow = "clw" // Where (received and sent) messages are logged chatLogWindow = "clw" // Where (received and sent) messages are logged
chatInputWindow = "iw" // Where messages are written chatInputWindow = "iw" // Where messages are written
rawInputWindow = "rw" // Where raw stanzas are written rawInputWindow = "rw" // Where raw stanzas are written
@ -194,7 +194,6 @@ func setKeyBindings(g *gocui.Gui) {
if err := g.SetKeybinding(disconnectMsg, gocui.KeyEnter, gocui.ModNone, delMsg); err != nil { if err := g.SetKeybinding(disconnectMsg, gocui.KeyEnter, gocui.ModNone, delMsg); err != nil {
log.Panicln(err) log.Panicln(err)
} }
} }
// General // General
@ -216,7 +215,7 @@ func getLine(g *gocui.Gui, v *gocui.View) error {
if len(cv.ViewBufferLines()) == 0 { if len(cv.ViewBufferLines()) == 0 {
printContactsToWindow(g, viewState.contacts) printContactsToWindow(g, viewState.contacts)
} }
} else if l == disconnect { } else if l == disconnect {
maxX, maxY := g.Size() maxX, maxY := g.Size()
msg := "You disconnected from the server. Press enter to quit." msg := "You disconnected from the server. Press enter to quit."
if v, err := g.SetView(disconnectMsg, maxX/2-30, maxY/2, maxX/2-29+len(msg), maxY/2+2, 0); err != nil { if v, err := g.SetView(disconnectMsg, maxX/2-30, maxY/2, maxX/2-29+len(msg), maxY/2+2, 0); err != nil {
@ -227,7 +226,7 @@ func getLine(g *gocui.Gui, v *gocui.View) error {
if _, err := g.SetCurrentView(disconnectMsg); err != nil { if _, err := g.SetCurrentView(disconnectMsg); err != nil {
return err return err
} }
} }
killChan <- disconnectErr killChan <- disconnectErr
} else if l == askServerForRoster { } else if l == askServerForRoster {
chlw, _ := g.View(chatLogWindow) chlw, _ := g.View(chatLogWindow)