From 30eec8161973cd49dafbf6b1900a0d4e88bc67fb Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 4 Jul 2016 18:34:23 +0300 Subject: [PATCH] Update client-send-message.lua to not do an initial sync The initial sync is not needed, provided that the user has to supply anyway the room ID or alias in the command line of the script. --- examples/client-send-message.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/client-send-message.lua b/examples/client-send-message.lua index 97a4f81..7df2cdd 100644 --- a/examples/client-send-message.lua +++ b/examples/client-send-message.lua @@ -12,13 +12,11 @@ if #arg ~= 4 then end local client = require "matrix" .client(arg[1]) -client:login_with_password(arg[2], arg[3]) --- FIXME: This does not resolve room aliases, it works only with room IDs -local room = client.rooms[arg[4]] -if not room then - room = client:join_room(arg[4]) -end +-- Passing "true" as last parameter skips the initial sync, which can be slow +client:login_with_password(arg[2], arg[3], true) +local room = client:join_room(arg[4]) room:send_text(io.read("*a")) + client:logout()