By | fr33domlover |
At | 2015-12-31 |
Title | forgot to parse note events... |
Description |
Edit file src/FunBot/ExtEvents.hs 33188 → 33188
374 374 else empty
375 375 376 376 instance FromJSON ExtEvent where
377 377 parseJSON (Object o) =
378 378 let kind = text $ o .: "type"
- 379 in kind "push" *> (GitPushEvent <$> o .: "data") <|>
- 380 kind "tag" *> (GitTagEvent <$> o .: "data") <|>
- 381 kind "mr" *> (MergeRequestEvent <$> o .: "data") <|>
- 382 kind "issue" *> (IssueEvent <$> o .: "data") <|>
- 383 kind "news" *> (NewsEvent <$> o .: "data") <|>
- 384 kind "paste" *> (PasteEvent <$> o .: "data")
+ 379 event label ctor = kind label *> (ctor <$> o .: "data")
+ 380 in event "push" GitPushEvent <|>
+ 381 event "tag" GitTagEvent <|>
+ 382 event "mr" MergeRequestEvent <|>
+ 383 event "note" NoteEvent <|>
+ 384 event "issue" IssueEvent <|>
+ 385 event "news" NewsEvent <|>
+ 386 event "paste" PasteEvent
385 387 parseJSON v = typeMismatch "ExtEvent" v
386 388 387 389 instance ToJSON ExtEvent where
388 390 toJSON (GitPushEvent commits) = object [ "type" .= ("push" :: Text)
389 391 , "data" .= commits
… … … …