clix.roster: Use rest of line as last parameter for nick and group sub-commands.

Mon, 04 Jul 2011 10:43:43 +0200

author
Kim Alvefur <zash@zash.se>
date
Mon, 04 Jul 2011 10:43:43 +0200
changeset 62
f455dad33efd
parent 61
7d62bff46601
child 63
bbbef9f4a798

clix.roster: Use rest of line as last parameter for nick and group sub-commands.

clix/roster.lua file | annotate | diff | comparison | revisions
--- a/clix/roster.lua	Tue May 17 20:50:46 2011 +0200
+++ b/clix/roster.lua	Mon Jul 04 10:43:43 2011 +0200
@@ -38,20 +38,20 @@
 			unauth = function(param) conn:send(verse.presence{to=param, type="unsubscribed"}); end;
 			del = function(param) conn.roster:delete_contact(param) end;
 			setnick = function(param)
-				local jid, nick = param:match("^(%S+)%s+(%S+)");
+				local jid, nick = param:match("^(%S+)%s+(.+)");
 				local item = conn.roster.items[jid];
 				if not item then print("no jid "..jid); return; end
 				conn.roster:add_contact(jid, nick, item.groups or {}, printor("saved"));
 			end;
 			addgroup = function(param)
-				local jid, group = param:match("^(%S+)%s+(%S+)");
+				local jid, group = param:match("^(%S+)%s+(.+)");
 				local item = conn.roster.items[jid];
 				local groups = item.groups or {};
 				table.insert(groups, group);
 				conn.roster:add_contact(jid, item.name, groups, printor("saved"));
 			end;
 			delgroup = function(param)
-				local jid, group = param:match("^(%S+)%s+(%S+)");
+				local jid, group = param:match("^(%S+)%s+(.+)");
 				local item = conn.roster.items[jid];
 				local groups = item.groups;
 				if not groups then return end;

mercurial