summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmppServer.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/xmppServer.hs b/xmppServer.hs
index b5d54344..64d34ff6 100644
--- a/xmppServer.hs
+++ b/xmppServer.hs
@@ -36,14 +36,15 @@ import UTmp (ProcessID,users)
36import LocalPeerCred 36import LocalPeerCred
37import XMPPServer 37import XMPPServer
38 38
39unsplitJID (n,h,r) = jid
40 where
41 jid0 = maybe h (\n->n<>"@"<>h) n
42 jid = maybe jid0 (\r->jid0<>"/"<>r) r
43
44type UserName = Text 39type UserName = Text
45type ResourceName = Text 40type ResourceName = Text
46 41
42unsplitJID :: (Maybe UserName,Text,Maybe ResourceName) -> Text
43unsplitJID (n,h,r) = username <> h <> resource
44 where
45 username = maybe "" (<>"@") n
46 resource = maybe "" ("/"<>) r
47
47splitJID :: Text -> (Maybe UserName,Text,Maybe ResourceName) 48splitJID :: Text -> (Maybe UserName,Text,Maybe ResourceName)
48splitJID bjid = 49splitJID bjid =
49 let xs = splitAll '@' bjid 50 let xs = splitAll '@' bjid