1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-12 23:32:05 +01:00
Commit graph

3165 commits

Author SHA1 Message Date
Florian Schmaus
9863b9c458 Use ResolverResult.getResolutionUnsuccessfulException() in MiniDnsResolver 2017-12-05 20:53:05 +01:00
Florian Schmaus
a25971d02b Add AffiliationsExtensionTest 2017-12-05 20:50:34 +01:00
Florian Schmaus
ca1852f6e0 Fix AffiliationsExtension.toXml()
Fixes SMACK-789.
2017-12-05 20:50:34 +01:00
Florian Schmaus
47940ba5ad Fix NPE in DNSResolver.lookupSRVRecords0
in case hostAddresses was null, the isEmpty() check before the log()
invocation would throw an NPE. Thanks to Ingo Bauersachs for reporting
this.

Fixes SMACK-788.
2017-12-05 20:50:34 +01:00
Florian Schmaus
be4aacc71d Smack 4.2.3-SNAPSHOT 2017-11-25 17:59:07 +01:00
Florian Schmaus
0fcacf3d9a Smack 4.2.2 2017-11-25 17:44:45 +01:00
Florian Schmaus
2edbc64957 Refactor reconnection callbacks into an extra class
Fixes SMACK-775
2017-11-25 16:30:18 +01:00
Florian Schmaus
d804d4ed6d Do not abort if we could not get a KeyManagerFactory
using the default algorithm. Instead continue with 'null' as value of
the KeyManager[] array (kms). This makes the SSLContext.init() methods
to search the default security providers for implementations, which is
also OK.

This change is needed because it appears that on Android
KeyManagerFactory.getDefaultAlgorithm returns 'SunX509', which
subsequently results in

W/AbstractXMPPConnection: Connection XMPPTCPConnection[not-authenticated] (0) closed with error
  java.security.NoSuchAlgorithmException: KeyManagerFactory SunX509 implementation not found
      at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:190)
      at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:139)
      at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:77)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnection.java:747)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1200(XMPPTCPConnection.java:149)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1053)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:980)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:996)
      at java.lang.Thread.run(Thread.java:818)

Note that this is possibly because the Secuurity Provider was
not (yet) intialized.
2017-11-23 08:21:55 +01:00
Florian Schmaus
573358b459 Limit the scope of local variables in proceedTLSReceived() 2017-11-23 08:15:52 +01:00
Florian Schmaus
32f681c6e5 Initialize keytsoreType with KeyStore.getDefaultType() 2017-11-22 22:34:56 +01:00
Florian Schmaus
853324a998
Merge pull request #185 from mityada/sm-resumption-race-condition
Prevent race condition after stream resumption
2017-11-22 08:29:36 +01:00
Florian Schmaus
af0c1832fd Update gettingstarted.md 2017-11-21 22:57:10 +01:00
Florian Schmaus
813a5ba63f
Merge pull request #184 from mityada/stream-management-exception
Drop stream management state on StreamManagementException
2017-11-21 21:15:41 +01:00
Florian Schmaus
7d1356bf46
Merge pull request #186 from vanitasvitae/fixCheckstyleRule
Fix comment checkstyle rule description
2017-11-21 21:15:28 +01:00
Florian Schmaus
5ff4387f68 Fix Presence.getPriority() to not return Integer.MIN_VALUE
Fixes SMACK-787.
2017-11-21 21:05:10 +01:00
Florian Schmaus
4775f350ae Add javadoc to Presence.priority 2017-11-21 21:04:13 +01:00
cc94cb8ea2
Fix comment checkstyle rule description 2017-11-20 16:16:55 +01:00
Florian Schmaus
9e11b68144 Add comment style checkstyle rule requiring a space 2017-11-20 08:53:19 +01:00
Dmitry Deshevoy
230a226424 Prevent race condition after stream resumption
New stanzas sent directly after stream resumption might have been added
to unacknowledgedStanzas before the old unacknowledged stanzas
are resent. This caused new stanzas to be sent twice and later led
to a StreamManagementCounterError.

