Commit Graph

74 Commits

Author SHA1 Message Date
Florian Schmaus 2d4312272c Allow roster pushes from our full JID
SMACK-773
2017-07-03 11:07:26 +02:00
Florian Schmaus 08e897113d Add CustomImportOrder checkstyle rule
And matching ImportOrder settings for Eclipse in
resources/eclipse/smack.importorder
2017-06-14 17:12:43 +02:00
Florian Schmaus ce1cddc722 More checkstyle whitespace related checks 2017-05-24 14:42:38 +02:00
Florian Schmaus e141de9aa4 Fix possible NPE in roster push listener
Daniele Ricci reporting the following NPE using Smack 4.1.9

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.indexOf(int)' on a null object reference
       at org.jxmpp.util.XmppStringUtils.parseBareJid(XmppStringUtils.java:124)
       at org.jivesoftware.smack.roster.Roster$RosterPushListener.handleIQRequest(Roster.java:1416)
       at org.jivesoftware.smack.AbstractXMPPConnection$2.run(AbstractXMPPConnection.java:1061)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
       at java.lang.Thread.run(Thread.java:818)

This is possibly caused by a service sending roster pushes for unbound
connections, i.e. where getUsers() returns 'null'. We now log such
situations instead throwing an NPE.
2017-03-10 17:47:13 +01:00
Florian Schmaus 46e8866440 Improve log message of RosterResultListener 2017-01-30 17:09:30 +01:00
Florian Schmaus 85fcb55bd9 Fix roster handling of outgoing 'unavailable' presence
make sure that the 'to' attribute is not set, as otherwhise the
listener would also be invoked e.g. when the user leaves a MUC.
2017-01-29 11:12:30 +01:00
Florian Schmaus 7c46f58c80 Rename "PacketReplyTimeout" → "ReplyTimeout" 2017-01-12 20:57:19 +01:00
Florian Schmaus 90a5e289f8 s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/ 2017-01-03 11:35:04 +01:00
Florian Schmaus 1bce31fcd9 Handle outgoing 'unavailabe' presences in Roster
Fixes SMACK-733
2017-01-03 10:56:01 +01:00
Florian Schmaus 183c605278 Bump JXMPP to 0.5.0 2017-01-02 09:40:46 +01:00
Florian Schmaus 6f66b31fb7 Set default subscription mode to "reject all"
In order to make the defaults of Smack more secure.
2016-12-28 23:42:30 +01:00
Florian Schmaus 7655ac17f2 Re-activate EntityCaps integration test 2016-12-24 10:27:04 +01:00
Florian Schmaus 1d3c48e6ce Add support for IoT Friend approvals
This adds supports for an experimental protocol flow where a pending
friend request's decission is later on deliverd to the requestor after
the owner made its decission.
2016-10-31 14:50:37 +01:00
Florian Schmaus 98655e72aa Fix typo and add URL to Roster javadoc 2016-10-03 13:31:37 +02:00
Florian Schmaus f1e24e2273 Rework Roster's SubscribeListener
allow multiple of them to be installed, instead of at most one. Fixes
deadlock in LowLevelRosterIntegration test because
IoTProvisioningManager's SubscribeListener would not come up with a
decission.
2016-07-31 14:50:59 +02:00
Florian Schmaus b91978dcc4 Add (partial) support for IoT XEPs
That is XEP-0323, -0324, -0325, and -0347.

SMACK-727.
2016-07-21 08:51:11 +02:00
Florian Schmaus d07ed60737 Add support for "Caps Optimizations"
Smack's previous entity caps implementation assumed that an entity lost
its entity caps feature as soon as a presence without caps from that
entity was received. But according to XEP-0115 § 8.4, this is a
perfectly normal optimization technique. We now reset the caps state
after an available presence becomes unavailable.

Also introduce PresenceEventListener, which is required for this
feature.

Also make Roster.preApprove() take a BareJid as argument.

Fixes SMACK-723.
2016-06-30 17:01:46 +02:00
Florian Schmaus fefc8cf332 Log stanza in Roster PresencePacketListener 2016-05-25 22:58:35 +02:00
Florian Schmaus fc3f5ef99e Only reset Roster on clean termination
As otherwise the Roster would be still unitialized after a SM resumption
if the connection was uncleanly terminated.

