Software /
code /
prosody
File
util/jid.lua @ 33:091f91a1f67a
Let modules set/write globals
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 01 Oct 2008 01:18:19 +0100 |
parent | 29:b847875801e5 |
child | 104:cfbd3b849f9e |
line wrap: on
line source
local match = string.match; module "jid" function split(jid) if not jid then return nil; end local node = match(jid, "^([^@]+)@"); local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)"); local resource = match(jid, "/(.+)$"); return node, server, resource; end