aboutsummaryrefslogtreecommitdiff
path: root/gomuks.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-03-15 00:14:39 +0200
committerTulir Asokan <tulir@maunium.net>2018-03-15 00:14:39 +0200
commitdeb2c1ac16ffc79636b1269ebaa05f08ea4a8213 (patch)
tree409d89e4f96a744b30b4283d16f68d569f527821 /gomuks.go
parent08f5db1a74cb596a3ddd3de8912dfd858899447e (diff)
More code
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)