Commit Graph

896 Commits

Author SHA1 Message Date
Florian Schmaus 001985647a Merge branch '4.4'
This also fixes a errornous merge where the same branch with different
commit was merged into master and 4.4

The conflicting commits are

4.4:
8f760eaeb3  getRawValueCharSequences
e626580f68

master:
b47225c2c1  getRawValues
097d245358
2021-08-23 18:02:00 +02:00
Florian Schmaus 0d73c21945 [pubsub] FormNode(Provider) should not fail if there is no DataForm
Error IQ respones may not contain a data form, e.g.

<iq type="error" id="6LXNC-48" from="pubsub.openfire.xmpp.test" to="anno@openfire.xmpp.test/5dsi4g084a">
  <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
    <configure node="fdp/submitted/spot_report"/>
  </pubsub>
  <error code="403" type="auth">
    <forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
  </error>
</iq>

Also FormNode's toXML() already handled the case where submitForm was
'null'. Only the constructor threw a IAE if submitForm was 'null'.

Fixes SMACK-910.

Closes: https://github.com/igniterealtime/Smack/pull/471
2021-08-23 17:39:59 +02:00
Florian Schmaus b9be45ae2c [xdata] Fix ProtectedMembersInFinalClass Error Prone warning 2021-08-03 22:07:04 +02:00
Florian Schmaus 59d3d75a71 Merge branch '4.4' 2021-08-03 21:54:50 +02:00
Florian Schmaus 8f760eaeb3 [caps] Use the raw character data of form fields when caclulating the hash
Fixes SMACK-909.
2021-07-19 15:38:42 +02:00
Florian Schmaus e626580f68 [xdata] Safe the raw character data of form field values
Related to SMACK-909.
2021-07-19 15:38:42 +02:00
Florian Schmaus b47225c2c1 [caps] Use the raw character data of form fields when caclulating the hash 2021-07-18 17:22:06 +02:00
Florian Schmaus 097d245358 [xdata] Safe the raw character data of form field values 2021-07-18 17:21:50 +02:00
Florian Schmaus 4643d07ef4 [xdata] Add missing ensureAtMostSingleValue() to parseBooleanFormField 2021-07-18 17:20:50 +02:00
Florian Schmaus 31e4e1faf2 Do not call XmlPullParser.getName() when the event is unknown
XmlPullParser.getName() only returns a result if the current parser
event is START_ELEMENT or END_ELEMENT. If this is not the case, then
the method may throw (if StAX is used).
2021-07-06 13:37:57 +02:00
Florian Schmaus 5eef31e49c Do not call XmlPullParser.getName() when the event is unknown
XmlPullParser.getName() only returns a result if the current parser
event is START_ELEMENT or END_ELEMENT. If this is not the case, then
the method may throw (if StAX is used).
2021-07-06 12:33:11 +02:00
Florian Schmaus 3fde4830e4 Merge branch '4.4' 2021-06-25 15:08:36 +02:00
Florian Schmaus 899813a668
Merge pull request #467 from Flowdalic/4.4-data-forms
Proposed data form updates for 4.4
2021-06-04 20:58:57 +02:00
Florian Schmaus 26e6efa767 [address] Fix NPE in MultipleRecipientManager
The arguments 'to', 'cc, and 'bcc' may be null, hence ensure that they
are non-null when calling e.g. size() on them.

Fixes SMACK-907

Fixes: df96c57093 ("[address] Get rid of PacketCopy workaround")
2021-06-03 19:10:07 +02:00
Florian Schmaus 39b211cde3 [muc] Use StanzaCollector.nextResultBlockForever() in MultiUserChat.nextMessage() 2021-05-12 10:18:17 +02:00
Florian Schmaus b0729d83a8 [jingle] Do not call nextResult() in JingleUtil
StanzaCollector.nextResult() will not cancel the related stanza
collector potentially causing a resource leak.
2021-05-12 10:12:59 +02:00
Florian Schmaus aab48570c9 Call XMPPConnection.sendIqRequestAndWaitForResponse(IQ) where possible
Refactored using

find . -type f -name "*.java" |\
	 xargs sed -i -E |\
		's/\.createStanzaCollectorAndSend\((\w+)\)\.nextResultOrThrow\(\);/.sendIqRequestAndWaitForResponse(\1);/'

