aboutsummaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-15 19:16:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-15 19:16:13 -0400
commiteabe9d8c6177318432eb81120f4d5db05898c891 (patch)
tree6fedada070d79a4afec236a63ead893bc41b04e9 /Assistant
parent34c604b935e6e3e40796c9132ed19d44442cb809 (diff)
add globallyAvailable to remotes
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/DaemonStatus.hs8
-rw-r--r--Assistant/XMPP/Git.hs5
2 files changed, 10 insertions, 3 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs
index 5df2267f7..6c71c60eb 100644
--- a/Assistant/DaemonStatus.hs
+++ b/Assistant/DaemonStatus.hs
@@ -53,15 +53,18 @@ calcSyncRemotes = do
let good r = Remote.uuid r `elem` alive
let syncable = filter good rs
let nonxmpp = filter (not . isXMPPRemote) syncable
+
+ liftIO $ print (nonxmpp, map Remote.globallyAvailable nonxmpp)
return $ \dstatus -> dstatus
{ syncRemotes = syncable
, syncGitRemotes =
filter (not . Remote.specialRemote) syncable
, syncDataRemotes = nonxmpp
- , syncingToCloudRemote =
- any (Git.repoIsUrl . Remote.repo) nonxmpp
+ , syncingToCloudRemote = any iscloud nonxmpp
}
+ where
+ iscloud r = not (Remote.readonly r) && Remote.globallyAvailable r
{- Updates the sycRemotes list from the list of all remotes in Annex state. -}
updateSyncRemotes :: Assistant ()
@@ -69,6 +72,7 @@ updateSyncRemotes = do
modifyDaemonStatus_ =<< liftAnnex calcSyncRemotes
status <- getDaemonStatus
liftIO $ sendNotification $ syncRemotesNotifier status
+
when (syncingToCloudRemote status) $
updateAlertMap $
M.filter $ \alert ->
diff --git a/Assistant/XMPP/Git.hs b/Assistant/XMPP/Git.hs
index 74ce4b725..135c68fbc 100644
--- a/Assistant/XMPP/Git.hs
+++ b/Assistant/XMPP/Git.hs
@@ -293,7 +293,10 @@ checkCloudRepos :: UrlRenderer -> Remote -> Assistant ()
-- TODO only display if needed
checkCloudRepos urlrenderer r =
#ifdef WITH_WEBAPP
- cloudRepoNeeded urlrenderer (Remote.uuid r)
+ unlessM (syncingToCloudRemote <$> getDaemonStatus) $
+ cloudRepoNeeded urlrenderer (Remote.uuid r)
+#else
+ noop
#endif
writeChunk :: Handle -> B.ByteString -> IO ()