aboutsummaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
Diffstat (limited to 'interface')
-rw-r--r--interface/gomuks.go3
-rw-r--r--interface/ui.go12
2 files changed, 9 insertions, 6 deletions
diff --git a/interface/gomuks.go b/interface/gomuks.go
index fbe05e1..90a5c4c 100644
--- a/interface/gomuks.go
+++ b/interface/gomuks.go
@@ -18,17 +18,14 @@ package ifc
import (
"maunium.net/go/gomuks/config"
- "maunium.net/go/tview"
)
// Gomuks is the wrapper for everything.
type Gomuks interface {
Matrix() MatrixContainer
- App() *tview.Application
UI() GomuksUI
Config() *config.Config
Start()
Stop()
- Recover()
}
diff --git a/interface/ui.go b/interface/ui.go
index 271dbd2..731e321 100644
--- a/interface/ui.go
+++ b/interface/ui.go
@@ -33,11 +33,18 @@ const (
ViewMain View = "main"
)
+type UIProvider func(gmx Gomuks) GomuksUI
+
type GomuksUI interface {
Render()
SetView(name View)
MainView() MainView
LoginView() LoginView
+
+ Init()
+ Start() error
+ Stop()
+ Finish()
}
type MainView interface {
@@ -50,8 +57,7 @@ type MainView interface {
SetTyping(roomID string, users []string)
ParseEvent(roomView RoomView, evt *gomatrix.Event) Message
- //ProcessMessageEvent(roomView RoomView, evt *gomatrix.Event) Message
- //ProcessMembershipEvent(roomView RoomView, evt *gomatrix.Event) Message
+
NotifyMessage(room *rooms.Room, message Message, should pushrules.PushActionArrayShould)
}
@@ -69,7 +75,7 @@ const (
type RoomView interface {
MxRoom() *rooms.Room
SaveHistory(dir string) error
- LoadHistory(gmx Gomuks, dir string) (int, error)
+ LoadHistory(matrix MatrixContainer, dir string) (int, error)
SetStatus(status string)
SetTyping(users []string)