Sat, 25 Aug 2018 00:19:51 +0200
clix.publish_atom: Default to XEP-0277 node, require --title or --content
short_opts.h = "history"; return function (opts, arg) if opts.short_help then print("Bounce received messages to another JID"); return; end local function on_connect(conn) -- Allow selective bouncing local only_node, only_server, only_resource; if opts.only_from then only_node, only_server, only_resource = jid.split(opts.only_from); end local function should_bounce(stanza) local node, server, resource = jid.split(stanza.attr.from); if only_node and (node ~= only_node) or only_server and (server ~= only_server) or only_resource and (resource ~= only_resource) then return false; end return true; end local function on_message(message) local delay = message:get_child("delay", "urn:xmpp:delay"); if (delay and not opts.history) or not should_bounce(message) then return; end message.attr.from = nil; message.attr.to = opts.to; message.attr.type = opts.type or (opts.chatroom and "groupchat") or "chat"; conn:send(message); end conn:hook("message", on_message); end return clix_connect(opts, on_connect); end