Thanks to Grigory Fedorov for reporting this.
2016-04-15 17:41:50 +02:00
Florian Schmaus 898912050e Fix missing @param in Roster 2016-04-15 10:23:44 +02:00
Florian Schmaus b94b2586e2 Smack 4.1.7
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQF8BAABCgBmBQJXD/2lXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxMzU3QjAxODY1QjI1MDNDMTg0NTNEMjA4
 Q0FDMkE5Njc4NTQ4RTM1AAoJEIysKpZ4VI41rggH/0DjBLpCfTSdjjKGFNChc+1V
 dW9PaPGFUiPuTt3T2NEa74jGYe4PsPpy5zDsJ8uYi2aq3LAiCQvfk+F5LXjRJFoa
 eftz0GtPvfP42oFg8wyDAebFtb0OtE7aJueSRkYGhA1+kzHBbJ9s6TxqDWcB0UWC
 puLh/DEWDFGX5njln+l10O7b10G0+bSrvece22eP0sQIv4hvZJoPQ5rOpCR1wibL
 ldp6wXI6C/b/oQS9MjHq9SV10S+5GykBqN/UzcFnwRVHLbasqnXeNFLGOnMtx0g9
 DmOolAYKGBN5m7m0rqEj9R+OyNgtefV8sCHE69iNAlpQhbmTqPd5rIhIXIII4U4=
 =yWKV
 -----END PGP SIGNATURE-----

Merge tag '4.1.7'

Smack 4.1.7
2016-04-14 22:30:34 +02:00
Florian Schmaus e6db731810 Add Roster.setRosterLoadedAtLoginDefault(boolean)
Fixes SMACK-715
2016-02-17 09:22:40 +01:00
Florian Schmaus 8997a7d8f3 Fix typo in RosterEntries
s/rosterEntires/rosterEntries/

Fixes SMACK-666 (the issue of the devil).
2016-01-10 19:00:26 +01:00
Florian Schmaus f79a7d9d5f Fix javadoc warnings 2015-12-19 13:30:15 +01:00
Florian Schmaus feff081547 Add "Roster loading failed" callback 2015-12-09 10:56:24 +01:00
Florian Schmaus 45feaecdf7 Make XMPPError imutable and add stanza reference 2015-12-09 10:48:52 +01:00
Florian Schmaus f3817d6358 Don't cache all presences from entities not in Roster
Fixes SMACK-703
2015-12-04 14:51:46 +01:00
Florian Schmaus a5e9037907 Use contains(BareJid) instead of entries.containsKey in Roster 2015-12-01 18:08:54 +01:00
Florian Schmaus 6ede7d0409 Make RosterStore handle corrupted stores.
This can happen for example if the store schema changes across Smack
version.

Previously Smack would simply ignore the entry, which would lead to an
inconsistent view of the Roster.
2015-09-30 10:29:01 +02:00
Florian Schmaus 86548b87bb Rework Roster IQ and DirectoryRosterStore
remove (set|get)ItemStatus. This was always the ask status, which can
only be set to 'subscribe' or is non-existent.

Use the standard (de-)serialization facilities for DirectoryRosterStore.

Fixes Smack-657.
2015-09-29 22:35:50 +02:00
Florian Schmaus 04a0004035 Smack 4.1.4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQF8BAABCgBmBQJV9nAlXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxMzU3QjAxODY1QjI1MDNDMTg0NTNEMjA4
 Q0FDMkE5Njc4NTQ4RTM1AAoJEIysKpZ4VI41sFEIAJlfRspk6S5ymNc4w7u/FT1w
 MpHT/cxqIQIBU9J5dYqeW6Y8O6VuUeknCmZBEv7dIVHroTmvfosMauAyRZJXWeeL
 FQQTBqDJszYdM88x/d5X6d25lCEBdQkdDh2a5s9AIy9RH0iXE74AypuikbroK+VC
 zI3wRPUFq7WnARtmiP2NalSgSNv5ToeicBO+JSniQ+O52ZAlP2FSDfi4uzPPigdP
 Ip/V3eF4Bp0YZimcxAnWdnMU+ciVLClRYKgD3+qTEoic7dx3dzeTyrk1NoLRgQl9
 mfcNXBgUScHZAoSIkR0QiUx9ktPCJ950qa+XtW3B8NtDOZkXegUL/a8ukQAuz+k=
 =qMsC
 -----END PGP SIGNATURE-----

Merge tag '4.1.4'

