clix.lua

changeset 21
cdeb02d9546d
parent 20
80cc61512f10
child 23
c5f04bdc7c64
--- a/clix.lua	Thu Jan 07 20:59:15 2010 +0000
+++ b/clix.lua	Thu Jan 07 21:22:27 2010 +0000
@@ -9,7 +9,8 @@
 require "verse.client"
 
 -- Global to allow commands to add to it
-short_opts = { v = "verbose", t = "to", f = "from", e = "type", a = "account", p = "password", r = "resource", o = "presence" }
+short_opts = { v = "verbose", t = "to", f = "from", e = "type", a = "account",
+	p = "password", r = "resource", o = "presence", c = "chatroom" }
 
 local command = arg[1];
 
@@ -75,6 +76,9 @@
 	end);
 	conn:hook("binding-success", function ()
 		conn:debug("Connected: "..tostring(conn));
+		if opts.chatroom then
+			conn:send(verse.presence{to=opts.to.."/"..(opts.nick or "clix")});
+		end
 		if opts.presence then
 			conn:send(verse.presence());
 		end

mercurial