mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 08:47:24 +00:00
Testing PR 51
This commit is contained in:
25
cmdDev.go
Normal file
25
cmdDev.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// +build !rm_basic_commands allcommands devcmd
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
command := Command{
|
||||||
|
Cmd: []string{"dev"},
|
||||||
|
Description: "- Switch to dev channels",
|
||||||
|
Help: "",
|
||||||
|
Exec: cmdDev,
|
||||||
|
}
|
||||||
|
|
||||||
|
RegisterCommand(command)
|
||||||
|
}
|
||||||
|
|
||||||
|
func cmdDev(cmd []string) {
|
||||||
|
dev = !dev
|
||||||
|
|
||||||
|
printInfo(fmt.Sprintf("You have toggled the dev flag to %+v", dev))
|
||||||
|
clearView("Chat")
|
||||||
|
}
|
||||||
12
main.go
12
main.go
@ -42,7 +42,11 @@ func main() {
|
|||||||
defer g.Close()
|
defer g.Close()
|
||||||
g.SetManagerFunc(layout)
|
g.SetManagerFunc(layout)
|
||||||
RunCommand("config", "load")
|
RunCommand("config", "load")
|
||||||
if dev { channel.TopicType = "dev" } else { channel.TopicType = "chat" }
|
if dev {
|
||||||
|
channel.TopicType = "dev"
|
||||||
|
} else {
|
||||||
|
channel.TopicType = "chat"
|
||||||
|
}
|
||||||
go populateList()
|
go populateList()
|
||||||
go updateChatWindow()
|
go updateChatWindow()
|
||||||
if len(os.Args) > 1 {
|
if len(os.Args) > 1 {
|
||||||
@ -382,7 +386,11 @@ func populateChat() {
|
|||||||
if channel.Name == testChan.Name {
|
if channel.Name == testChan.Name {
|
||||||
channel = testChan
|
channel = testChan
|
||||||
channel.TopicName = "general"
|
channel.TopicName = "general"
|
||||||
if dev { channel.TopicType = "dev" } else { channel.TopicType = "chat" }
|
if dev {
|
||||||
|
channel.TopicType = "dev"
|
||||||
|
} else {
|
||||||
|
channel.TopicType = "chat"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chat = k.NewChat(channel)
|
chat = k.NewChat(channel)
|
||||||
|
|||||||
Reference in New Issue
Block a user