Commit Graph

456 Commits

Author SHA1 Message Date
Florian Schmaus 2edbc64957 Refactor reconnection callbacks into an extra class
Fixes SMACK-775
2017-11-25 16:30:18 +01:00
Florian Schmaus 9e11b68144 Add comment style checkstyle rule requiring a space 2017-11-20 08:53:19 +01:00
Florian Schmaus 52bd680bb5 Fix OfflineMessageManager.getMessages(List<STring>)
by implementing a new logic how the messages are retrieved.

Previously in case the node list has exactly one item, the method
would perform an unnecessary call to nextResult() causing a delay.

Fixes SMACK-785.
2017-11-18 15:58:08 +01:00
Florian Schmaus 0da3ebf385 Make MUC invitation rejected filter also filter by room address
Fixes SMACK-783.
2017-11-12 12:20:08 +01:00
Florian Schmaus a66c42834f Add findServicesDiscoveryInfo() variant
which does not log some exceptions, but instead comes with an optional
output paramater which returns the encountered exceptions.
2017-11-09 18:16:08 +01:00
Florian Schmaus 5ef6853db6 Improve MultiUserChat's leave() and destroy() login
Remove the "if (!joined) return" guard in leave() this allows to
resync the instances state with the real world state in case they ever
get out of sync.

Also call userHasLeft() in even if leave() throws and in certain
situations if destroy() throws.

Thanks to Дамян Минков and Ingo Bauersachs for pointing this out.
2017-11-07 20:38:19 +01:00
Florian Schmaus 0a4cd79d4e Call MultiUserChat.userHasLeft() before invoking listeners
in case a listener throws, userHasLeft() will eventually have set the
MutliUserChat instance to the right state.
2017-11-07 20:34:43 +01:00
Florian Schmaus d93d214f0e Remove duplicate code in MultiUserChat 2017-11-07 20:34:43 +01:00
damencho 44e4607259 Fix memory leak in MutliUserChat.removeConnectionCallback().
Fix memory leak by removing subject listener
in MutliUserChat.removeConnectionCallback().
Fixes SMACK-782.
2017-11-07 20:34:43 +01:00
Florian Schmaus 65b4f506dc Add SubscribeAnswer.ApproveAndAlsoRequestIfRequired 2017-11-06 22:41:28 +01:00
Florian Schmaus 0729392ab8 Fix isSupported discovery of "Push Notifications"
Fixes SMACK-780.
2017-10-14 14:12:28 +02:00
Florian Schmaus 772e45da92 Introduce NotAPubSubNodeException
Fixes SMACK-759.
2017-08-14 20:23:35 +02:00
Ingo Bauersachs c9b9558cd4 Make add/remove for presence interceptors consistent 2017-08-01 16:17:35 +02:00
Ingo Bauersachs 0b8788a9fc Fix parameter ordering in BoBHash construction 2017-07-20 22:50:34 +02:00
Florian Schmaus 759a7d7a70 Fix InitationListenerTest's timeouts
Don't use Thread.sleep(), isntead we use Mockito's timeout() method.
2017-06-16 22:51:14 +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 ce36fb468c Increase getSocket() timeout in Socks5ClientForInitiatorTest
This will hopefully reduce the false negatives when running the unit
tests with Travis CI.
2017-06-02 12:03:46 +02:00
Florian Schmaus ce1cddc722 More checkstyle whitespace related checks 2017-05-24 14:42:38 +02:00
Alexander Tovstonozhenko b636883ce6 Fix NPE in hashCode() in Occupant when jid is null
Fixes SMACK-764.
2017-05-19 14:09:19 +03:00
Florian Schmaus 5f900d3713 Add PingManager.pingAsync(Jid, long)
and SmackFuture API.
2017-05-16 15:53:03 +02:00
Florian Schmaus 5aab471d64 Improve handling of error response "Pongs" 2017-05-16 15:53:03 +02:00
Florian Schmaus 48b5dc5fe7 Conditionially set the IQ type in ThreadedDummyConnection
and do not set 'from'.
2017-05-16 15:53:03 +02:00
Florian Schmaus 24f6d86452 Fix typo: s/ProsoydWorkaround/ProsodyWorkaround/ 2017-04-19 12:23:17 +02:00
Florian Schmaus ddf888e607 Do not return null in getLeafNodeProsodyWorkaround
and rethrow the original exception.
2017-04-19 12:21:04 +02:00
Florian Schmaus bfab3ec578 PubSubManager.getLeafNode(): Actually employ the prosody workaround 2017-04-19 11:50:01 +02:00
Florian Schmaus e6a51f2151 Add PubSubManager.getLeafNode() and improve prosody workaround
by using the protected constructor and not reflection.
2017-04-19 11:46:39 +02:00
vanitasvitae 10927577ad
Fix getOrCreateLeafNode for prosody 2017-04-19 11:34:47 +02:00
Florian Schmaus 16ede9806a Add PubSubManaer.supportsAutomaticNodeCreation() 2017-04-06 12:32:34 +02:00
Florian Schmaus e73cef8000 Add PubSubManager.tryToPublishAndPossibleAutoCreate(String, I) 2017-04-06 10:14:54 +02:00
Florian Schmaus 8466a5af1a Improve MUCs subject changed notification filter
Filter also messages with bodies or thread element.
2017-04-04 14:27:11 +02:00
Florian Schmaus a887cde1ce Allow MUC room subject changes from the MUCs bare JID
Fixes SMACK-754.
2017-04-04 14:08:19 +02:00
Florian Schmaus 1e0481b355 Add PubSubManager.getOrCreateLeafNode(String) 2017-03-18 18:31:06 +01:00
Florian Schmaus 0a6843f41f Make StreamNegotiator weakly reference XMPPConnection
by extending Manager.

