Add channel name on chat pane on start-up
This commit is contained in:
parent
1f27fcbcf9
commit
9be15b87f8
3
TODO.md
3
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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user