and some manual refactoring.
2021-05-12 10:12:40 +02:00
Florian Schmaus c9ea1c11b6 [search] Return and expect the high-level forms API types 2021-05-02 22:02:40 +02:00
Florian Schmaus 6ec654ad1e [muc] Fix javadoc of MultiUserChat.getConfigurationForm()
This method no longer returns null.
2021-05-02 22:02:00 +02:00
Florian Schmaus 6af38482de [iqversion] Use IQ builder pattern 2021-05-02 17:16:58 +02:00
Florian Schmaus 469d4fb0dc [time] Use IqBuilder pattern and improve API 2021-05-02 17:16:58 +02:00
Florian Schmaus 6b14fcab75 [geoloc] Mark Builder constructor as deprecated 2021-05-02 17:16:58 +02:00
Florian Schmaus 6011d566cf [geoloc] Do not use Time IQ for timezone operations 2021-05-02 17:16:58 +02:00
Florian Schmaus 5cd77ec741 [geoloc] Mark Builder class final 2021-05-02 16:32:42 +02:00
Florian Schmaus 64c82ca0cf [muc] Add MultiUserChat.destroy() 2021-04-23 17:34:47 +02:00
Florian Schmaus c95c8264da [muc] Improve javadoc of MultiUserChat.destory(String, EntityBareJid) 2021-04-18 21:38:55 +02:00
Florian Schmaus 3d4e7938a7 Make ExtensionElement marker interface wrt. QNAME field
ExtensionElement is now a marker interface that requires all
implementation non-abstract classes to carry a static final QNAME
field (of type QName). This is verified by a new unit test.

Also FullyQualifiedElement is renamed to simply XmlElement. XmlElement
is used over ExtensionElement when implementing classes do not
statically know the qualified name of the XML elements they
represent. In general, XmlElement should be used sparingly, and every
XML element should be modeled by its own Java class (implementing
ExtensionElement).
2021-04-18 21:07:19 +02:00
Florian Schmaus 5493a22e44 Merge branch '4.4' 2021-04-18 17:25:14 +02:00
Florian Schmaus 961882ff7f Add more QNAME fields to extension element classes 2021-04-18 17:23:34 +02:00
Florian Schmaus 36c7521ca2 [offline] Add OfflineMessageInfo.QNAME field
Fixes SMACK-905.
2021-04-18 17:17:48 +02:00
Florian Schmaus b0abfe1bba [offline] Make OfflineMessageManager.NAMESPACE public 2021-04-18 17:16:38 +02:00
Florian Schmaus fbddd074bc [gradle] Do not use deprecated 'compile' directive 2021-04-14 20:30:51 +02:00
Dan Caseley b7709f583d Make muc.join() mirror muc.leave() and return the self-presence 2021-04-07 10:33:38 +01:00
Florian Schmaus 090858f467 [xdata] Automatically fill required fields with a default value 2021-04-01 12:55:28 +02:00
Florian Schmaus 68edc8b9f5 [xdata] Allow FillableForm.write() ot overwrite already filled fields 2021-04-01 12:54:52 +02:00
Florian Schmaus 61713c500c Smack 4.4.2
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAmBcSRtfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFJs0wf/TYm4e4LlBiekmar8YnfaAObT9loDiqMJjO5s4g+trYx2U3gCKkRvKI0P
 U/jzqoJohcPY+5s/fkGKaBWjzFD5WucHyvNaP01D4EWSvHXpCMElbSxY1Uz3X4k1
 t0pmdb27DoHhtdqMfw1Cg7Nba4M+ZzdrEIkDRgCNA8H0mJoKpnsDAg8Y6kEUnvt6
 WQxmIZ49ZT9UOQnVbsXUk4t5DZDz1GdQggrDS5Sh+rZaRFy1KyDgLC+X4NQO99RV
 v3Tf4VRIy+6Nen7L/av3qwSBRqpvc1TEJauNwOnYvyuDwpwjE0tEfRuFZ8wjtkAz
 CKF+LLor+WA5Y2GCXEegLJxVd9Je6Q==
 =hZJ2
 -----END PGP SIGNATURE-----

