diff options
Diffstat (limited to 'Presence/Stanza/Parse.hs')
-rw-r--r-- | Presence/Stanza/Parse.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Presence/Stanza/Parse.hs b/Presence/Stanza/Parse.hs index b025f418..58bf7c51 100644 --- a/Presence/Stanza/Parse.hs +++ b/Presence/Stanza/Parse.hs | |||
@@ -227,9 +227,16 @@ parseMessage ns stanza = do | |||
227 | , Map.empty ) | 227 | , Map.empty ) |
228 | return Message { | 228 | return Message { |
229 | msgLangMap = Map.toList langmap, | 229 | msgLangMap = Map.toList langmap, |
230 | msgThread = if msgThreadContent th/="" then Just th else Nothing | 230 | msgThread = if msgThreadContent th/="" then Just th else Nothing, |
231 | msgType = parseMessageType $ lookupAttrib "type" (tagAttrs stanza) | ||
231 | } | 232 | } |
232 | 233 | ||
234 | parseMessageType :: Maybe Text -> MessageType | ||
235 | parseMessageType (Just "chat") = ChatMsg | ||
236 | parseMessageType (Just "groupchat") = GroupChatMsg | ||
237 | parseMessageType (Just "headline") = HeadlineMsg | ||
238 | parseMessageType _ = NormalMsg | ||
239 | |||
233 | findErrorTag :: Monad m => Text -> NestingXML o m (Maybe StanzaError) | 240 | findErrorTag :: Monad m => Text -> NestingXML o m (Maybe StanzaError) |
234 | findErrorTag ns = do | 241 | findErrorTag ns = do |
235 | x <- nextElement | 242 | x <- nextElement |