From 41007c4ad2a858f68b00b6eca36df9cc833ce6b2 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 7 Oct 2020 14:40:46 +0000 Subject: [PATCH] send each line as a new message for got notifications --- main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 3858989..dfadfb7 100644 --- a/main.go +++ b/main.go @@ -207,11 +207,13 @@ func main() { return } - log.Printf("GOT: sending '%s'\n", msg) - err = plugins.SendNotice(cli, got_room, msg) - if err != nil { - http.Error(w, fmt.Sprintf("can not send commit info: %s", err), http.StatusInternalServerError) - return + for _, line := range strings.Split(msg, "\n") { + log.Printf("GOT: sending '%s'\n", line) + err = plugins.SendNotice(cli, got_room, line) + if err != nil { + http.Error(w, fmt.Sprintf("can not send commit info: %s", err), http.StatusInternalServerError) + return + } } fmt.Fprintf(w, "ok")