summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-11 15:06:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-11 15:09:00 -0400
commit2c1ceeeaf9a1cad8477e86e8c73c7f7a2de510ab (patch)
tree294a8fc2eda701d0936c77d3f27ac3448780ca24 /Assistant/Alert.hs
parentaace44454a8866e8dab251c2b9c98e2d48e3f071 (diff)
pairing works!!
Finally. Last bug fixes here: Send PairResp with same UUID in the PairReq. Fix off-by-one in code that filters out our own pairing messages. Also reworked the pairing alerts, which are still slightly buggy.
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs21
1 files changed, 15 insertions, 6 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 7eb8550cc..2a08c9ce0 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -32,7 +32,7 @@ data AlertName
= FileAlert TenseChunk
| SanityCheckFixAlert
| WarningAlert String
- | PairRequestReceivedAlert String
+ | PairAlert String
deriving (Eq)
{- The first alert is the new alert, the second is an old alert.
@@ -293,18 +293,27 @@ pairingAlert button = baseActivityAlert
, alertButton = Just button
}
-pairRequestReceivedAlert :: String -> String -> AlertButton -> Alert
-pairRequestReceivedAlert repo msg button = Alert
+pairRequestReceivedAlert :: String -> AlertButton -> Alert
+pairRequestReceivedAlert repo button = Alert
{ alertClass = Message
, alertHeader = Nothing
, alertMessageRender = tenseWords
- , alertData = [UnTensed $ T.pack msg]
+ , alertData = [UnTensed $ T.pack $ repo ++ " is sending a pair request."]
, alertBlockDisplay = False
, alertPriority = High
, alertClosable = True
, alertIcon = Just InfoIcon
- , alertName = Just $ PairRequestReceivedAlert repo
- , alertCombiner = Just $ dataCombiner $ const id
+ , alertName = Just $ PairAlert repo
+ , alertCombiner = Just $ dataCombiner $ \_old new -> new
+ , alertButton = Just button
+ }
+
+pairRequestAcknowledgedAlert :: String -> AlertButton -> Alert
+pairRequestAcknowledgedAlert repo button = baseActivityAlert
+ { alertData = ["Pair request with", UnTensed (T.pack repo), Tensed "in progress" "complete"]
+ , alertPriority = High
+ , alertName = Just $ PairAlert repo
+ , alertCombiner = Just $ dataCombiner $ \_old new -> new
, alertButton = Just button
}