feat: BIG changes

* use commands constants
* use a separate goroutine to read from connection
* refactor connection reading and ui updating
* add sidepanel for users in channel
* other cleanups
This commit is contained in:
2022-01-09 04:30:22 +02:00
parent 1168a2a4dd
commit 8a7e1568ae
11 changed files with 280 additions and 97 deletions
+3 -3
View File
@@ -19,10 +19,10 @@ package app
import tea "github.com/charmbracelet/bubbletea"
func (s *State) Quit() tea.Msg {
if s.Client.TlsConn != nil {
s.Client.SendCommand("QUIT")
s.Client.TlsConn.Close()
if s.Client.Quit != nil {
close(s.Client.Quit)
}
if s.Client.TcpConn != nil {
s.Client.SendCommand("QUIT")
s.Client.TcpConn.Close()