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()
This commit is contained in:
Adrian Perez de Castro
2016-10-24 17:57:57 +03:00
parent f420a7a8a7
commit fda9fa4e41

View File

@@ -144,15 +144,18 @@ function Room:_log(fmt, ...)
end end
function Room:send_text(text) 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 end
function Room:send_emote(text) 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 end
function Room:send_notice(text) 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 end
function Room:invite_user(user_id) function Room:invite_user(user_id)