From 4db41167976e111c0c2991b408752ef3caeb28d4 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 15 Mar 2018 18:21:14 +0200 Subject: Here have code --- matrix.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'matrix.go') diff --git a/matrix.go b/matrix.go index 2639af7..dc433a8 100644 --- a/matrix.go +++ b/matrix.go @@ -117,6 +117,7 @@ func (c *MatrixContainer) UpdateRoomList() { } func (c *MatrixContainer) Start() { + defer c.gmx.Recover() c.debug.Print("Starting sync...") c.running = true c.ui.SetView(ViewMain) @@ -150,9 +151,14 @@ func (c *MatrixContainer) HandleMessage(evt *gomatrix.Event) { } func (c *MatrixContainer) HandleTyping(evt *gomatrix.Event) { - users := evt.Content["user_ids"].([]string) + users := evt.Content["user_ids"].([]interface{}) c.debug.Print(users, "are typing") - c.ui.SetTyping(evt.RoomID, users) + + strUsers := make([]string, len(users)) + for i, user := range users { + strUsers[i] = user.(string) + } + c.ui.SetTyping(evt.RoomID, strUsers...) } func (c *MatrixContainer) SendMessage(roomID, message string) { -- cgit v1.2.3