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

4366 commits

Author SHA1 Message Date
Florian Schmaus
be2fc23f41 proxy: make it the caller's reponsibility to close the socket
This makes the code shorter as there is now a single place where the
socket should be closed.
2020-02-23 19:12:54 +01:00
Florian Schmaus
22d64ebe6b Merge remote-tracking branch 'my/master' 2020-02-23 16:59:50 +01:00
Florian Schmaus
7b5186f651
Merge pull request #353 from vanitasvitae/androidApiExceptionWording
build.gradle: Improve android API exception message
2020-02-20 15:23:13 +01:00
Florian Schmaus
80e9bcf496
Merge pull request #361 from adiaholic/bugFix
Correct ALPHABET in `BASE32.java`
2020-02-20 15:22:48 +01:00
Florian Schmaus
4a6f49e414
Merge pull request #362 from Flowdalic/errorprone-1.1.1
Errorprone Plugin 1.1.1
2020-02-20 14:44:56 +01:00
Florian Schmaus
876aba9866
Merge pull request #365 from vanitasvitae/iv12
OMEMO: Switch to sending 12 byte IV
2020-02-20 14:44:34 +01:00
5ed594fe73
Prevent multi-instancing of OfflineMessageManager 2020-02-17 01:43:40 +01:00
1051cd2640
OMEMO: Switch to sending 12 byte IV 2020-02-16 22:15:56 +01:00
Florian Schmaus
6edbe640cb gradle: bump errorprone plugin to 1.1.1 2020-01-28 17:44:39 +01:00
adiaholic
ee3d25751d Correct ALPHABET in BASE32.java 2020-01-28 20:19:42 +05:30
e81c4814ed
Make use of XmlStringBuilder in AttentionElement 2020-01-06 18:41:30 +01:00
5fd638545d
build.gradle: Improve android API exception message 2019-12-13 16:12:18 +01:00
Florian Schmaus
a6e2523648 proxy: modernize code by using (ByteArrayOutput|DataInput)Stream 2019-11-18 21:09:11 +01:00
Florian Schmaus
14cc0c1e41 proxy: do not call setTcpNoDelay() but instead flush the stream 2019-11-18 19:45:52 +01:00
Florian Schmaus
7afd1fdf46 proxy: make it the caller's reponsibility to close the socket
This makes the code shorter as there is now a single place where the
socket should be closed.
2019-11-18 19:45:25 +01:00
Florian Schmaus
9d626bf787 core: improve AsyncButOrdered
Instead of marking the handle as not running by setting the handler's
value in the map to false, we now remove simply the key if there is no
handler running. This also means we no longer need to use a weak hash
map for this.

Also reduce the size of the synchronized blocks, mainly by scheduling
the handler outside of the synchronized(threadActiveMap) block.

Make some code better readable and add some more comments. Also do
start a new handler thread if the task threw.
2019-11-08 10:14:21 +01:00
Florian Schmaus
a7a298c5d8 Use standard stanza listeners in MultiUserChat
Those, relatively new, listeners guarantee that the individual
listeners are not invoked in concurrently while preserving the
order. Exactly what MultiUserChat previously did with AsyncButOrdered,
which is now no longer needed and hence can be removed.
2019-11-07 14:36:50 +01:00
Florian Schmaus
eb4c2c5572 s/occured/occurred/ 2019-10-30 12:02:36 +01:00
Florian Schmaus
b0277d7e74 Emit <starttls/> as empty element when possible 2019-10-30 12:00:20 +01:00
Florian Schmaus
2915101843 Use isEmpty() in StringUtils.requireNullOrNotEmpty() 2019-10-30 11:56:55 +01:00
Florian Schmaus
6d1252755b Mark more methods in Stanza as final 2019-10-30 09:23:01 +01:00
Florian Schmaus
ee699f24dd Remove DiscoverInfo.Identity(Identity) copy constructor
as there is no need to copy an immutable type.
2019-10-30 08:24:13 +01:00
Florian Schmaus
63a4212f7e Remove clone() from DiscoverInfo.Identity
there is no need to clone immutable types.
2019-10-30 08:22:47 +01:00
Florian Schmaus
63ba524758 Make IQ(IQ) constructor protected 2019-10-30 08:20:25 +01:00
Florian Schmaus
e2223254cf Organize imports everywhere 2019-10-29 21:12:22 +01:00
Florian Schmaus
69767e9538 Rename AbstractIqBuilder subclasses to their designated names 2019-10-29 19:34:18 +01:00
Florian Schmaus
6e32305987 Apply builder pattern to DiscoverInfo
This is the first transformation of an IQ type to the builder type.
2019-10-29 11:14:55 +01:00
Florian Schmaus
36072fb25a test: created mocked connectionwith stanza factory 2019-10-29 10:40:41 +01:00
Florian Schmaus
4b01892129 Remove unused DiscoverInfo instances in PingTest 2019-10-27 07:51:25 +01:00
Florian Schmaus
e2d206e741 Introduce XMPPConnection.add(Message|Presence)Interceptor
add deprecate addStanzaInterceptor().
2019-10-25 21:41:55 +02:00
Florian Schmaus
5db6191110 Introduce StanzaBuilder
As first step to immutable Stanza types.
2019-10-25 21:41:55 +02:00
Florian Schmaus
926c5892ad Fix 260c5539b ("Add support for XEP-0118: UserTune")
Fix a bug in the EqualsBuilder usage in UserTuneElement. Properly
synchronize listeners using CopyOnWriteSet. Make methods and fields
static where sensible and possible. Make
disableUserTuneNotifications() public (why was it private?). And a few
other minor fixes.
2019-10-17 12:27:33 +02:00
adiaholic
260c5539b5 Add support for XEP-0118: UserTune
This commit will enable user to communicate
information about music to which user is listening.
This feature is less of a requirement and more like fun to me.
An attempt at solving SMACK-257.

