summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/XMPP/Git.hs17
1 files changed, 8 insertions, 9 deletions
diff --git a/Assistant/XMPP/Git.hs b/Assistant/XMPP/Git.hs
index 0a452154b..a088f459e 100644
--- a/Assistant/XMPP/Git.hs
+++ b/Assistant/XMPP/Git.hs
@@ -250,12 +250,9 @@ xmppRemotes cid = case baseJID <$> parseJID cid of
where
matching loc r = repoIsUrl r && repoLocation r == loc
-whenXMPPRemote :: ClientID -> Assistant () -> Assistant ()
-whenXMPPRemote cid = unlessM (null <$> xmppRemotes cid)
-
handlePushInitiation :: NetMessage -> Assistant ()
handlePushInitiation (Pushing cid CanPush) =
- whenXMPPRemote cid $
+ unlessM (null <$> xmppRemotes cid) $
sendNetMessage $ Pushing cid PushRequest
handlePushInitiation (Pushing cid PushRequest) =
go =<< liftAnnex (inRepo Git.Branch.current)
@@ -268,12 +265,14 @@ handlePushInitiation (Pushing cid PushRequest) =
<$> gitRepo
<*> getUUID
liftIO $ Command.Sync.updateBranch (Command.Sync.syncBranch branch) g
- debug ["pushing to", show rs]
selfjid <- ((T.unpack <$>) . xmppClientID) <$> getDaemonStatus
- forM_ rs $ \r -> xmppPush cid $ taggedPush u selfjid branch r
-handlePushInitiation (Pushing cid StartingPush) =
- whenXMPPRemote cid $
- void $ xmppReceivePack cid
+ forM_ rs $ \r -> alertWhile (syncAlert [r]) $
+ xmppPush cid $ taggedPush u selfjid branch r
+handlePushInitiation (Pushing cid StartingPush) = do
+ rs <- xmppRemotes cid
+ unless (null rs) $
+ void $ alertWhile (syncAlert rs) $
+ xmppReceivePack cid
handlePushInitiation _ = noop
handleDeferred :: NetMessage -> Assistant ()