Add a MessagePayload trait, and implement it for Body and ChatState.
This commit is contained in:
parent
948ecd7dd7
commit
6a0724d133
2 changed files with 18 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use minidom::Element;
|
||||
|
||||
use error::Error;
|
||||
use super::MessagePayload;
|
||||
|
||||
use ns::CHATSTATES_NS;
|
||||
|
||||
|
|
@ -13,6 +14,8 @@ pub enum ChatState {
|
|||
Paused,
|
||||
}
|
||||
|
||||
impl MessagePayload for ChatState {}
|
||||
|
||||
pub fn parse_chatstate(root: &Element) -> Result<ChatState, Error> {
|
||||
for _ in root.children() {
|
||||
return Err(Error::ParseError("Unknown child in chatstate element."));
|
||||
|
|
|
|||
Loading…
Reference in a new issue