aboutsummaryrefslogtreecommitdiff
path: root/gomuks.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-04-24 22:58:30 +0300
committerGitHub <noreply@github.com>2018-04-24 22:58:30 +0300
commit7026ed99a3ef4071a35e74d2d5f9026f6848be92 (patch)
tree33332880db2cbdaeabaeb4e1ddbf94a3f15686a3 /gomuks.go
parent49cd74c548e3baf259fce9270af3ecca5bdb625e (diff)
parentd7d654e2ec0a1d001f936b1575a3e6af3973a874 (diff)
Merge pull request #33 from tulir/initial-sync
Use initial sync data instead of fetching room list, state, history, etc manually
Diffstat (limited to 'gomuks.go')
-rw-r--r--gomuks.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/gomuks.go b/gomuks.go
index ffdfad3..5f5d74b 100644
--- a/gomuks.go
+++ b/gomuks.go
@@ -18,7 +18,9 @@ package main
import (
"os"
+ "os/signal"
"path/filepath"
+ "syscall"
"time"
"maunium.net/go/gomuks/config"
@@ -104,6 +106,13 @@ func (gmx *Gomuks) Stop() {
func (gmx *Gomuks) Start() {
_ = gmx.matrix.InitClient()
+ c := make(chan os.Signal, 1)
+ signal.Notify(c, os.Interrupt, syscall.SIGTERM)
+ go func() {
+ <-c
+ gmx.Stop()
+ }()
+
go gmx.StartAutosave()
if err := gmx.ui.Start(); err != nil {
panic(err)