summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-08 15:07:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-08 15:07:44 -0400
commit0f0c7f8d701f813f226424d5ae2f21f40a983536 (patch)
tree607f274278fd76ff48ca774bd971f2c2256cb7e7 /Assistant/Alert.hs
parentaa0227958eeb5fb1580bbd461340c6d3eb4be611 (diff)
added pair listener thread
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs20
1 files changed, 19 insertions, 1 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 296f992bd..cb2366f44 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -27,7 +27,11 @@ data AlertPriority = Filler | Low | Medium | High | Pinned
{- An alert can have an name, which is used to combine it with other similar
- alerts. -}
-data AlertName = FileAlert TenseChunk | SanityCheckFixAlert | WarningAlert String
+data AlertName
+ = FileAlert TenseChunk
+ | SanityCheckFixAlert
+ | WarningAlert String
+ | PairRequestAlert String
deriving (Eq)
{- The first alert is the new alert, the second is an old alert.
@@ -259,6 +263,20 @@ sanityCheckFixAlert msg = Alert
alerthead = "The daily sanity check found and fixed a problem:"
alertfoot = "If these problems persist, consider filing a bug report."
+pairRequestAlert :: String -> String -> Alert
+pairRequestAlert repo msg = Alert
+ { alertClass = Message
+ , alertHeader = Just $ tenseWords ["Pair request"]
+ , alertMessageRender = tenseWords
+ , alertData = [UnTensed $ T.pack msg]
+ , alertBlockDisplay = True
+ , alertPriority = High
+ , alertClosable = True
+ , alertIcon = Just "info-sign"
+ , alertName = Just $ PairRequestAlert repo
+ , alertCombiner = Just $ dataCombiner $ const id
+ }
+
fileAlert :: TenseChunk -> FilePath -> Alert
fileAlert msg file = (activityAlert Nothing [f])
{ alertName = Just $ FileAlert msg