diff --git a/main.go b/main.go index 9137305..ae54f82 100644 --- a/main.go +++ b/main.go @@ -59,6 +59,9 @@ func main() { fmt.Println("Login successful") syncer := client.Syncer.(*mautrix.DefaultSyncer) syncer.OnEventType(event.EventMessage, func(source mautrix.EventSource, evt *event.Event) { + if evt.Sender == client.UserID { + return //ignore events from self + } fmt.Printf("<%[1]s> %[4]s (%[2]s/%[3]s)\n", evt.Sender, evt.Type.String(), evt.ID, evt.Content.AsMessage().Body) body := evt.Content.AsMessage().Body body_s := strings.Split(body, " ") @@ -68,9 +71,6 @@ func main() { if len(body_s) < 2 { return //nothing to parse } - if evt.Sender == client.UserID { - return //ignore events from self - } switch body_s[1] { case "info": // print info page