From fda9fa4e41c0b3e6f04ef1bde59ac940a8ca1383 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 24 Oct 2016 17:57:57 +0300 Subject: [PATCH] Return event_id from room methods that send messages The "event_id" returned by the HS is returned directly, instead of a lone table with a single "event_id" member, for the following methods: room:send_text() room:send_emote() room:send_notice() --- matrix/client.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/matrix/client.lua b/matrix/client.lua index 79f008c..b2d8fee 100644 --- a/matrix/client.lua +++ b/matrix/client.lua @@ -144,15 +144,18 @@ function Room:_log(fmt, ...) end function Room:send_text(text) - return self.client._api:send_message(self.room_id, text) + -- XXX: How does error handling work here? + return self.client._api:send_message(self.room_id, text).event_id end function Room:send_emote(text) - return self.client._api:send_emote(self.room_id, text) + -- XXX: How does error handling work here? + return self.client._api:send_emote(self.room_id, text).event_id end function Room:send_notice(text) - return self.client._api:send_notice(self.room_id, text) + -- XXX: How does error handling work here? + return self.client._api:send_notice(self.room_id, text).event_id end function Room:invite_user(user_id)