Add channel name on chat pane on start-up

This commit is contained in:
erroneousboat 2016-10-02 13:32:36 +02:00
parent 1f27fcbcf9
commit 9be15b87f8
3 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -10,12 +10,11 @@ import (
type Chat struct {
List *termui.List
SelectedChannel string
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
}

View File

@ -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()