diff options
-rw-r--r-- | xmppServer.hs | 11 |
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) | |||
36 | import LocalPeerCred | 36 | import LocalPeerCred |
37 | import XMPPServer | 37 | import XMPPServer |
38 | 38 | ||
39 | unsplitJID (n,h,r) = jid | ||
40 | where | ||
41 | jid0 = maybe h (\n->n<>"@"<>h) n | ||
42 | jid = maybe jid0 (\r->jid0<>"/"<>r) r | ||
43 | |||
44 | type UserName = Text | 39 | type UserName = Text |
45 | type ResourceName = Text | 40 | type ResourceName = Text |
46 | 41 | ||
42 | unsplitJID :: (Maybe UserName,Text,Maybe ResourceName) -> Text | ||
43 | unsplitJID (n,h,r) = username <> h <> resource | ||
44 | where | ||
45 | username = maybe "" (<>"@") n | ||
46 | resource = maybe "" ("/"<>) r | ||
47 | |||
47 | splitJID :: Text -> (Maybe UserName,Text,Maybe ResourceName) | 48 | splitJID :: Text -> (Maybe UserName,Text,Maybe ResourceName) |
48 | splitJID bjid = | 49 | splitJID bjid = |
49 | let xs = splitAll '@' bjid | 50 | let xs = splitAll '@' bjid |