# HG changeset patch # User Matthew Wild # Date 1284565214 -3600 # Node ID 4f4fe532a8892b64fc31a06652aa4ecc26339a97 # Parent 89070edde205ea13a8cd8b4beacb20a6b9ac6e91 clix.lua: clix_connect(): Accept a list of plugins to load for the Verse connection diff -r 89070edde205 -r 4f4fe532a889 clix.lua --- a/clix.lua Wed Sep 15 16:39:38 2010 +0100 +++ b/clix.lua Wed Sep 15 16:40:14 2010 +0100 @@ -52,7 +52,7 @@ end end -function clix_connect(opts, on_connect) +function clix_connect(opts, on_connect, plugins) local account = accounts[opts.account or "default"]; if not (account and account.jid) then io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); @@ -60,6 +60,9 @@ end verse.set_logger(opts.verbose and verse.logger() or function () end); local conn = verse.new(verse.logger()); + for _, plugin in ipairs(plugins or {}) do + conn:add_plugin(plugin); + end conn.log.debug = opts.verbose; conn:hook("authentication-failure", function (err) conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or ""));