summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-11-19Remove std::endl from SWIFT_LOG callsEdwin Mons
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
2019-11-13Support application-supplied loggingEdwin Mons
This adds a method to set a logging callback. If such a callback is set, all SWIFT_LOG calls will invoke this callback instead of writing to either stderr or the swift logging file. Test-Information: Updated unit tests pass. Checked that logs generated by Swift and Sluift (which do not set the callback) resulted in logging in the expected location. Change-Id: I0eb2a1057aa77839e1b8d5f320205eb9d5fdc253
2019-01-22Avoid deprecated boost endianess includeMiroslaw Stein
As of Boost 1.69.0, boost/detail/endian.h is deprecated in favour of boost/predef/other/endian.h, and BOOST_(LITTLE|BIG)_ENDIAN by BOOST_ENDIAN_(LITTLE|BIG)_BYTE. Test-Information: Unit tests pass on Debian 9 Change-Id: If7076c559a4e35219ff97603f50b80cfbe05b29b
2018-11-08Consistently use unsigned short for network portsEdwin Mons
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
2018-07-27Autofix boost-use-to-string clang-tidy warningsKevin Smith
Done by adding --fix --fix-errors to the clang-tidy args in the Makefile Test-Information: Unit tests pass (macOS) Change-Id: I3a4df955ac3553afeb9384f23f9d8b2ef01117e2
2018-03-20Merge branch 'swift-4.x'swift-5.0alpha2Tobias Markmann
* swift-4.x: (44 commits) Test-Information: Builds on macOS 10.13.3 with clang trunk. Change-Id: If50381f103b0ad18d038b920d3d43537642141cb
2018-02-02Add basic TLS server support in OpenTLSContextTobias Markmann
This also extends the TLSContext interface with methods required for server mode. Test-Information: Added unit tests that test new functionality in TLSContex. This includes test certificates in the source file that are not for public use. This new ClientServerTest is only enabled for OpenSSL, as other TLS backends do not support the new functionality yet. Tested on macOS 10.13.3 with clang-trunk. Change-Id: I8e43476057608067eb3b9852328aa21cd22974a0
2017-08-08Enable log information export to a fileThanos Doukoudakis
This patch introduces the “logfile” argument to the client, which can be used to specify a file path for a log file, where all logging information will be stored. Test-Information: Tested on windows 10 and Ubuntu 17.04 Change-Id: I6a2f14585a72f25e7e78d79cb633e1ddc4d43c3b
2017-07-13Fix LRUCache documentationTobias Markmann
Doxygen raised warnings for referencing unknown classes and template variables it cannot deal with. Adjusted the comment to just format them instead of referencing. Test-Information: Ran ./scons doc=1 and verified that doxygen did not raise warnings anymore. Change-Id: I8927195457bbaf92066591f24e536e9b48a04808
2017-07-13Remove Swiften/Base/Override.hTobias Markmann
Replaced SWIFTEN_OVERRIDE with C++11 standard override keyword. Test-Information: Tested on macOS 10.12.5 with clang trunk. Change-Id: If89c6cc2a648662522a320834c314496c943a55a
2017-07-11Add missing SWIFTEN_OVERRIDE statements to dtorsTobias Markmann
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
2017-06-26Remove unneeded forward declarations from Swiften headersTobias Markmann
Found by cppclean. Test-Information: Still builds on macOS 10.12.5 with clang trunk. Change-Id: Ie8a154e12b196587c956c8b333abf529a36f6bb3
2017-06-22Add missing SWIFTEN_API declarationsVitaly Takmazov
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tested performed under Windows 10 1703 Change-Id: I332923986c8d62b75a76ef9f784811d09a662f22
2017-06-22Add missing SWIFTEN_API annotationTobias Markmann
Test-Information: None. Change-Id: I1d8e0af76841824ff573bd19f664a04e4f2d97a1
2017-05-04Fix recent chat entries being incorrectly displayedJoanna Hulboj
Recent chat entries were displayed as a randomly generated numbers instead of impromptus (if invitees were offline). Title displayed in the Recent Chat List for MUC is now based on both the occupants and invitees. To do that a collection with all the invitees is being stored (new) along the occupants (existing). Test-Information: From Swift menu choose Actions, Start Chat... Add some offline contacts to the List of Participants and press Finish. Recent chat entry will have correct name (combined of contact names). Change-Id: Ie076165e8dbb493aa261cc49ca3ab1e0c1c542a8
2017-04-18Support Last Message Correction in multi client scenariosTobias Markmann
Previously Last Message Correction edits are only applied if they came from the same resource. This makes sense in MUC scenarios but does not in 1-to-1 chats. This changes the Last Message Correction behaviour for MUC and 1-to-1 chats so that different clients from the same bare JID can edit each others messages. Test-Information: Added unit test to verify Last Message Corrections work as expected when coming from the same client and from different clients. Manually verified that the receiving client correctly shows a corrected message if the sending client reconnected between first message and edit. All unit tests pass on OS X 10.11.6 with Qt 5.5.1. Change-Id: If533ecc7032e59e324979c577726f2da739012e6
2017-04-11Simplify algorithm for concatenating using modern c++Joanna Hulboj
Test-Information: Unit tests pass OK. Change-Id: I6328dd55482ed8058ec8510a873fdd64ff978c72
2017-03-31Use std::random instead of boost::randomJoanna Hulboj
Test-Infotmation: Unit tests pass OK. Change-Id: I1b6d3711d97daa86cccbb44aecb1b4025f2fcc8a
2017-03-13Add LogSerializer for BOSHErrorTobias Markmann
Test-Information: Tested and used it during a recent debugging session on macOS 10.12.3 with recent clang. Change-Id: Ia4883a69a94f962006a39b294d6b9b67e0990541
2017-02-22Add LRUCache utility class to SwiftenTobias Markmann
This implements a simple lookup cache with least recently used replacement strategy. This also adds Boost.MultiIndex from version 1.56 to 3rdParty. Test-Information: Added some unit tests for LRUCache, which pass on macOS 10.12.3 with clang-5.0 Change-Id: I0567945b1197d3fe786bf9d82fdb5e755743b975
2017-02-21Add checks to verify if the input data is a valid XML/XMPPJoanna Hulboj
Test-Information: Unit tests pass OK. Change-Id: Ibd7897c1c1249af7ac60a6549afd4c2362fcf0c0
2017-01-11Integrate googletest and googlemock libraries to 3rdPartyTobias Markmann
googletest and googlemock from release 1.8.0 have been copied to the 3rdParty folder. With this commit tests for Swift project can also written using googletest and googlemock APIs. The test runners will execute test suites written to either test library. Passing —-xml to a test runner will now create two test report XML files, namely $programName-report.cppunit.xml and $programName-report.gtest.xml. The ByteArrayTest has been converted to use googletest instead of googlemock to serve as an example and test the integration. Test-Information: Build all tests via ‘./scons test=all’ and verified all tests are run. Build all tests via ‘./scons test=all checker_report=1’ and verified that two report XML files are generated per test runner executed. Change-Id: I81a9fb2c7ea5612fc1b34eef70ed7e711bfeea81
2016-11-28Correctly handle server initiated closing of streamTobias Markmann
If a server closes the XMPP stream, it sends a </stream:stream> tag. The client is supposed to respond with the same tag and then both parties can close the TLS/TCP socket. Previously Swift(-en) would simply ignore </stream:stream> tag if it was not directly followed by a shutdown of the TCP connection. In addition there is now a timeout timer started as soon as Swiften or the server initiates a shutdown. It will close the socket and cleanup the ClientSession if the server does not respond in time or the network is faulty. Refactored some code in ClientSession in the process. Moved ClientSession::State to a C++11 strongly typed enum class. This also fixes issues where duplicated </stream:stream> tags would be send by Swift. Test-Information: Tested against Prosody ba782a093b14 and M-Link 16.3v6-0, which provide ad-hoc commands to end a user session. Previously this was ignored by Swift. Now it correctly responds to the server, detects it as a disconnect and tries to reconnect afterwards. Added unit test for the case where the server closes the session stream. Change-Id: I59dfde3aa6b50dc117f340e5db6b9e58b54b3c60
2016-11-23Migrate remaining Swiften/Base/foreach.h use to range-based for loopTobias Markmann
Test-Information: Build on macOS 10.12.1 and all tests pass. Change-Id: Iedaa3fa7e7672c77909fd0568bf30e9393cb87e0
2016-11-10Use FeatureOracle to detect file-transfer support in rosterTobias Markmann
The FeatureOracle provides tri-state feature lookup functionality for bare JIDs. It returns Yes if a feature is supported by all resources of the bare JID, Maybe if some support it, and No if none of the resources support it. If passed a full JID, it returns the specific features supported by that end-point. Sending a file to a bare JID, will send a file to the resource of the bare JID with the highest availability by presence, show status and priority and which supports the features required for a Jingle file-transfer. Test-Information: Added unit test verifying new behavior. All tests pass on OS X 10.11.6. Added new unit tests for FeatureOracle. Manually verified that the roster and chat window both use the same mechanism to detect support for file-transfers. Manually verified that file-transfers via the contact list goes to already bound full JIDs if there is an existing ChatController. Change-Id: I0175ac42ecb73f1d54f9c96ffbba773eb5e24296
2016-09-29Fix potential resource leaksTobias Markmann
IDGenerator was missing the virtual keyword on its method which is reimplemented by SimpleIDGenerator. Some other classes were missing destructors or virtual destructors. Test-Information: Builds on macOS 10.12 with Qt 5.5.1, all unit tests pass. Change-Id: I482bc249578d38a922256d1fa5241515ce45d0c0
2016-08-05Add a debugging helper for serializing Swiften types to ostreamTobias Markmann
Test-Information: Tested on OS X 10.11.6. Change-Id: I9ecb60f5c3956d52fd42acd1b0d85725277efc51
2016-06-14Add support for URLs with IPv6 addresses in Swift::URLTobias Markmann
Test-Information: Added unit tests and test cases from RFC 2732. All tests pass on OS X 10.11.5. Change-Id: Ic76e57985109912871c05d12253f73d3653bd7a3
2016-04-25Convert hard tabs to four spaces in all our SConscript/*.py filesTobias Markmann
Test-Information: Test that it still builds and unit test pass on OS X 10.11.4. Change-Id: I2eb4a0b707991aee553db36a8cd1ae28b813acab
2016-04-12Use C++11 threading library instead of Boost.ThreadTobias Markmann
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
2016-04-08Fix code in response to compiler warnings by clangTobias Markmann
Test-Information: Builds on OS X 10.11.4 with Apple clang and clang master. Change-Id: I012577e29c6fcf2fb452b4f13912aaeb37250fb5
2016-04-05Migrate to Boost.Signals2 from Boost.SignalsTobias Markmann
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
2016-04-04Modernize code to use range based for loops using clang-tidyTobias Markmann
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
2016-04-04Modernize code to use C++11 shared_ptr instead of Boost'sTobias Markmann
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
2016-04-01Modernize code to use C++11 nullptr using clang-tidyTobias Markmann
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
2016-03-31Convert tabs to 4 spaces for all source filesTobias Markmann
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
2016-03-30Apply consistent #include grouping and sorting styleTobias Markmann
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
2015-09-21Stop throwing out of range exception from dateTimeToLocalStringTobias Markmann
The dateTimeToLocalString uses boost functions that may throw an out of range exception for times earlier than 1970. This commit caches this exception and just returns an empty string in this case. Test-Information: Added a unit test to verify this behavior. Change-Id: I05eb17605331e14d9eac04fbfd286362e7d4eb46
2015-07-24Add missing includes for dependencies in public header filesTobias Markmann
Added Swiften/Base/Concat.h to the exception list for <algorithm> include, as Concat.h uses std::copy, defined in <algorithm>. Added Swiften/FileTransfer/S5BTransportSession.h to the exception list for <boost/bind.hpp> include, as S5BTransportSession.h declares a template class using boost::bind. Test-Information: Tested that each of Swiften's public header files compiles on its own. Change-Id: Iac794b6e0f5959cd8261888a67761813b710fe85
2015-06-08Add missing SWIFTEN_API annotations to public Swiften APITobias Markmann
Test-Information: Tested build on Windows 8 with VS 2014 and ran unit tests. Change-Id: I3d8096df4801be6901f22564e36eecba0e7310c4
2015-04-10Introduce FeatureOracle class for contact feature support detectionTobias Markmann
This modifies the feature detection in the ChatController to try to use the common features of all available resources feature detection if no full JID has been bound to the chat yet. Test-Information: Tested with two Swift instances. Tested a) the initial chat start case and, b) the offline/online. In case a) Swift used to initally show a yellow warning about no support for message receipts. This warning is gone now. In case b), after a user gone offline and online again in a running chat, Swift used to show a warning about missing support for message receipts. This warning is gone now. Change-Id: I7a769fde8d14847b180503aeaa58280c572d81b3
2015-04-08Add optional logging to native log framework on AndroidTobias Markmann
To enable native Android logging you need to pass "-DSWIFT_ANDROID_LOGGING" to the "cxxflags" and "-llog" to the "linkflags". Test-Information: Tested on OS X 10.9.5, with NDK API level 14 on an emulated Android 4.0 ARM instance. Tested that if enabled, Swift log messages appear in the Android system log via "adb logcat" instead of appearing on stdout. Change-Id: If89c870f0b664a5e65ccc1fa8a244826d2875ec1
2015-02-11Add debugging helper and FileTransferTest.Tobias Markmann
FileTransferTests tests file-transfer interoperability with Swiften itself. It can test all combinations of FileTransferOptions or a specific combination when given. Test-Information: Inspected XML logs to ensure it does what it is supposed to do. Change-Id: I06215b60419dd23b367d01a2f038245a6c977720
2015-02-08Fix data race in PlatformDomainNameResolver reported by TSANTobias Markmann
Test-Information: All tests still succeed on OS X and Linux. Change-Id: I2c02252b646b539b960cad18b6f88807afd84d32
2015-02-03Stlye fix and declaring EventLoop implementations' dtors as virtual.Tobias Markmann
Test-Information: Unit tests run successfully. Change-Id: I5df196c8bc642eeff4997558c3c56c6fa03bef16
2015-01-19Declare SimpleIDGenerator as an implementation of the IDGenerator abstract ↵Tobias Markmann
class. In addition this commit also adds brief documentation for the SimpleIDGenerator. Test-Information: Builds and runs fine on OS X 10.9.5. Change-Id: I87360933d50c7bb56b19859c9890d9000d3c147b
2014-12-15Update Copyright in SwiftenKevin Smith
Change-Id: I94ab4bbb68c603fe872abeb8090575de042f5cb4
2014-11-24Add missing includeKevin Smith
Change-Id: Ida1dd60a01e16e71831221b7e2fcfb74fdde54f3
2014-02-13Fix clang warningsRemko Tronçon
Change-Id: I7cd26f00f626b64da934e9f5594db393d6184b9c
2014-01-15Improved plaintext chat view for screen-reader support.Richard Maudsley
Change-Id: Ib7c10350b56683db95f4c6be49f79f8a9d9e80ec