Smack 4.1.4
2015-09-14 09:05:24 +02:00
Florian Schmaus 23b7626c18 Suppress warning if roster isn't set to load
automatically.
2015-09-07 09:31:51 +02:00
Florian Schmaus 1c716bc1e0 Smack 4.1.3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQF8BAABCgBmBQJVpgWiXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxMzU3QjAxODY1QjI1MDNDMTg0NTNEMjA4
 Q0FDMkE5Njc4NTQ4RTM1AAoJEIysKpZ4VI41G1gH+gIw/seXSSY6vYlVkYEFtR+e
 LV/LArN/eN1ZGc+WjN0EysRyqOBqF8HVHuyO7fF67huDRn62s7hufVY//NTctJ5L
 m4TXwaEUvgjdul7vm/dZcNRYr0jcSpDTFWx2egkOXt3qE9AhnpbnaIJ5c3q9VVVD
 aba88c3NS7quxp0hQm1SNEAmt1CCMPom7YkxdIPKWlLj8N5AF1UuSKwckLLYSUlS
 wloBbITb6EjI1IwszhN6e6o3W+7Pz/1zbFjk0CkKUS+TmhHhKil8TonH8Se/9DYD
 1SVHxvZa8LHWsU9G/R1Nhl69K2+GHEUbGmXalFmyPIf5ifhYyNimpx9krXQUuLs=
 =3/cn
 -----END PGP SIGNATURE-----

Merge tag '4.1.3'

Smack 4.1.3
2015-07-15 09:37:46 +02:00
Florian Schmaus ae944d3546 Only wait in Roster's presence listener if loading
otherwhise skip waitUntilLoaded(). This introduces RosterState.

SMACK-681
2015-07-13 12:58:43 +02:00
Florian Schmaus 0555297a6e Fix Roster.waitUntilLoaded and make it interruptable
waitTime and start need to be initialized outside of the while body.
2015-07-03 14:46:55 +02:00
Florian Schmaus 3bb06b8429 Wait in Roster's presence listener until Roster is loaded
Fixes SMACK-681.
2015-07-03 14:24:13 +02:00
Florian Schmaus bfdcfba092 Throw NotConnectedException instead of NoResponseException
if the connection is not connected in sendStanzaWithResponseCallback and
in PacketCollector.

Also decrease log level if roster result listener's exeption callback is
invoked with a NotConnectedException.
2015-07-03 13:01:53 +02:00
Florian Schmaus 58402c5615 Bump jxmpp to 0.5.0-alpha5 and change Roster API
to only allow bare JIDs as roster entires.
2015-06-06 11:16:12 +02:00
Florian Schmaus 1d1ea5dd10 Improve Roster API
Make Roster entries Map from BareJid to RosterEntry, since only
bare JIDs are allowed as roster items as per RFC 6121 § 3.1.1

   When a user sends a presence subscription request to a potential
   instant messaging and presence contact, the value of the 'to'
   attribute MUST be a bare JID <contact@domainpart> rather than a full
   JID <contact@domainpart/resourcepart>,…

Also some further Roster API changes regarding JIDs.
2015-05-27 22:34:43 +02:00
Florian Schmaus c125a3b055 Bump jxmpp to 0.5.0-alpha4 2015-05-27 19:29:51 +02:00
Florian Schmaus 2365c4c208 Add Roster.addSubscribeListener()
Remove unnecessary 'Unsubscribe' case in Roster: It is not required to
acknowledge these.
2015-05-21 22:41:21 +02:00
Florian Schmaus f369a009ac Rename 'serviceName' to 'xmppServiceDomain'
Also use 'null' as default value for the resource, to enforce server
generated resources.

Fixes Smack-665
2015-05-19 09:26:59 +02:00
Florian Schmaus 21c7007212 Make Roster.waitUntilLoaded() package-private
there is no point in having it 'protected', since Roster is not
subclassable.
2015-05-15 17:04:10 +02:00
Florian Schmaus 8dd12e7220 Try that Roster is loaded after Roster.getInstaceFor(XMPPConnection)
Fixes SMACK-633
2015-05-15 17:02:52 +02:00
Florian Schmaus e3dced6eea Fix NPE in Roster if 'from' is null 2015-04-12 16:22:41 +02:00
Florian Schmaus 1eb315d6b7 Add Manager.getAuthenticatedConnectionOrThrow() 2015-04-09 19:00:03 +02:00
Florian Schmaus dddba8f08c Allow Roster for anonymous connections
Fixes SMACK-628.
2015-04-06 13:56:32 +02:00
Florian Schmaus b4694ec152 Add FinalClass checkstyle check
And mark affected classes final.
2015-04-06 10:45:12 +02:00
Florian Schmaus dc373f641c Make Smack Java8's javac and javadoc ready 2015-04-04 17:16:27 +02:00
Florian Schmaus 64d134052d Enable javadoc checkstyle
and fix violations.
2015-03-29 12:29:32 +02:00