mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
message: Fix wrong element for xml:lang.
This commit is contained in:
parent
f69f567448
commit
833ef068c6
1 changed files with 2 additions and 2 deletions
|
@ -168,7 +168,7 @@ impl TryFrom<Element> for Message {
|
||||||
for _ in elem.children() {
|
for _ in elem.children() {
|
||||||
return Err(Error::ParseError("Unknown child in body element."));
|
return Err(Error::ParseError("Unknown child in body element."));
|
||||||
}
|
}
|
||||||
let lang = get_attr!(root, "xml:lang", default);
|
let lang = get_attr!(elem, "xml:lang", default);
|
||||||
let body = Body(elem.text());
|
let body = Body(elem.text());
|
||||||
if bodies.insert(lang, body).is_some() {
|
if bodies.insert(lang, body).is_some() {
|
||||||
return Err(Error::ParseError("Body element present twice for the same xml:lang."));
|
return Err(Error::ParseError("Body element present twice for the same xml:lang."));
|
||||||
|
@ -177,7 +177,7 @@ impl TryFrom<Element> for Message {
|
||||||
for _ in elem.children() {
|
for _ in elem.children() {
|
||||||
return Err(Error::ParseError("Unknown child in subject element."));
|
return Err(Error::ParseError("Unknown child in subject element."));
|
||||||
}
|
}
|
||||||
let lang = get_attr!(root, "xml:lang", default);
|
let lang = get_attr!(elem, "xml:lang", default);
|
||||||
let subject = Subject(elem.text());
|
let subject = Subject(elem.text());
|
||||||
if subjects.insert(lang, subject).is_some() {
|
if subjects.insert(lang, subject).is_some() {
|
||||||
return Err(Error::ParseError("Subject element present twice for the same xml:lang."));
|
return Err(Error::ParseError("Subject element present twice for the same xml:lang."));
|
||||||
|
|
Loading…
Reference in a new issue