Skip to content

Commit 963d7b2

Browse files
authored
fix small bugs (#1740)
* fix small bugs * toChunks
1 parent 4e4e0a4 commit 963d7b2

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/Simplex/Messaging/Agent/Store/AgentStore.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ checkConfirmedSndQueueExists_ db SndQueue {server, sndId} =
457457
DB.query
458458
db
459459
( "SELECT 1 FROM snd_queues WHERE host = ? AND port = ? AND snd_id = ? AND status != ? LIMIT 1"
460-
#if defined(dpPostgres)
460+
#if defined(dbPostgres)
461461
<> " FOR UPDATE"
462462
#endif
463463
)

src/Simplex/Messaging/Util.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ groupAllOn f = groupOn f . sortOn f
350350
-- n must be > 0
351351
toChunks :: Int -> [a] -> [NonEmpty a]
352352
toChunks _ [] = []
353+
toChunks 0 (x : xs) = [x :| xs]
353354
toChunks n xs =
354355
let (ys, xs') = splitAt n xs
355356
in maybe id (:) (L.nonEmpty ys) (toChunks n xs')

src/Simplex/RemoteControl/Types.hs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module Simplex.RemoteControl.Types
1313
RCPVersion,
1414
VersionRCP,
1515
VersionRangeRCP,
16-
IpProbe (..),
1716
RCHostHello (..),
1817
RCCtrlHello (..),
1918
RCHostPairing (..),
@@ -141,16 +140,6 @@ currentRCPVersion = VersionRCP 1
141140
supportedRCPVRange :: VersionRangeRCP
142141
supportedRCPVRange = mkVersionRange (VersionRCP 1) currentRCPVersion
143142

144-
data IpProbe = IpProbe
145-
{ versionRange :: VersionRangeRCP,
146-
randomNonce :: ByteString
147-
}
148-
deriving (Show)
149-
150-
instance Encoding IpProbe where
151-
smpEncode IpProbe {versionRange, randomNonce} = smpEncode (versionRange, 'I', randomNonce)
152-
smpP = IpProbe <$> (smpP <* "I") *> smpP
153-
154143
-- * Session
155144

156145
data RCHostHello = RCHostHello

0 commit comments

Comments
 (0)