From 9410b9682a74ff33330214a3e16e1f468441c37d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 21 Apr 2017 01:56:18 +0100 Subject: [PATCH] lib: Export attention as a MessagePayload. --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2ba49d65..1e4b975f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,9 +54,11 @@ pub enum MessagePayload { Body(body::Body), ChatState(chatstates::ChatState), Receipt(receipts::Receipt), + Attention(attention::Attention), } -/// Parse one of the payloads of a `` element, and return `Some` of a `MessagePayload` if parsing it succeeded, `None` otherwise. +/// Parse one of the payloads of a `` element, and return `Some` of a +/// `MessagePayload` if parsing it succeeded, `None` otherwise. pub fn parse_message_payload(elem: &Element) -> Option { if let Ok(body) = body::parse_body(elem) { Some(MessagePayload::Body(body)) @@ -64,6 +66,8 @@ pub fn parse_message_payload(elem: &Element) -> Option { Some(MessagePayload::ChatState(chatstate)) } else if let Ok(receipt) = receipts::parse_receipt(elem) { Some(MessagePayload::Receipt(receipt)) + } else if let Ok(attention) = attention::parse_attention(elem) { + Some(MessagePayload::Attention(attention)) } else { None }