Incase you see any chances of improvement,
please let me know :)
2019-10-17 12:24:30 +02:00
Florian Schmaus
8f371c5381 Fix datatype.Scalar equals() and hashCode() methods
The previously used Number.equals() and hashCode() was just delegated
to Object and hence did not behave as expected.
2019-10-17 12:24:30 +02:00
Florian Schmaus
db150a850a Fix order of 'actual' and 'expected' in XmlUnitUtils 2019-10-16 19:35:22 +02:00
John Haubrich
7a58862794 gradle: Ensure git command is run projectDir rather than CWD.
The assert on line 659 was causing my build to fail. Two issues caused
gitCommit to be empty.

1. The cmd 'git describe --always --tags --dirty=+' was not given
   enough time to complete and had not exited which meant no text in
   proc.text
2. The two git commands on lines 653 and 658 were run from the
   CWD of my Eclipse IDE, not the $projectDir which caused git to return
   an error 128.

To solve the two issues I added a waitForOrKill method call to
proc (like the srCmd had) and I set the execute to run in $projectDir
which I think was the intent/assumption in the original code.

Also add waitFor on git describe command.
2019-10-12 10:34:05 +02:00
Florian Schmaus
b510d373b5 reactor: have synchronized block include peeking at scheduled actions
If we do not peek at the scheduled actions in the reactors
synchronized block, then there is a kind of lost-update problem. While
Ractor.schedule() will call wakeup() on the selector, a thread could
have already determined the value of selectWait, while being blocked
at the start of the synchronized reactor section. Once it is able to
enter the section, it will use an outdated selectWait value.

This leads to scheduled actions not being executed on time.

Thanks to Eng ChongMeng for reporting this and suggesting the fix.
2019-10-12 10:22:31 +02:00
Florian Schmaus
05c920ab56 Fix typo in comment 2019-10-12 10:14:17 +02:00
Florian Schmaus
e23babf147 Add Stanza.setNewStanzaId() and ensureStanzaIdSet()
Also deprecate setStanzaId() since it was not clear if this would
create a new stanza ID or just ensure that one is set.
2019-10-05 23:16:15 +02:00
Florian Schmaus
133ee29150 Add XmlStringBuilderTest 2019-10-05 23:01:03 +02:00
Florian Schmaus
30bbdf9fdb Remove deprecated methods from Stanza class 2019-10-05 23:00:57 +02:00
Florian Schmaus
f0300dc906 Remove deprecated "PacketReplyTimeout" methods in SmackConfiguration 2019-09-25 23:45:29 +02:00
Florian Schmaus
35cf094386 sasl-javax: Do not set system properties in SASLGSSAPIMechanism
Smack did this for a long time, since eb56f8a55 ("GSSAPI work by Jay
Kline (SMACK-218)."). Not always in a static block though. But
irregardless this is bad practice as it causes side-effects and may
overrides settings.

For example, one users reports:

java.lang.SecurityException: java.io.IOException: gss.conf (No such file or directory)
    at sun.security.provider.ConfigFile$Spi.<init>(ConfigFile.java:137)
    at sun.security.provider.ConfigFile.<init>(ConfigFile.java:102)
    at sun.reflect.GeneratedConstructorAccessor119.newInstance(Unknown Source)
2019-09-25 23:36:21 +02:00
Florian Schmaus
eeb6c52f7e Move SASL logic into AbstractXMPPConnection
Besides the way the transport handles the stream after SASL
<success/>, the SASL logic is independend from the underlying
transport (BOSH, TCP, …). Hence move it up into
AbstractXMPPConnection.

This also has the benefit that we can make some more methods private
or package-private.

Also introduce XmlStringBuilder.optTextChild(), which causes some
associated changes.
2019-09-25 13:49:21 +02:00
Florian Schmaus
c3247ef006 Use optElement() instead of optAppend() in StreamInitiation.toXML() 2019-09-24 23:29:26 +02:00
Florian Schmaus
cf48f12565 Add INSTANCE shortcut to SmackTestUtil 2019-09-24 23:29:00 +02:00
Florian Schmaus
3ee4dd7b3a Move SASL authentication state into SASLMechanism 2019-09-24 10:19:12 +02:00
Florian Schmaus
1d03cfdc79 checkstyle: Remove redundant whitespace check
The "line contains only whitespace character(s)" check is the same as
the trailing whitespace characters check a few lines below.
2019-09-24 10:12:13 +02:00
Florian Schmaus
93aaf6d8d7 Remove SASLAuthentication.init() 2019-09-23 20:01:10 +02:00
Florian Schmaus
bf538129c2 SASL: Add missing InterruptedException to "else if" cascade 2019-09-23 19:54:47 +02:00