Merge tag '4.4.2'

Smack 4.4.2
2021-03-25 11:45:03 +01:00
Florian Schmaus d07d46bbdc [chat2] Fix resource unlock condition
If the resource of the updated presence is equal to the currently
locked resource, then no further action is required.

Thanks to Pedro Oliveira for reporting this.

Reported-by: Pedro Oliveira <kanytu@gmail.com>
2021-03-25 08:22:12 +01:00
Florian Schmaus eb31479913 [muc] Make sendMessage() return a MessageView of the sent message 2021-03-25 08:19:53 +01:00
Florian Schmaus ed807d5954 Merge branch '4.4' 2021-03-23 21:41:25 +01:00
Florian Schmaus 4381d04831 [muc] Introduce MucMessageInterceptor 2021-03-23 21:27:10 +01:00
Florian Schmaus 4fefa92e40 Merge branch '4.4' 2021-03-19 09:47:07 +01:00
Florian Schmaus d75cd2acb8 [filetransfer] Pre-register 'stream-method' form field
Fixes SMACK-904.
2021-03-14 19:34:28 +01:00
Florian Schmaus adc159186c [formtypes] Introduce LOOKASIDE_FIELD_REGISTRY
Some field's like stream-method of XEP-0096, which is of type
list-single, need to be pre-registered.
2021-03-14 17:58:13 +01:00
Florian Schmaus 2779187d8c [filetransfer] Set the status to error in setException()
FileTransfer would previously not change the status, even though an
exception has been set, leading users to believe that the transfer is
still ongoing, when it is not.
2021-03-14 17:54:03 +01:00
Florian Schmaus c564c89c40 [extensions] Add OutgoingFileTransfer.setCallback()
Some methods of OutgoingFileTransfer take already the
NegotiationProgress callback as argument, some do not. The API is not
ideal, and adding a setter for the callback at least makes it possible
to always have the callback.
2021-03-14 17:52:12 +01:00
Florian Schmaus 9d1b88a877 [muc] Do not filter for presence ID if #stable_id is not announced
On leave(), do not filter for presence ID if the MUC service does not
announce #stable_id.
2021-03-14 12:48:01 +01:00
Florian Schmaus 48f5e349b9 Smack 4.4.1
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAmA/eF1fFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFLlCQf6A9u5hd2v36Cve/Iopx/GAjuHBNu/7DYop7gP7vLtKxUBGCS/DLn8kaov
 ujpTvdcpm6pg7F4uivMnADFqkkL9cUwsBPDyNY8c0ygfGzVPU8P47g00/SBhB7kP
 0/0In4eunXt8+tfs/afHrr1kQG66lq5J/9q8M6bbC9pUYO2g5Flxes0WW9azluVh
 zs39CCtXPeXwr6Lh+HNEyIe/WiHKnOj7zkwpV7htmOnPaedlRJj/e8KbcBDxmZhg
 zbMoI3Puq3grlA6spke6Z7HK6IeFZjbZABI4EeCEUVhUq1VvL0JurV92S672dty+
 SXX64GbA5TLbVq04I+NP28x9kgnRiw==
 =skkJ
 -----END PGP SIGNATURE-----

Merge tag '4.4.1'

Smack 4.4.1
2021-03-03 13:39:57 +01:00
Frank Matheron d4d2a7a6d8 [xdata] Do not require FORM_TYPE field in FilledForm
The FillableForm API is the most convenient way of filling out a
form. Currently only forms with a FORM_TYPE can be filled, due to a
restriction in FillableForm. This makes filling out untyped forms very
cumbersome.

This commit removes the required FORM_TYPE when using FilledForm (and
therefor FillableForm). Some subclasses of FilledForm already check
that the correct FORM_TYPE is set using FilledForm#ensureFormType().
2021-03-03 12:42:17 +01:00
Florian Schmaus 33f59fd7ed [xdata] Ensure that hidden FROM_TYPE field is first 2021-03-02 21:40:52 +01:00
Florian Schmaus 1c262471e5 [xdata] Use extra registry for fields in clark notation
If a field name is in clark notation, then lookup the field's type via
an extra registry.
2021-03-02 11:43:23 +01:00