mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-25 22:54:43 +00:00
@@ -457,7 +457,7 @@ checkConfirmedSndQueueExists_ db SndQueue {server, sndId} =
|
||||
DB.query
|
||||
db
|
||||
( "SELECT 1 FROM snd_queues WHERE host = ? AND port = ? AND snd_id = ? AND status != ? LIMIT 1"
|
||||
#if defined(dpPostgres)
|
||||
#if defined(dbPostgres)
|
||||
<> " FOR UPDATE"
|
||||
#endif
|
||||
)
|
||||
|
||||
@@ -350,6 +350,7 @@ groupAllOn f = groupOn f . sortOn f
|
||||
-- n must be > 0
|
||||
toChunks :: Int -> [a] -> [NonEmpty a]
|
||||
toChunks _ [] = []
|
||||
toChunks 0 (x : xs) = [x :| xs]
|
||||
toChunks n xs =
|
||||
let (ys, xs') = splitAt n xs
|
||||
in maybe id (:) (L.nonEmpty ys) (toChunks n xs')
|
||||
|
||||
@@ -13,7 +13,6 @@ module Simplex.RemoteControl.Types
|
||||
RCPVersion,
|
||||
VersionRCP,
|
||||
VersionRangeRCP,
|
||||
IpProbe (..),
|
||||
RCHostHello (..),
|
||||
RCCtrlHello (..),
|
||||
RCHostPairing (..),
|
||||
@@ -141,16 +140,6 @@ currentRCPVersion = VersionRCP 1
|
||||
supportedRCPVRange :: VersionRangeRCP
|
||||
supportedRCPVRange = mkVersionRange (VersionRCP 1) currentRCPVersion
|
||||
|
||||
data IpProbe = IpProbe
|
||||
{ versionRange :: VersionRangeRCP,
|
||||
randomNonce :: ByteString
|
||||
}
|
||||
deriving (Show)
|
||||
|
||||
instance Encoding IpProbe where
|
||||
smpEncode IpProbe {versionRange, randomNonce} = smpEncode (versionRange, 'I', randomNonce)
|
||||
smpP = IpProbe <$> (smpP <* "I") *> smpP
|
||||
|
||||
-- * Session
|
||||
|
||||
data RCHostHello = RCHostHello
|
||||
|
||||
Reference in New Issue
Block a user