1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
From d15ae2193eff9cd38ebce641279996233434b50f Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Sun, 21 Apr 2013 16:05:53 -0400
Subject: [PATCH] avoid using gnuidn
IDN is only used to handle the domain name part of a XMPP server JID.
Which seems not worth the bloat on Android.
---
lib/Network/Protocol/XMPP/JID.hs | 11 ++++-------
network-protocol-xmpp.cabal | 1 -
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/lib/Network/Protocol/XMPP/JID.hs b/lib/Network/Protocol/XMPP/JID.hs
index 91745e0..2a50409 100644
--- a/lib/Network/Protocol/XMPP/JID.hs
+++ b/lib/Network/Protocol/XMPP/JID.hs
@@ -29,7 +29,6 @@ module Network.Protocol.XMPP.JID
import qualified Data.Text
import Data.Text (Text)
-import qualified Data.Text.IDN.StringPrep as SP
import Data.String (IsString, fromString)
newtype Node = Node { strNode :: Text }
@@ -85,16 +84,14 @@ parseJID str = maybeJID where
then Just Nothing
else fmap Just (f x)
maybeJID = do
- preppedNode <- nullable node (stringprepM SP.xmppNode)
- preppedDomain <- stringprepM SP.nameprep domain
- preppedResource <- nullable resource (stringprepM SP.xmppResource)
+ preppedNode <- nullable node (stringprepM id)
+ preppedDomain <- stringprepM id domain
+ preppedResource <- nullable resource (stringprepM id)
return $ JID
(fmap Node preppedNode)
(Domain preppedDomain)
(fmap Resource preppedResource)
- stringprepM p x = case SP.stringprep p SP.defaultFlags x of
- Left _ -> Nothing
- Right y -> Just y
+ stringprepM p x = Just x
parseJID_ :: Text -> JID
parseJID_ text = case parseJID text of
diff --git a/network-protocol-xmpp.cabal b/network-protocol-xmpp.cabal
index 807cda9..3aaad67 100644
--- a/network-protocol-xmpp.cabal
+++ b/network-protocol-xmpp.cabal
@@ -30,7 +30,6 @@ library
build-depends:
base >= 4.0 && < 5.0
, bytestring >= 0.9
- , gnuidn >= 0.2 && < 0.3
, gnutls >= 0.1.4 && < 0.3
, gsasl >= 0.3 && < 0.4
, libxml-sax >= 0.7 && < 0.8
--
1.7.10.4
|