Comparison

util/jid.lua @ 365:a59300fc22ec

Add jid.bare() helper function
author Matthew Wild <mwild1@gmail.com>
date Thu, 20 Nov 2008 23:28:16 +0000
parent 109:7efedc96352a
child 366:5691edc7dd63
comparison
equal deleted inserted replaced
364:02b8f2ffa6a7 365:a59300fc22ec
10 local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)"); 10 local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)");
11 local resource = match(jid, "/(.+)$"); 11 local resource = match(jid, "/(.+)$");
12 return node, server, resource; 12 return node, server, resource;
13 end 13 end
14 14
15 function bare(jid)
16 local node, host = split(jid);
17 return node.."@"..host;
18 end
19
15 return _M; 20 return _M;