Comparison

util/jid.lua @ 9324:607b262da853

util.jid: Add missing semicolon
author Kim Alvefur <zash@zash.se>
date Fri, 21 Sep 2018 14:23:21 +0200
parent 8555:4f0f5b49bb03
child 10358:a77d9b3885bb
comparison
equal deleted inserted replaced
9323:3259653512e7 9324:607b262da853
28 -- luacheck: std none 28 -- luacheck: std none
29 29
30 local function split(jid) 30 local function split(jid)
31 if not jid then return; end 31 if not jid then return; end
32 local node, nodepos = match(jid, "^([^@/]+)@()"); 32 local node, nodepos = match(jid, "^([^@/]+)@()");
33 local host, hostpos = match(jid, "^([^@/]+)()", nodepos) 33 local host, hostpos = match(jid, "^([^@/]+)()", nodepos);
34 if node and not host then return nil, nil, nil; end 34 if node and not host then return nil, nil, nil; end
35 local resource = match(jid, "^/(.+)$", hostpos); 35 local resource = match(jid, "^/(.+)$", hostpos);
36 if (not host) or ((not resource) and #jid >= hostpos) then return nil, nil, nil; end 36 if (not host) or ((not resource) and #jid >= hostpos) then return nil, nil, nil; end
37 return node, host, resource; 37 return node, host, resource;
38 end 38 end