Because FileTransferNegotiator will hold a strong reference to the
StreamNegotiators, which will eventually prevent XMPPConnection from
being GC'ed if no weak references in StreamNegotiator are used.

Thanks to Werner Glanzer for pointing this out.
2017-03-15 21:17:49 +01:00
Florian Schmaus a592a12229 Make InBandBytestreamManager use weak references to XMPPConnection 2017-03-15 15:07:41 +01:00
Florian Schmaus 68cecf2eee Fix the MUC join presence response filter
Error responses do not contain the '110' status. Therefore we have to
filter for them via the stanza id and the from address.
2017-02-20 14:22:19 +01:00
Florian Schmaus 6cfdf2bc6f Use CopyOnWriteArraySet for pingFailedListeners
To prevent

java.util.ConcurrentModificationException
  at java.util.HashMap$HashIterator.nextEntry(HashMap.java:788)
  at java.util.HashMap$KeyIterator.next(HashMap.java:815)
  at org.jivesoftware.smackx.ping.PingManager.pingMyServer(PingManager.java:252)
  at org.kontalk.service.msgcenter.MessageCenterService$3.run(MessageCenterService.java:1114)
  at java.lang.Thread.run(Thread.java:818)

Thanks to Daniele Ricci for reporting this.
2017-02-15 20:16:40 +01:00
Florian Schmaus 4c646436a5 Bump "Error Prone" to 2.0.15
and fix a few things :)
2017-02-11 16:16:41 +01:00
Florian Schmaus ef0af66b21 Enfore spaces for indentation
Although I'm in the tabs camp, Smack uses mostly spaces. Therefore it
is the logical choice for the indentation style.
2017-02-07 22:10:10 +01:00
Florian Schmaus bf1e07e672 Fix chat2.ChatManager's message filter
Thanks to Andras Csete for pointing this out.
2017-02-02 12:46:50 +01:00
Florian Schmaus 187fe37cd7 Fix MucEnterConfiguration.Builder.withPresence(Presence) throw ISE
when presence is of type available. This inverts the logic to fix
this.
2017-01-30 17:09:29 +01:00
Florian Schmaus 5d0dd49e61 Introduce ToMatchesFilter
and refactor the FromMatchesFilter into AbstractFromToMatchesFilter.
2017-01-29 11:08:16 +01:00
Florian Schmaus 33371cffaf Move ChatStateExtension Provider in its own class 2017-01-23 22:59:53 +01:00
Florian Schmaus af1bde4fd0 Make MUC invitations 'from' value an EntityJid
instead of an EntityFullJid, because according to XEP-0045 § 7.8.1.:

"The <room@service> itself MUST then add a 'from' address to the
<invite/> element whose value is the bare JID, full JID, or occupant
JID of the inviter …"
2017-01-20 17:06:06 +01:00
Florian Schmaus 4d7b9318ce Add callbacks for block/unblock events to BlockingCommandManager 2017-01-20 08:57:03 +01:00
Florian Schmaus ff97d2eb35 Make BlockContactsIQProvider idiomatic
The jids list doesn't have to be lazy initialized, because every IQ of
that type is guaranteed to contain at least one JID.

Also use ParserUtils.getJidAttribute().
2017-01-20 08:56:56 +01:00
Florian Schmaus b3662c0682 Make UnblockContactsIQ immutable
and make the serialization function idiomatic.
2017-01-20 08:56:50 +01:00
Florian Schmaus 07cba5b974 Make BlockContactsIQ immutable 2017-01-20 08:56:44 +01:00
Florian Schmaus 965cbcc979 Fix memory leak in MultiUserChat.enter(MucEnterConfiguration)
Thanks to Aleksander Melnichnikov for reporting this issue.

Fixes SMACK-745
2017-01-20 08:56:37 +01:00
Florian Schmaus 7c46f58c80 Rename "PacketReplyTimeout" → "ReplyTimeout" 2017-01-12 20:57:19 +01:00
Florian Schmaus b5415fe841 Don't wait the reply timeout in OfflineMessageManager.getMessages(List<String>)
for the last message. We now count the number of messages we want to
retrieve, and don't wait for another message if we have already
received all.

Thanks to King Jeong Hun for reporting this.
2017-01-12 13:40:55 +01:00