Fixes SMACK-786
2017-11-18 19:37:07 +03: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
809ab6f42f Bump jxmpp to 0.6.0 2017-11-18 15:44:01 +01:00
Florian Schmaus
2341bb4e23 Remove duplicate code in StringUtils 2017-11-16 18:02:02 +01:00
Florian Schmaus
73dd46af21 Remove duplicate numbers from StringUtils.numbersAndLetters
Fixes SMACK-784.
2017-11-16 17:48:29 +01:00
Dmitry Deshevoy
4f11dc5b14 Drop stream management state on StreamManagementException 2017-11-16 19:10:52 +03: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
fe61922fb7
Merge pull request #179 from damencho/4.2
Makes xmpperror descriptive text optional as said in the rfc.
2017-11-09 18:26:14 +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
9a34e9e870 Add RosterUtil.preApproveSubscriptionIfRequiredAndPossible() 2017-11-06 22:39:10 +01:00
Florian Schmaus
1d52a0c8ef Don't let smack-android depend on smack-omemo(-signal)
Fixes SMACK-779.
2017-10-27 20:54:06 +02:00
damencho
a0b0b5a63b Makes xmpperror descriptive text optional as said in the rfc. 2017-10-27 13:14:50 -05:00
Florian Schmaus
1b2521269e Make END_TAG parsing more NPE robust
by calling String.equals() on the constant string and not on the
return value of parser.getName().

Also perform the access to 'parser' on a different LOC than
equals(). This should help debugging things like

okt 25, 2017 2:02:54 PM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection XMPPTCPConnection[***@***/***] (0) closed with error
java.lang.NullPointerException
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1194)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:982)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:998)
	at java.lang.Thread.run(Thread.java:745)

which where recently reported on the forums.
2017-10-27 17:48:00 +02:00
Florian Schmaus
0729392ab8 Fix isSupported discovery of "Push Notifications"
Fixes SMACK-780.
2017-10-14 14:12:28 +02:00
Florian Schmaus
e1e12031ac REPL: Add support to enable a JDWP debug link 2017-10-14 13:38:24 +02:00
Florian Schmaus
01aa6d9c18 DNS: Correctly handle broken SRV records
where the SRV RR points to a target DNS name with no associated A or
AAAA RRs.

Fixes SMACK-781.
2017-10-14 13:29:46 +02:00
Florian Schmaus
122bf06ccc Merge pull request #160 from ibauersachs/parse-error-texts
Get descriptive text from error without lang
2017-09-29 19:04:14 +02:00
Florian Schmaus
c70a1921db Use Async.go() in OMEMO PEPListener
to avoid a deadlock, since the PEP listener is synchronous.
2017-09-29 16:32:32 +02:00
Florian Schmaus
58181bab08 OMEMO: Unspaghetti PEP listener code
While I like Spaghetti, I don't like them in my code.

4 insertions, 24 deletions, *kaboom*. :)
2017-09-29 16:32:32 +02:00
Florian Schmaus
941f29e928 Improve ReconnectionManager
Fixes SMACK-778.
2017-09-29 16:32:32 +02:00
Ingo Bauersachs
699145ee5f Get descriptive text from error without lang
A stanza with <error><text>Some text</text></error>, i.e. without a
xml:lang attribute, did not return the value 'Some text' in
getDescriptiveText().

Insert the empty string as key when the attribute is not present while
parsing the xml. When writing, omit the attribute if the key is the
empty string.
2017-09-27 00:21:40 +02:00
Florian Schmaus
1d943aed20 Merge pull request #173 from iachimoe/4.2
Updated comments to indicate that reject_all is default SubscriptionMode
2017-08-26 19:50:49 +02:00
iachimoe
c92a95136f Updated comments to indicate that reject_all is default SubscriptionMode 2017-08-26 12:16:07 -05:00
Florian Schmaus
339ae1c7a0 Merge pull request #163 from ibauersachs/replymode-public
Make UnknownIqRequestReplyMode public
2017-08-14 22:57:28 +02:00
Florian Schmaus
997766533f Merge pull request #161 from ibauersachs/condition-to-type-mappings
Make XMPPError Condition to Type mapping consistent
2017-08-14 22:57:12 +02:00
Florian Schmaus
6653638e77 Merge pull request #167 from ibauersachs/fix-javadoc-indentation
Fix too shorts indents of two Javadoc comments
2017-08-14 22:56:30 +02:00
Ingo Bauersachs
25114b3fc1 Add a test to ensure all Conditions have a Type mapping 2017-08-14 21:50:30 +02:00