From b5fa938a85560ab4bbbbd257971a96cf36a620fe Mon Sep 17 00:00:00 2001 From: Lomanic Date: Sat, 25 Sep 2021 18:51:34 +0200 Subject: [PATCH] Send a different closing message on matrix if the space was not officially opened --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 47efcf6..40365d1 100644 --- a/main.go +++ b/main.go @@ -130,9 +130,12 @@ func checkClosure() { for { if status.LastSeen.Add(defaultClosingTimeout).Before(time.Now()) && status.LastClosed.Before(status.LastSeen) { // the Fuz is newly closed, notify on matrix and write file to survive reboot - // TODO: matrix msg fmt.Println("the Fuz is newly closed, notify on matrix and write file to survive reboot") - _, err := matrix.SendText(config.MATRIXROOM, config.MATRIXCLOSINGMESSAGE) + msg := config.MATRIXCLOSINGMESSAGE + if !status.FuzIsOpen { + msg = fmt.Sprintf("%s : passage bref", msg) + } + _, err := matrix.SendText(config.MATRIXROOM, msg) if err != nil { fmt.Println("err:", err) time.Sleep(10 * time.Second)