diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-03-15 18:21:14 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-03-15 18:21:14 +0200 |
commit | 4db41167976e111c0c2991b408752ef3caeb28d4 (patch) | |
tree | c63effb034ccc448e5309def3b7a405855e1a184 /matrix.go | |
parent | deb2c1ac16ffc79636b1269ebaa05f08ea4a8213 (diff) |
Here have code
Diffstat (limited to 'matrix.go')
-rw-r--r-- | matrix.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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) { |