Mercurial > prosody-hg
comparison util/jid.lua @ 6889:7f7920f2aebf
Backout 7e820979fd9b (broke tests)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 02 Oct 2015 12:12:24 +0200 |
| parents | 5de6b93d0190 |
| children | 7f76c77ddcb8 |
comparison
equal
deleted
inserted
replaced
| 6887:da38775bda82 | 6889:7f7920f2aebf |
|---|---|
| 34 if (not host) or ((not resource) and #jid >= hostpos) then return nil, nil, nil; end | 34 if (not host) or ((not resource) and #jid >= hostpos) then return nil, nil, nil; end |
| 35 return node, host, resource; | 35 return node, host, resource; |
| 36 end | 36 end |
| 37 | 37 |
| 38 local function bare(jid) | 38 local function bare(jid) |
| 39 return jid and match(jid, "^[^/]+"); | 39 local node, host = _split(jid); |
| 40 if node and host then | |
| 41 return node.."@"..host; | |
| 42 end | |
| 43 return host; | |
| 40 end | 44 end |
| 41 | 45 |
| 42 local function prepped_split(jid) | 46 local function prepped_split(jid) |
| 43 local node, host, resource = split(jid); | 47 local node, host, resource = split(jid); |
| 44 if host then | 48 if host then |
