aboutsummaryrefslogtreecommitdiff
path: root/Assistant/DaemonStatus.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-15 18:12:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-15 18:12:45 -0400
commit67e0dfedbb472cadd4a6af023c90f9bda485072a (patch)
treeaa5e66c0e0de5c352559e69873762cd8dc8fcc24 /Assistant/DaemonStatus.hs
parent77e43ec65fff0aaaa1e08caffeb654971aee0b36 (diff)
clear cloud repo nudge when one is created
Diffstat (limited to 'Assistant/DaemonStatus.hs')
-rw-r--r--Assistant/DaemonStatus.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs
index fcfb1a4f3..5df2267f7 100644
--- a/Assistant/DaemonStatus.hs
+++ b/Assistant/DaemonStatus.hs
@@ -43,7 +43,8 @@ modifyDaemonStatus a = do
sendNotification $ changeNotifier s
return b
-{- Returns a function that updates the lists of syncable remotes. -}
+{- Returns a function that updates the lists of syncable remotes
+ - and other associated information. -}
calcSyncRemotes :: Annex (DaemonStatus -> DaemonStatus)
calcSyncRemotes = do
rs <- filter (remoteAnnexSync . Remote.gitconfig) .
@@ -52,6 +53,7 @@ calcSyncRemotes = do
let good r = Remote.uuid r `elem` alive
let syncable = filter good rs
let nonxmpp = filter (not . isXMPPRemote) syncable
+
return $ \dstatus -> dstatus
{ syncRemotes = syncable
, syncGitRemotes =
@@ -65,7 +67,12 @@ calcSyncRemotes = do
updateSyncRemotes :: Assistant ()
updateSyncRemotes = do
modifyDaemonStatus_ =<< liftAnnex calcSyncRemotes
- liftIO . sendNotification =<< syncRemotesNotifier <$> getDaemonStatus
+ status <- getDaemonStatus
+ liftIO $ sendNotification $ syncRemotesNotifier status
+ when (syncingToCloudRemote status) $
+ updateAlertMap $
+ M.filter $ \alert ->
+ alertName alert /= Just CloudRepoNeededAlert
{- Load any previous daemon status file, and store it in a MVar for this
- process to use as its DaemonStatus. Also gets current transfer status. -}