~singpolyma/cheogram-muc-bridge

4e20bfde81a582c86130e9f8a9dff635622515f7 — Stephen Paul Weber 2 years ago e8afef3
Only ping current-version nicks
1 files changed, 1 insertions(+), 1 deletions(-)

M gateway.hs
M gateway.hs => gateway.hs +1 -1
@@ 175,7 175,7 @@ pingSuccessError = uncurry (<|>) . (uncurry (<|>) . (
selfPings :: Config.Config -> (XMPP.IQ -> XMPP.XMPP (STM (Maybe XMPP.IQ))) -> XMPP.XMPP ()
selfPings config sendIQ = forever $ do
	liftIO $ threadDelay 60000000
	sessions <- liftIO $ DB.query_ (Config.db config) (s"SELECT source_muc, source_nick, target_muc, target_nick FROM sessions")
	sessions <- liftIO $ DB.query (Config.db config) (s"SELECT source_muc, source_nick, target_muc, target_nick FROM sessions WHERE version = ?") (DB.Only $ Config.dbVersion config)
	forM_ sessions $ \(sourceMuc, sourceNick, targetMuc, targetNick) -> void $ forkXMPP $ do
		let Just target = XMPP.parseJID (targetMuc ++ s"/" ++ targetNick)
		reply <- (atomicUIO =<<) $ sendIQ $ (XMPP.emptyIQ XMPP.IQGet) {