aboutsummaryrefslogtreecommitdiff
path: root/gomuks.go
diff options
context:
space:
mode:
Diffstat (limited to 'gomuks.go')
-rw-r--r--gomuks.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/gomuks.go b/gomuks.go
index 6af5997..e87da59 100644
--- a/gomuks.go
+++ b/gomuks.go
@@ -31,6 +31,9 @@ type Gomuks interface {
App() *tview.Application
UI() *GomuksUI
Config() *Config
+
+ Start()
+ Stop()
}
type gomuks struct {
@@ -68,6 +71,14 @@ func NewGomuks(debug bool) *gomuks {
return gmx
}
+func (gmx *gomuks) Stop() {
+ gmx.matrix.Stop()
+ gmx.app.Stop()
+ if gmx.config.Session != nil {
+ gmx.config.Session.Save()
+ }
+}
+
func (gmx *gomuks) Start() {
if err := gmx.app.Run(); err != nil {
panic(err)