Commit Graph

8 Commits

Author SHA1 Message Date
Florian Schmaus ce1cddc722 More checkstyle whitespace related checks 2017-05-24 14:42:38 +02:00
Florian Schmaus 60b07b1d67 Make DiscoverInfoProvider namespace aware
Some servers respond to disco#info requests with

<iq id='npGtO-21' type='result' to='phone@xxx/MAXS' from='xxx'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity type='pep' name='Prosody' category='pubsub'/>
<identity type='im' name='Prosody' category='server'/>
<feature var='urn:xmpp:blocking'/>
<feature var='urn:xmpp:carbons:2'/>
<feature var='urn:xmpp:carbons:1'/>
<feature var='vcard-temp'/>
<feature var='http://jabber.org/protocol/commands'/>
<feature var='urn:xmpp:mam:0'/>
<feature var='jabber:iq:private'/>
<feature var='http://jabber.org/protocol/pubsub#publish'/>
<feature var='http://jabber.org/protocol/disco#info'/>
<feature var='http://jabber.org/protocol/disco#items'/>
<feature var='urn:xmpp:ping'/>
<feature var='msgoffline'/>
<feature var='jabber:iq:roster'/>
<feature var='urn:xmpp:archive:auto'/>
<feature var='urn:xmpp:archive:manage'/>
<feature var='urn:xmpp:archive:pref'/>
<feature var='http://jabber.org/protocol/rsm'/>
<feature xmlns='urn:xmpp:archive'><optional><default/></optional></feature>
</query></iq>

Note the

<feature
xmlns='urn:xmpp:archive'><optional><default/></optional></feature>

which will cause the current parser implementation to parse it as
DiscoInfo Feature resulting in an Exception because some attributes are
missing.

This commit prevents this.
2016-06-03 10:59:10 +02:00
Florian Schmaus bc093b620d Make Provider.parse() just throw Exception
instead of throwing XmlPullParserException, IOException and
SmackException.

Add a guard to AbstractXMPPConnection.processPacket() to always re-throw
RuntimeExceptions.
2015-03-13 09:27:18 +01:00
Florian Schmaus d4a6d8e653 Rename PacketFilter (and implementing classes) and PacketExtension
to StanzaFilter and ExtensionElement.
2015-02-28 13:49:38 +01:00
Florian Schmaus 6fec813ec0 Rework DiscoverInfo
Make Feature and Identity immutable and allow fast lookup of those two
in DiscoverInfo.
2014-10-31 23:44:04 +01:00
Florian Schmaus 452b2aca0f Add 'PacketParserUtils.addPacketextension()' 2014-10-08 16:01:19 +02:00
Florian Schmaus 6980c8e63d Rework Smack Provider design
this is the first stop towards fixing "SMACK-65: parsing should look for
depth", by providing the initial parsing depth to the provider. Some
methods (.e.g parseMessage) now use the depth as abort condition,
instead of a unclean String equals check.

parseIQ() and parseExtension() where both renamed to parse.

This also restricts the Exceptions thrown by the parse method, to just
XmlPullParserException, IOException and SmackException (not really a big
victory, but nevertheless a slight improvement).

StreamFeatureProvider is now gone, we simply use PacketExtensionProvider
for stream features.
2014-10-08 16:01:14 +02:00
Florian Schmaus 91fd15ad86 Prefix subprojects with 'smack-'
instead of using the old baseName=smack appendix=project.name approach,
we are now going convention over configuration and renaming the
subprojects directories to the proper name.

Having a prefix is actually very helpful, because the resulting
libraries will be named like the subproject. And a core-4.0.0-rc1.jar is
not as explicit about what it actually *is* as a
smack-core-4.0.0-rc1.jar.

SMACK-265
2014-04-28 19:44:14 +02:00
Renamed from extensions/src/main/java/org/jivesoftware/smackx/disco/provider/DiscoverInfoProvider.java (Browse further)