added pair listener thread

This commit is contained in:
Joey Hess 2012-09-08 15:07:44 -04:00
parent aa0227958e
commit 0f0c7f8d70
5 changed files with 110 additions and 3 deletions

View file

@ -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