mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Revert "Throw exception if stanza child contains text"
This reverts commit eb9242768c
.
Turns out, that there is in fact not such restriction in the
RFCs (only for <subject/>, <body/> and the a few others).
This commit is contained in:
parent
62d903171f
commit
51378aebee
2 changed files with 2 additions and 8 deletions
|
@ -290,8 +290,6 @@ public class PacketParserUtils {
|
|||
break outerloop;
|
||||
}
|
||||
break;
|
||||
case XmlPullParser.TEXT:
|
||||
throw new IllegalStateException("Invalid Stanza: Must not contain text or mixed content as direct child of <message/>");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -592,8 +590,6 @@ public class PacketParserUtils {
|
|||
break outerloop;
|
||||
}
|
||||
break;
|
||||
case XmlPullParser.TEXT:
|
||||
throw new IllegalStateException("Invalid Stanza: Must not contain text or mixed content as direct child of <presence/>");
|
||||
}
|
||||
}
|
||||
return presence;
|
||||
|
@ -650,8 +646,6 @@ public class PacketParserUtils {
|
|||
break outerloop;
|
||||
}
|
||||
break;
|
||||
case XmlPullParser.TEXT:
|
||||
throw new IllegalStateException("Invalid Stanza: Must not contain text or mixed content as direct child of <iq/>");
|
||||
}
|
||||
}
|
||||
// Decide what to do when an IQ packet was not understood
|
||||
|
|
|
@ -710,8 +710,8 @@ public class PacketParserUtilsTest {
|
|||
try {
|
||||
PacketParserUtils.parseMessage(PacketParserUtils.getParserFor(invalidControl));
|
||||
fail("Exception should be thrown");
|
||||
} catch(IllegalStateException e) {
|
||||
assertTrue(e.getMessage().contains("Invalid Stanza"));
|
||||
} catch(XmlPullParserException e) {
|
||||
assertTrue(e.getMessage().contains("end tag name </body>"));
|
||||
}
|
||||
|
||||
invalidControl = validControl.replace("Good Message Body", "Bad </message> Body");
|
||||
|
|
Loading…
Reference in a new issue