diff --git a/TODO.md b/TODO.md index 7f2b9e6..51c0f50 100644 --- a/TODO.md +++ b/TODO.md @@ -18,9 +18,9 @@ Bugs: want to load. - [x] GetMessages for a channel can result in `json: cannot unmarshal number into Go value of type string` https://github.com/nlopes/slack/issues/92 +- [x] set channelname on start - [ ] docs at exported functions - [ ] incoming message event.go probably need a type switch -- [ ] set channel on start Features: @@ -29,4 +29,5 @@ Features: - [x] scrolling in chat pane - [x] group channels, im channels - [x] scrolling in channel pane +- [ ] command mode center text - [ ] remove unsubscribed or closed channels/groups/im diff --git a/src/components/chat.go b/src/components/chat.go index e6412a4..951b280 100644 --- a/src/components/chat.go +++ b/src/components/chat.go @@ -9,13 +9,12 @@ import ( ) type Chat struct { - List *termui.List - SelectedChannel string - Offset int + List *termui.List + Offset int } // CreateChat is the constructor for the Chat struct -func CreateChat(svc *service.SlackService, inputHeight int, selectedChannel interface{}) *Chat { +func CreateChat(svc *service.SlackService, inputHeight int, selectedChannel interface{}, selectedChannelName string) *Chat { chat := &Chat{ List: termui.NewList(), Offset: 0, @@ -25,7 +24,7 @@ func CreateChat(svc *service.SlackService, inputHeight int, selectedChannel inte chat.List.Overflow = "wrap" chat.GetMessages(svc, selectedChannel) - // chat.SetBorderLabel(selectedChannel.Name) + chat.SetBorderLabel(selectedChannelName) return chat } diff --git a/src/views/chat.go b/src/views/chat.go index 2688959..17bc12b 100644 --- a/src/views/chat.go +++ b/src/views/chat.go @@ -23,6 +23,7 @@ func CreateChatView(svc *service.SlackService) *View { svc, input.Par.Height, svc.SlackChannels[channels.SelectedChannel], + svc.Channels[channels.SelectedChannel].Name, ) mode := components.CreateMode()