Age | Commit message (Collapse) | Author |
|
The std::endl is now added by ~Log, but only for output to stderr or a
log file. Calls to the Android logging system or manually set callbacks
will not include the newline in the logging output.
JIRA: SWIFT-430
Test-Information:
Unit tests pass on Debian 9
Checked that running Swift with logging to stderr still had a newline.
Change-Id: I096fdba78a3b8f87db2097951c28c528592183e8
|
|
According to RFC 6120 if any disallowed XML feature is encountered,
we should close the stream with a <restricted-xml/>. The following
features of XML are prohibited in XMPP:
- processing instructions
- internal or external DTD subsets
- internal or external entity references
- comments
Test-information:
Unit tests pass on Windows 10 and Ubuntu 18.04.1 LTS
Change-Id: I475920c91b7f9da51ab37c106a4783a52f6e3cae
|
|
Test-Information:
Compiles
Change-Id: I5bfbf270524a1a31c9105f108f47f64eb95276d1
|
|
Swiften handles roster push event notifications, but those were
not passed to Sluift, so a Sluift client, when querying events,
would not be aware if an XMPP server roster pushes.
This patch adds extra events types to Sluift so that method
for_each_event reports roster pushes notifications.
Test-information:
Used sluift client to retrieve all items after adding, removing and
updating roster items, and now Sluift clients can see these events.
Change-Id: Ide5597bf2b39e3cc20014c66ba9153c551eec670
|
|
Network ports are now consistently stored as unsigned shorts, apart from
the options and user interface, where -1 is still used to denote the use
of default ports.
Test-Information:
Unit tests pass on macOS 10.13 and Debian 9
On macOS: tested the UI with various proxy and manual ports, behaviour
as expected.
Change-Id: I7a65f40083022887aa30ed7b21eadc56d0c52be1
|
|
The Component::disconnect() was controlling the running of the
event loop with the isAvailable flag, but it turns out that
depending on timing, a re-connect could be attempted and
the component erroneously claim that the "Component is already
connecting or connected", which could not possibly the case
if the first attempt to connect the component failed (hence,
not possible it was connected).
By updating the event loop to use the correct isActive flag,
this issue is fixed.
This error was highlighted as a result of the previous commit
"Prevent connect on active sluift clients and components".
Also, the getNextEvent is fixed to do not suffer from the
same problem, and use isActive instead of isAvailable.
Test-information:
Before the patch, a test that would attempt a second component
connect after a failed one would randomly fail.
After the patch, a test that would attempt a second component
connect after a failed one has passed hundreds of time without
failure.
Change-Id: I20be6b1c8aec485ded3330c143dedd2161c4c66e
|
|
Connect should not be called twice on clients or compoments without
disconnecting first. While this worked in some cases, mixing connect
options, specifically first trying without, and then with a bosh_url,
would lead to asserts being triggered.
The connect logic now checks whether there's already a connection in
progress or established, and raises a Lua exception early if there is.
Test-Information:
Tested on macOS 10.13
Connected components and clients with invalid and valid hosts, and with
valid and invalid bosh_urls, all with and without disconnecting in
between attempts. No asserts were triggered, and appropriate Lua
exceptions were thrown.
Change-Id: I6b91b57945844bce7fce0073e5d0fe199ab815d5
|
|
For the upcoming update to Scons 3, which works with Python 2
and Python 3, this change makes our code compatible with
Python 3 so that it still works with Python 2.
Test-Information:
Tested these changes with SCons 3.0.1 on macOS 10.13.6 with
Python 2.7.15 and Python 3.7.0.
Change-Id: Idb5207b179a79a0dbe89d7e620d182a7d2f1ca6c
|
|
Test-Information:
Builds on macOS 10.13.4 with clang trunk. All unit and
integration tests pass. Produces fewer warnings with clang
trunk (previously reported marked-unused-but-used warnings).
Change-Id: I849d764537cfbc380155e87b033dc5e517b3c342
|
|
Test-Information:
./scons allow_warnings=0 Sluift now builds on latest macOS
Change-Id: I7aca1c733dd86c772fc3a55f76d4915ad3c76e8d
|
|
Added a new element object ReferencePayload, and created the parser
and serializer to handle this element. Currently no functionality
to send references directly in swift, nor to render their contents.
Test-Information:
Unit tests written and passed for serializer and parser, testing
various types of valid and invalid references, and testing
references with embedded payloads.
Change-Id: I81fd5d9e020fac1729640f297705806af97f6388
|
|
The example will send a message with a data reference as an example of
creating and sending custom children of a message.
Test-Information:
Reference received on macOS 10.12
Change-Id: If670db0c2ded426e8502a4d331026cf56f6df8df
|
|
This patch adds support for Lua 5.3, while keeping support for
Lua 5.1 (a build with the bundled Lua succeeds)
Test-information:
Builds cleanly on Lua 5.1, 5.2 and Lua 5.3.
Tests that make use of Sluift work with both Lua 5.2 and Lua 5.3
Change-Id: I4cbe2eb09ec8c753d8624047f5456be1de72c679
|
|
disco_info shortcut was available to clients but not
to components. This patch addresses this.
Test-information:
Used component:get_disco_info and data is retrieved
successfully.
Change-Id: Ie8d80e3180ca400e5694fd581f60f08511e36ca4
|
|
Replaced SWIFTEN_OVERRIDE with C++11 standard override
keyword.
Test-Information:
Tested on macOS 10.12.5 with clang trunk.
Change-Id: If89c6cc2a648662522a320834c314496c943a55a
|
|
Also removes -Winconsistent-missing-destructor-override from
the list of ignored clang warnings.
Test-Information:
Tested on macOS 10.12.5 with clang trunk.
Change-Id: Iad951879e01eb951a2a393399f55e4e37437c6a2
|
|
Only identities and features were reported. Now extensions,
if any, will also be reported
Test-information:
Sent disco#info to a muc room, and got the following extensions back
(along with identities and features, so no regression)
Change-Id: Ib4ab17114df4da5de51945df9e53c12bd42716d1
|
|
Both catching polymorphic base classes by value and explicitly moving things
preventing return value optimization.
Test-Information:
Compiles on macOS with latest xcode with allow_warnings=False and unit
tests pass
Change-Id: Ibdc67f4f2019f85f14635df2a3ff06bddbb8e2b6
|
|
This patch adds some checks in the CoreClient class to avoid accessing
stanza and session channels to send data when they are not available.
The Sluift lua wrapper functions will throw an exception in these cases.
Test-Information
All unit test pass.
Timlx:
Test Suite ‘basic’: All tests Pass.
Test Suite ‘fmuc’: All tests except FmucChain Pass (Not related with the
changes)
Change-Id: I3d5894b3cfdafd0ea28c0fb33b6db8588f2a5c8f
|
|
There are many connection options that Sluift enables (bosh_url, tls,
etc..) but only host/port were understood by connect(), the rest
were meant to be set by using set_options().
This can be sometimes annoying, so to make things uniform, now
connect() should accept the same options settable in set_options()
Test-information:
Run test to check you can pass values to connect() rather than
set_options() and things worked.
Change-Id: Ic79aa5c6b232ddc2ffcfc3c14aa6f31233242314
|
|
When receiving network data we were processing it in chunks. Sometimes
one XML message got split across multiple chunks. XMLBeautifier was
stateless and would create a new parser for every single chunk. This was
causing multi-chunk messages to be truncated in the beautified output.
The change I made in XMLBeautifier allows it to maintain the state.
Test-Information:
Tested unger Windows 10 and CentOS.
Unit tests pass OK.
Change-Id: Idad2a8e0248ed3cbe2b47a12718b909e56ac1279
|
|
So instead of doing something like this
local features = client:get({ to = to, query = "<query xmlns='"..sluift.disco.features.DISCO_INFO.."'"..node.."/>" })['features']
we can now do something like this
local features = client:get_disco_info({ to = to })['features']
That is, avoid raw calls.
Test-information:
Updated test calls to use new API and noticed no different behaviour
to old code.
Change-Id: I0d9a7c25c0f56499487f8aa0e67e30e9fa1b56ac
|
|
A previous commit added a get_block_list() client method to retrieve
the list of blocked items.
This patch extends that and adds capabilities to add and remove
items to such list.
Test-information:
Tested with client and was able to successfully add items to list,
delete and delete all
Also tried to delete a non existing item and it rightly complained.
Change-Id: Iabbfdbd9e74ddc9740db5c9871b8355210aa0727
|
|
Swiften handles blocklist event notifications, but those were
not passed to Sluift, so a Sluift client, when querying events,
would not be aware if an XMPP server pushes block/unblock.
This patch adds an extra event type to Sluift so that method
for_each_event reports block/unblock notifications, in addition
to a new API 'get_block_list' to retrieve the blocklist from
the server.
Test-information:
Used Sluift client to retrieve blocklist and it is as expected.
Also used client to retrieve all items after adding, removing and
removing all items in the blocklist, and Sluift clients can now
see these events.
Change-Id: I0b76289ebd9e63505ff8a99cd9c0aa0e93af0c22
|
|
* swift-3.x:
- Fix building Swift on 32-bit Linux distributions
- Remove optional_fwd.hpp use; workaround for Boost Bug #12179
- Split COPYING.thirdparty in contributions/dependencies
- Fixes for building packages on Debian
Conflicts:
BuildTools/SCons/SConstruct
Sluift/Console.h
Sluift/ITunesInterface.h
Sluift/Terminal.h
Swift/Packaging/Debian/debian/control.in
Swift/QtUI/SConscript
Swiften/Elements/Stanza.h
Swiften/FileTransfer/FileTransferTransporter.h
Swiften/FileTransfer/IBBReceiveSession.h
Swiften/JID/JID.h
Swiften/Network/BoostConnectionServer.h
Swiften/Network/ConnectionServer.h
Swiften/Parser/AttributeMap.h
Test-Information:
Builds on macOS 10.12.1 with clang trunk.
Change-Id: I9f41ab199f227bc106721627ea994313c68e5cfe
|
|
Test-Information:
Build on macOS 10.12.1 and all tests pass.
Change-Id: Iedaa3fa7e7672c77909fd0568bf30e9393cb87e0
|
|
Sluift was showing payloads coming from a carbon copied message as
a series of dom payloads, which was not really usable.
With these ElementConvertors, the payload is translated into a
much more sensible table
Also a minor update to both presence/message events, which now
will report the 'to' as well. Seemed handy to have.
Test-information:
Carbons sent/received messages are formated into a meaningful table
now.
Change-Id: I5b8943636e09e5377bde76d16970c01df29164d6
|
|
The fields member of the forms generated by FormConvertor is used for
lookups in the __index metafunction. If a form is parsed with no
fields (and possibly no items), there wouldn't be a member 'fields',
causing another __index lookup, triggering infinite recursion.
There will now always be a fields array, which may be empty.
Sluift/Tests/FormTest.lua has been updated to test against an empty
form.
Test-Information:
Updated FormTest.lua works without issues.
Change-Id: Idee98f23bf42e1213ca3d03707f908ed5317dad6
|
|
Test-Information:
Builds on macOS 10.12 and unit tests pass.
Change-Id: Ia979e7dbd6f6c84085b1b951d81b925dffbed262
|
|
Initialised previously uninitialised class members. Changed
some raw pointers to std::unique_ptr for clearer and
automatically initialised code.
Test-Information:
Builds on macOS 10.12 and unit tests pass in ASAN-enabled
build.
Change-Id: I7900fe6131119c228ca92c79c0ee8125137f2e48
|
|
All our pimpl idiom usage used std::shared_ptr due to being
written in C++03. Now we use C++11 and const std::unique_ptr
is more sensible.
Test-Information:
Builds on macOS 10.12 and unit tests pass.
Change-Id: I1b9b3fbb22e337d53ae71e5a5e03118998cc3376
|
|
If a command table contained actions or notes, an extraneous lua_pushnil
happened, leading to a crash.
Test-Information:
Rendering a command using to_xml with actions or notes now works as
expected on OS X 10.11
Change-Id: Ic99b2546ac261edf6b52b92e63701f397fc6201a
|
|
Test-Information:
Added serializer and parser unit tests. All tests pass on
Mac OS X 10.11.4.
Change-Id: I8550c76ba182a67613d55634c72c0f2979f8b80a
|
|
This changes HippoMocks include to -isystem include so it will
not cause compiler warnings.
This changes UserLocation floating point values to double and
remove remaining numerical casts.
Change C++11 compiler test to not cause warnings.
Test-Information:
Builds with allow_warnings=0 on OS X 10.11.5 with Xcode clang.
Change-Id: I26c60265a86c9be656089ade63fe9ad63851580f
|
|
Move std::cout/cerr logging to SWIFT_LOG.
Test-Information:
Builds and all tests pass on OS X 10.11.5.
Change-Id: I0a0c24654a8b3abf3244a79fd6d970eee90559d0
|
|
Test-Information:
Test that it still builds and unit test pass on OS X 10.11.4.
Change-Id: I2eb4a0b707991aee553db36a8cd1ae28b813acab
|
|
This cuts down our dependency on Boost further. Another
benefit is that mutex classes of C++11 standard library are
recognized by TSAN.
Test-Information:
Unit and integration tests pass on OS X 10.11.4.
Change-Id: Id4dcdb42e3d5155e107ce1d7618acbf26f913b6f
|
|
The signals library is still called signals and not signals2.
Test-Information:
Builds and unit tests pass on Debian 8.4 with system GCC.
Change-Id: I1d1b3f6bade979bc8a181915176b84be0ddf6597
|
|
Boost.Signals was deprecated and is not improved further.
This patch removes Boost.Signals from 3rdParty and adds
Boost.Signals2 and its dependencies.
Also removed the Qt signals compatibility file
Swiften/Base/boost_bsignals.h.
Test-Information:
Build and ran unit tests on OS X 10.11.4. Confirmed successful
login using Swift client.
Change-Id: Ie6e3b2d15aac2462cda95401582f5287a479fb54
|
|
Run 'clang-tidy -fix -checks=modernize-loop-convert' on all
source code files on OS X. This does not modernize platform
specific code on Linux and Windows
Test-Information:
Code builds and unit tests pass on OS X 10.11.4.
Change-Id: I65b99e0978cfab8ca6de2a3e5342e7a81416c12c
|
|
This change was done by applying the following 'gsed'
replacement calls to all source files:
's/\#include <boost\/shared_ptr\.hpp>/\#include <memory>/g'
's/\#include <boost\/enable_shared_from_this\.hpp>/\#include <memory>/g'
's/\#include <boost\/smart_ptr\/make_shared\.hpp>/\#include <memory>/g'
's/\#include <boost\/make_shared\.hpp>/\#include <memory>/g'
's/\#include <boost\/weak_ptr\.hpp>/\#include <memory>/g'
's/boost::make_shared/std::make_shared/g'
's/boost::dynamic_pointer_cast/std::dynamic_pointer_cast/g'
's/boost::shared_ptr/std::shared_ptr/g'
's/boost::weak_ptr/std::weak_ptr/g'
's/boost::enable_shared_from_this/std::enable_shared_from_this/g'
The remaining issues have been fixed manually.
Test-Information:
Code builds on OS X 10.11.4 and unit tests pass.
Change-Id: Ia7ae34eab869fb9ad6387a1348426b71ae4acd5f
|
|
Run 'clang-tidy -fix -checks=modernize-use-nullptr' on all
source code files on OS X. This does not modernize platform
specific code on Linux and Windows
Test-Information:
Code builds and unit tests pass on OS X 10.11.4.
Change-Id: Ic43ffeb1b76c1a933a55af03db3c54977f5f60dd
|
|
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
|
|
Changed "" style includes to <> style.
Test-Information:
Build with Clang 3.9.0 and ran all tests on OS X 10.11.4.
Change-Id: Ic05e53f2e5dba39cc1307b116fc5f17b62ab9eb8
|
|
There were a lot #pramas to ignore unused private field
warnings. The pragmas and the unused fields have been
removed.
Test-Information:
Build on OS X 10.11.3 with XCode Clang.
Change-Id: Ie2f5398771088f93631c0f2c03d3cfdcca94cee6
|
|
Clang was complaining about implicit conversions between
nullable and non-nullable NSString pointers. Adjusted our
std::string -> NSString* conversion utilities to check for
nil and return an empty std::string in that case.
Replaced uses of [NSString stringWithUTF8String] with our
STD2NSSTRING macro.
Turned std::string <-> NSString* conversion macros into
functions.
Test-Information:
Builds without the warning on OS X 10.11.3 and Swift runs
without issues.
Change-Id: I949f2f3332018391aead58ef362764f4b7955b01
|
|
This avoids Sluift indefinitely waiting if the server does not
respond
Test-Information:
Before the patch, a sluift client would wait indefinitely if
a buggy XMPP server does not respond.
With this patch, sluift clients now timeout and through an
exception after SLUIFT_TIMEOUT when the server does not respond.
Change-Id: I9d36f53a8f4d5b3d594cef68c42de38fd5a1c296
|
|
As a result of commit "Change stanza body to boost::optional<std::string> type"
(commit 1b9ccc1fef6104eaf951153ddccdc6bb15899e9a), Sluift was not
populating the 'body' part of the message event, casting it to a bool instead.
By adding get_value_or("") to that body part, the actual body value
is retrieved, and the message event ends up containing the right information.
Test-Information:
Without the patch, Sluift's message event body is 'true'.
With the patch, Sluift's message event body contains the actual message.
Component messages also tested and event body as expected.
Change-Id: I366202aa5bf28a3315a81d909ea08f0933aa06d7
|
|
Before this patch it was calling the constructor and creating certificate
object with empty string. This was causing tests to fail when client was
set with null certificate.
This object fixes it by setting the certificate object to Null if the
certificate file is empty.
Test-information:
Test cases using sluift with this API that set null certificate now pass
Change-Id: Id75e22b58afebb2db463a7a23a4ca0686ef6eb12
|
|
This patch prevents SWIFTEN from logging in if provided with a missing PKCS12 file.
Before this patch, swiften would attempt a password based login using operator JID
and pwd of the P12 file when the P12 file was missing.
This patch fixes it by checking the certificate and not initialising session stream
and connection if the certificate is empty. It emits a disconnect with client
certificate load error. The string for certificate load error has been modified to
indicate a file or password invalid.
Test-information:
Tested by doing a certificate based bind to an XMPP server. Removed the PKCS#12
file and checked that swift gave a certificate error instead of doing pwd connect
Change-Id: I1869a13f1f7135b6606f7383cd4a0356ffd6931b
|