aboutsummaryrefslogtreecommitdiff
path: root/go-src/windows.go
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-07-09 17:04:28 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-07-09 17:04:49 +0300
commit7457f7af8effa21ecf328058475e944e46075670 (patch)
tree0f82e043d693871e72b8c02e5a73b72b8d16177c /go-src/windows.go
parent1490ddda1d20ef23a4e5ec908405869073abbf8d (diff)
downloadctfc-7457f7af8effa21ecf328058475e944e46075670.tar
ctfc-7457f7af8effa21ecf328058475e944e46075670.tar.gz
ctfc-7457f7af8effa21ecf328058475e944e46075670.zip
Implemented sending chat messages and implemented chat UI
Diffstat (limited to 'go-src/windows.go')
-rw-r--r--go-src/windows.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/go-src/windows.go b/go-src/windows.go
index 95478c6..beac8ed 100644
--- a/go-src/windows.go
+++ b/go-src/windows.go
@@ -117,10 +117,22 @@ func chatWindow(values ...string) {
clearScreen()
currChat := getChat(values[0])
- fmt.Println(currChat)
+ ui.NormalBox(true, "Chats", "Direct Messages", "Account", "Logout")
+ ui.TextField(currChat.Name + " : " + currChat.Description)
+ ui.TextField("Brought to you by " + currChat.Owner.Name + " (" + currChat.Owner.Username + ")")
+ ui.EmptyLine()
+ for _, v := range currChat.Messages {
+ ui.TextField(v)
+ }
+ ui.PageField(0, 0)
- ui.InputField("Enter anything")
- defer chatsWindow()
+ input := ui.InputField("Message or [C/D/A/L/</>/H]")
+
+ handled := handleInputActions(input, true)
+ if !handled {
+ currChat.addMessage(strings.TrimPrefix(input, "\\"), loggedInUser.Username)
+ defer chatWindow(values...)
+ }
}
func logoutWindow(...string) {