+func tabHandle(gui *gocui.Gui, v *gocui.View) error {
+ sids := make([]int, 0, len(Streams)+1)
+ sids = append(sids, -1)
+ for sid := range Streams {
+ sids = append(sids, int(sid))
+ }
+ sort.Ints(sids)
+ if CurrentView+1 >= len(sids) {
+ CurrentView = 0
+ } else {
+ CurrentView++
+ }
+ if CurrentView == 0 {
+ gui.SetCurrentView("chat")
+ } else {
+ gui.SetCurrentView(Streams[byte(sids[CurrentView])].name)
+ }
+ return nil
+}
+
+func chatEnter(gui *gocui.Gui, v *gocui.View) error {
+ msg := v.Buffer()
+ if len(msg) > 1 {
+ Ctrl <- vors.ArgsEncode([]byte(vors.CmdChat), []byte(msg[:len(msg)-1]))
+ log.Println("me:", msg[:len(msg)-1])
+ }
+ v.Clear()
+ v.SetCursor(0, 0)
+ return nil
+}
+