aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-03-20 19:14:39 +0200
committerTulir Asokan <tulir@maunium.net>2018-03-20 19:55:42 +0200
commit095b982603c26e250e61cf006157019e2b55be74 (patch)
tree080644e83572b0dff33e77fbad5e2301243fd5ab /matrix
parent59cd9003013aa62495d2a73c28f22fd7e64f861a (diff)
Show messages in message view while sending
Diffstat (limited to 'matrix')
-rw-r--r--matrix/matrix.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index f20825c..d7e9ed3 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -213,10 +213,14 @@ func (c *Container) HandleTyping(evt *gomatrix.Event) {
c.ui.MainView().SetTyping(evt.RoomID, strUsers)
}
-func (c *Container) SendMessage(roomID, message string) {
+func (c *Container) SendMessage(roomID, text string) (string, error) {
defer c.gmx.Recover()
c.SendTyping(roomID, false)
- c.client.SendText(roomID, message)
+ resp, err := c.client.SendText(roomID, text)
+ if err != nil {
+ return "", err
+ }
+ return resp.EventID, nil
}
func (c *Container) SendTyping(roomID string, typing bool) {
@@ -250,8 +254,6 @@ func (c *Container) JoinRoom(roomID string) error {
return err
}
- // TODO probably safe to remove
- // c.ui.MainView().AddRoom(resp.RoomID)
return nil
}