diff options
author | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
commit | f5f854c8144dc29086928a94b2ea86cfae0d0557 (patch) | |
tree | 5a7daccc1be66375edd35b238f348129f540b146 /Presence | |
parent | 6f040764654640730d3f832cf4e41174562718fb (diff) |
Removed redundant imports and other clean up.
Diffstat (limited to 'Presence')
-rw-r--r-- | Presence/ControlMaybe.hs | 1 | ||||
-rw-r--r-- | Presence/DNSCache.hs | 1 | ||||
-rw-r--r-- | Presence/PeerResolve.hs | 12 | ||||
-rw-r--r-- | Presence/Presence.hs | 32 | ||||
-rw-r--r-- | Presence/SockAddr.hs | 5 | ||||
-rw-r--r-- | Presence/XMPPServer.hs | 10 |
6 files changed, 14 insertions, 47 deletions
diff --git a/Presence/ControlMaybe.hs b/Presence/ControlMaybe.hs index c98a6fb9..a101d667 100644 --- a/Presence/ControlMaybe.hs +++ b/Presence/ControlMaybe.hs | |||
@@ -7,7 +7,6 @@ module ControlMaybe | |||
7 | 7 | ||
8 | -- import GHC.IO.Exception (IOException(..)) | 8 | -- import GHC.IO.Exception (IOException(..)) |
9 | import Control.Monad | 9 | import Control.Monad |
10 | import Control.Exception as Exception (IOException(..),catch) | ||
11 | import Data.Functor | 10 | import Data.Functor |
12 | import System.IO.Error | 11 | import System.IO.Error |
13 | 12 | ||
diff --git a/Presence/DNSCache.hs b/Presence/DNSCache.hs index afcc227c..ce35752e 100644 --- a/Presence/DNSCache.hs +++ b/Presence/DNSCache.hs | |||
@@ -43,7 +43,6 @@ import Data.Function | |||
43 | import Data.List | 43 | import Data.List |
44 | import Data.Ord | 44 | import Data.Ord |
45 | import Data.Maybe | 45 | import Data.Maybe |
46 | import System.IO | ||
47 | import System.IO.Error | 46 | import System.IO.Error |
48 | 47 | ||
49 | import SockAddr () | 48 | import SockAddr () |
diff --git a/Presence/PeerResolve.hs b/Presence/PeerResolve.hs index 0854b365..900688c3 100644 --- a/Presence/PeerResolve.hs +++ b/Presence/PeerResolve.hs | |||
@@ -6,24 +6,12 @@ module PeerResolve | |||
6 | , withPort | 6 | , withPort |
7 | ) where | 7 | ) where |
8 | 8 | ||
9 | import Data.List ( nub ) | ||
10 | import Data.Text ( Text ) | 9 | import Data.Text ( Text ) |
11 | import Network.Socket ( SockAddr(..) ) | 10 | import Network.Socket ( SockAddr(..) ) |
12 | import System.Endian ( fromBE32, toBE32 ) | ||
13 | import System.IO.Error ( isDoesNotExistError ) | ||
14 | import Control.Exception ( handle, ErrorCall(..) ) | ||
15 | import qualified Network.BSD as BSD | ||
16 | import qualified Data.Text as Text | ||
17 | import Control.Concurrent | ||
18 | import Control.Concurrent.STM | ||
19 | import Control.Monad | ||
20 | import Data.Maybe | ||
21 | import System.IO.Unsafe | 11 | import System.IO.Unsafe |
22 | 12 | ||
23 | import GetHostByAddr | ||
24 | import DNSCache | 13 | import DNSCache |
25 | import ConnectionKey | 14 | import ConnectionKey |
26 | import ControlMaybe | ||
27 | 15 | ||
28 | {-# NOINLINE global_dns_cache #-} | 16 | {-# NOINLINE global_dns_cache #-} |
29 | global_dns_cache :: DNSCache | 17 | global_dns_cache :: DNSCache |
diff --git a/Presence/Presence.hs b/Presence/Presence.hs index 697c1476..af6597b6 100644 --- a/Presence/Presence.hs +++ b/Presence/Presence.hs | |||
@@ -6,32 +6,27 @@ | |||
6 | module Presence where | 6 | module Presence where |
7 | 7 | ||
8 | import System.Directory | 8 | import System.Directory |
9 | import System.Environment | ||
10 | import System.IO.Error | 9 | import System.IO.Error |
11 | import System.Posix.Signals | 10 | #ifndef THREAD_DEBUG |
12 | import Control.Concurrent (threadDelay,forkIO,forkOS,killThread,throwTo) | 11 | import Control.Concurrent |
12 | #else | ||
13 | import Control.Concurrent.Lifted.Instrument | ||
14 | #endif | ||
15 | |||
13 | import Control.Concurrent.STM | 16 | import Control.Concurrent.STM |
14 | import Control.Concurrent.STM.TMVar | ||
15 | import Control.Monad.Trans | 17 | import Control.Monad.Trans |
16 | import Control.Monad.IO.Class (MonadIO, liftIO) | 18 | import Network.Socket ( SockAddr(..) ) |
17 | import Network.Socket ( SockAddr(..), PortNumber ) | ||
18 | import System.Endian (fromBE32) | ||
19 | import Data.Char | 19 | import Data.Char |
20 | import Data.List (nub, (\\), intersect, groupBy, sort, sortBy ) | 20 | import Data.List (nub, (\\), intersect, groupBy, sort, sortBy ) |
21 | import Data.Ord (comparing ) | 21 | import Data.Ord (comparing ) |
22 | import Data.Monoid ( (<>), Sum(..), getSum ) | 22 | import Data.Monoid ((<>)) |
23 | import qualified Data.Text as Text | 23 | import qualified Data.Text as Text |
24 | import qualified Data.Text.IO as Text | ||
25 | import qualified Data.Text.Encoding as Text | 24 | import qualified Data.Text.Encoding as Text |
26 | import Control.Monad | 25 | import Control.Monad |
27 | import Control.Monad.Fix | ||
28 | import qualified Network.BSD as BSD | ||
29 | import qualified Data.Text as Text | ||
30 | import Data.Text (Text) | 26 | import Data.Text (Text) |
31 | import qualified Data.Map as Map | 27 | import qualified Data.Map as Map |
32 | import Data.Map (Map) | 28 | import Data.Map (Map) |
33 | import Control.Exception ({-evaluate,-}handle,SomeException(..),bracketOnError,ErrorCall(..)) | 29 | import Control.Exception ({-evaluate,-}handle,SomeException(..)) |
34 | import System.IO.Error (isDoesNotExistError) | ||
35 | import System.Posix.User (getUserEntryForID,userName) | 30 | import System.Posix.User (getUserEntryForID,userName) |
36 | import qualified Data.ByteString.Lazy.Char8 as L | 31 | import qualified Data.ByteString.Lazy.Char8 as L |
37 | import qualified ConfigFiles | 32 | import qualified ConfigFiles |
@@ -41,14 +36,7 @@ import Data.Int (Int8) | |||
41 | import Data.XML.Types (Event) | 36 | import Data.XML.Types (Event) |
42 | import System.Posix.Types (UserID,CPid) | 37 | import System.Posix.Types (UserID,CPid) |
43 | import Control.Applicative | 38 | import Control.Applicative |
44 | #ifdef CRYPTONITE_BACKPORT | ||
45 | import Crypto.Error.Types (CryptoFailable (..)) | ||
46 | #else | ||
47 | import Crypto.Error | ||
48 | #endif | ||
49 | import Crypto.PubKey.Curve25519 (SecretKey,toPublic) | 39 | import Crypto.PubKey.Curve25519 (SecretKey,toPublic) |
50 | import Text.Read (readMaybe) | ||
51 | import System.IO | ||
52 | 40 | ||
53 | import ControlMaybe | 41 | import ControlMaybe |
54 | import LockedChan (LockedChan) | 42 | import LockedChan (LockedChan) |
@@ -61,7 +49,7 @@ import ConsoleWriter | |||
61 | import ClientState | 49 | import ClientState |
62 | import Util | 50 | import Util |
63 | import qualified Connection | 51 | import qualified Connection |
64 | import Network.Tox.NodeId (id2key,key2id) | 52 | import Network.Tox.NodeId (key2id) |
65 | import Crypto.Tox (decodeSecret) | 53 | import Crypto.Tox (decodeSecret) |
66 | import DPut | 54 | import DPut |
67 | 55 | ||
diff --git a/Presence/SockAddr.hs b/Presence/SockAddr.hs index 91a03870..b5fbf16e 100644 --- a/Presence/SockAddr.hs +++ b/Presence/SockAddr.hs | |||
@@ -2,10 +2,11 @@ | |||
2 | {-# LANGUAGE StandaloneDeriving #-} | 2 | {-# LANGUAGE StandaloneDeriving #-} |
3 | module SockAddr () where | 3 | module SockAddr () where |
4 | 4 | ||
5 | import Network.Socket ( SockAddr(..) ) | ||
6 | |||
7 | #if MIN_VERSION_network(2,4,0) | 5 | #if MIN_VERSION_network(2,4,0) |
6 | import Network.Socket () | ||
8 | #else | 7 | #else |
8 | import Network.Socket ( SockAddr(..) ) | ||
9 | |||
9 | deriving instance Ord SockAddr | 10 | deriving instance Ord SockAddr |
10 | #endif | 11 | #endif |
11 | 12 | ||
diff --git a/Presence/XMPPServer.hs b/Presence/XMPPServer.hs index cf7aca70..8d294698 100644 --- a/Presence/XMPPServer.hs +++ b/Presence/XMPPServer.hs | |||
@@ -48,10 +48,8 @@ import PeerResolve | |||
48 | import qualified Connection | 48 | import qualified Connection |
49 | import Util | 49 | import Util |
50 | import Network.Address (getBindAddress, sockAddrPort) | 50 | import Network.Address (getBindAddress, sockAddrPort) |
51 | import Blaze.ByteString.Builder (Builder) | ||
52 | 51 | ||
53 | import Debug.Trace | 52 | import Debug.Trace |
54 | import System.IO (hFlush,stdout) | ||
55 | import Control.Monad.Trans (lift) | 53 | import Control.Monad.Trans (lift) |
56 | import Control.Monad.IO.Class (MonadIO, liftIO) | 54 | import Control.Monad.IO.Class (MonadIO, liftIO) |
57 | import Control.Monad.Fix (fix) | 55 | import Control.Monad.Fix (fix) |
@@ -66,7 +64,6 @@ import Control.Concurrent.STM | |||
66 | -- import Control.Concurrent.STM.TChan | 64 | -- import Control.Concurrent.STM.TChan |
67 | import Network.SocketLike | 65 | import Network.SocketLike |
68 | import Text.Printf | 66 | import Text.Printf |
69 | import System.Posix.Signals | ||
70 | import Data.ByteString (ByteString) | 67 | import Data.ByteString (ByteString) |
71 | import qualified Data.ByteString.Char8 as Strict8 | 68 | import qualified Data.ByteString.Char8 as Strict8 |
72 | -- import qualified Data.ByteString.Lazy.Char8 as Lazy8 | 69 | -- import qualified Data.ByteString.Lazy.Char8 as Lazy8 |
@@ -86,21 +83,16 @@ import qualified Text.XML.Stream.Render as XML hiding (content) | |||
86 | import qualified Text.XML.Stream.Parse as XML | 83 | import qualified Text.XML.Stream.Parse as XML |
87 | import Data.XML.Types as XML | 84 | import Data.XML.Types as XML |
88 | import Data.Maybe | 85 | import Data.Maybe |
89 | import Data.List (nub) | ||
90 | import Data.Monoid ( (<>) ) | 86 | import Data.Monoid ( (<>) ) |
91 | import Data.Text (Text) | 87 | import Data.Text (Text) |
92 | import qualified Data.Text as Text (pack,unpack,words,intercalate) | 88 | import qualified Data.Text as Text (pack,unpack,words,intercalate) |
93 | import Data.Char (toUpper,chr,ord) | 89 | import Data.Char (chr,ord) |
94 | import Data.Map (Map) | ||
95 | import qualified Data.Map as Map | 90 | import qualified Data.Map as Map |
96 | import Data.Set (Set, (\\) ) | 91 | import Data.Set (Set, (\\) ) |
97 | import qualified Data.Set as Set | 92 | import qualified Data.Set as Set |
98 | import Data.String ( IsString(..) ) | 93 | import Data.String ( IsString(..) ) |
99 | import qualified System.Random | 94 | import qualified System.Random |
100 | import Data.Void (Void) | 95 | import Data.Void (Void) |
101 | import System.Endian (toBE32) | ||
102 | import Control.Applicative | ||
103 | import System.IO | ||
104 | import DPut | 96 | import DPut |
105 | 97 | ||
106 | -- peerport :: PortNumber | 98 | -- peerport :: PortNumber |