summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-10-16Add UTF-8 validation function and validate input to libIDN functionsTobias Markmann
This is required to protect against the CVE-2015-2059 vulnerability in libIDN. Test-Information: Added unit tests for UTF-8 validation and tested that existing unit tests still pass. Change-Id: I0a94136894c6e0004081456c59155a78a3dabf5f
2015-10-15Only bind full JID to ChatController on non-empty or typing messagesTobias Markmann
With this commit a ChatController is only bound to a full JID of a contact, if the incoming message of the contact has a non-empty body or is a 'typing' chat state notification. This avoids random binding to an arbitrary resource of a contact, that has multiple online resources and responds with delivery receipts. Test-Information: Tested with a conversation of a one resource account (A) to a two resource account (B). Sending two messages to B, the first used to go to both resources, then A would bind to the full JID and the second message would only go to one resource. With this fix all messages go to both resources, i.e. are send to the bare JID, until one resource of B replies. This binds the controller at A to the full JID of the reply of B. Change-Id: I8d9321a4226ab798e1196351ad087990d5dff8c3
2015-10-14Fix compiler warnings about unused variables/argumentsTobias Markmann
Test-Informations: Code compiles without warnings and tests still pass. Change-Id: If74c615706b8125c3c5186f0d940c103749ddb80
2015-10-14Annotate getter method as const as it does not write anythingTobias Markmann
Test-Information: Still builds and unit tests pass. Change-Id: I472491184ba10ec3bdbd4cb94613768639ac6f57
2015-10-14Fix memory leak warnings by Valgrind/LSANTobias Markmann
Test-Information: Both Valgrind and clang's leak sanitizer report a lot leaks on the FileTransferTest. With this commit it the stack traces related to the fixed leaks are gone. Change-Id: Idae9a81bcd8d97576d3f1469bf64490e0bfa7d55
2015-10-14Change Swift Windows icon to default avatar iconTobias Markmann
The default Swift icon is black with transparent background. It is hardly visible on Windows 10 as it has a black task bar by default. This commit changes the Windows icon of Swift to the default avatar icon. Test-Information: Verified icon visibility on Windows 10. Change-Id: Ic78aa6b816deb5769666c7e2337917262c75046e
2015-10-14Remove remains of OutgoingSIFileTransferTobias Markmann
This existing code was commented out. There are not tests for it and no counterpart for incoming transfers. We support Jingle-based file-transfers as the main file-transfer method, as do lots of other clients. Test-Informations: Tested the complete project still builds. Change-Id: Icf278165733fe481b4e2bc777a73bc420cf76398
2015-10-13Fix crash in user search dialog for invitation use caseTobias Markmann
Commit 9b48a73 introduced a bug because it always assumed the 'Add contact' user case. Test-Information: Retested the add contact case described in commit 9b48a73 and tested MUC invitation by DND. Neither crashes anymore. Change-Id: Ifab356e6ad9a52365ed15dd46e4e94492bdc60bf
2015-10-07Fix wording so text is independent of sender/receiver caseTobias Markmann
Test-Information: None. Change-Id: I4e0cd54c9009bc19fdc10cd1ec2697252bd6f7f7
2015-10-07Fix hang during file-transfer preparation with missing proxyTobias Markmann
The code used to call the onProxiesFound signal only if a proxy was found. In case of missing S5B proxy at the users server, the file-transfer preparation would hang. Now the code wants until the discovery phase is done and then calls the onProxiesFound signal with the list of discovered proxies. In case of missing S5B proxy server the signal is called with an empty list so the file-transfer flow can continue. Test-Information: Ran FileTransferTest integration test and manually tested a file-transfer on a server without S5B proxy. Change-Id: I31d3cc08fe6453b5cdfe6be286f884a920470d28
2015-09-25Do not flush vCard cache if IQ request returns an errorTobias Markmann
Test-Information: Adjusted the corresponding test case accordingly. Change-Id: I4626f09cd51bac2ff9ca97d5a7da5a173fc627a5
2015-09-24Always include Qt5 audio plugins for Windows packagesTobias Markmann
At some point during the Qt5 timeline they moved platform dependent audio playback code into a plugin. This fix will ensure that audio plugins are always shipped with out packages. Test-Information: Tested playing sound works on Windows 7 and Windows 8. Change-Id: I8976f1c1fb85d5efaadec5db26adec907a0a9f7b
2015-09-22Play message incoming sound on incoming file-transfersTobias Markmann
The moving of our sound playing to our message highlighting code resulted in non-message events not having sound notifications played anymore. This commit fixes this issue for incoming file-transfers, by playing the default message received sound as long as sounds are not globally disabled in Swift. Test-Information: Tested on OS X 10.9.5 with Qt 5.4.2, by exchanging files and messages between two Swift instances. Change-Id: Ie09473efeef8366b76f6f7b59cc941fe6a0ad8f0
2015-09-22Add explicit includes for classes used in PlatformTLSFactoriesTobias Markmann
Furthermore removed unneeded includes. Test-Information: Still builds and unit tests pass. Change-Id: Ic7272e754c488f427b5ee6834f1d892028ea285d
2015-09-22Keep scroll position in highlight rule editor when moving rulesTobias Markmann
When moving a rule up or down in the highlight rule editor on Linux, the scroll area scrolled all the way down after each move. This problem is not reproducible on OS X. With this commit the dialog remembers the scroll area position before moving a rule and sets the scroll position back to the remembered value after the move of the highlight rule. Test-Information: Verified that the scroll position is not changed when moving highlight rules up or down on Debian 8.2 and OS X 10.9.5. Change-Id: Ide7c99e1311671c77cbf72da5cad4f64bfaab11f
2015-09-22Fix 'unused' member/parameter compiler warnings reported for SwiftTobias Markmann
Test-Information: Still compiles, the menitoned warnings in Swift are gone and unit tests pass. Change-Id: I8e113e7faf2e9273b4741f18c19e35e1b7bc7661
2015-09-22Reset potential warning when opening 'Add Contact' dialogTobias Markmann
Test-Information: Tested by entering an existing JID, closing the dialog window and reopening it. Change-Id: I6c24ba319a062d19f2144c70fcc94fe77d36befe
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-09-18Specify OS X framework version for script interface extractionTobias Markmann
The iTunes support in Sluift requires extraction of the iTunes scripting interface. Clang version Apple LLVM version 7.0.0 will error with "error: type arguments cannot be applied to non-parameterized class 'NSArray'" and similar on the extracted scripting interface. With this change the sdp tool will generate scripting interfaces compatible to OS X 10.10. The generated interface files do not cause the error. Test-Information: Tested the build on OS X 10.10.5 and OS X 10.9.5 and verified that the Sluift command "sluift.itunes.get_current_track()" still works on both systems. Change-Id: If70c797aea69e95c7be3cda4c50b64da45028aac
2015-09-18Fix notification logic for signals in BlockListImplTobias Markmann
The logic for calling onItemAdded and onItemRemoved signals when setting a new list of block items using BlockListImpl::setItems used to be broken. This commit fixes and documents the correct signal notification behavior Test-Information: Added a unit test which verifies the notification behavior in case of added block list items, removed block list items and a complete change of the block list. Change-Id: I3061545e25ddfc2d9d1a3c987045a58e5c9230ac
2015-09-18Show potentially existing MUC bookmark in chat window bookmark dialogTobias Markmann
The MUC bookmark editor window opened from the chat window would always show a new bookmark. With this commit it will show the existing bookmark if it exists. Otherwise it will show a new bookmark. Test-Information: Tested this behavior by creating a bookmark, changing name and nickname to different values and verified that the bookmark dialog for this room, opened from its chat view, would show the existing bookmark. Change-Id: I6766253ce11be271016473dff1105369482e73df
2015-09-18Save 'apply to all' property in highlight rule editorTobias Markmann
The highlight editor did not save if the user set the 'apply to all' property on a rule. It allows to highlight complete messages or be notified only based on the incoming message type. This commit enables saving the property. Test-Information: Tested chat and room rules with the 'apply to all' property set and verified that the complete messages are highlighted. Change-Id: Ib06bd3111ae810c8362ab8fd36a2d3b67f5a14cc
2015-09-18Add support for Arch distributions in InstallSwiftDependencies.shTobias Markmann
Test-Information: Tested on an updated Arch Linux. Change-Id: I12bc9ebea6363a48025b5ab856b62e6bd2232a59
2015-09-18Add script for installing 3rdParty dependencies on UNIX/LinuxTobias Markmann
This script detects the system type and distribution and installs dependencies to build Swift with Qt5. Currently, it only supports Debian, but will be extended to more systems in future. Test-Information: Tested on Debian 8. Change-Id: I56f8fe5738f057cff519755fe2f823eac721d318
2015-09-18Set keyboard focus to text input after selecting an emoticonTobias Markmann
After selecting an emoticon on Windows the keyboard focus does not return to the text input. OS X did not exhibit that behavior. This fix explicitly sets the focus back to the text input after selection of an emoticon, as expected by the user. Test-Information: Verified the behavior on OS X 10.9.5 and Windows 7, both with Qt 5.4.2. Change-Id: I8737a7e3f6d1a6b7a8e60261e9bd14c7be8d07a6
2015-09-16Increase template OS X installation disk image sizeTobias Markmann
Our packaging procedure temporarily needs more space on the disk image as it first copies the application bundle and frameworks on the image and afterwards removes debugging symbols and other files not required by the end user. The package.sh script reported this error of not having enough space left on the disk image. Test-Infromation: Verified that the disk image is still build, the package.sh error is gone and the packaged Swift.app works. Change-Id: Iba853bd30eb63f74f07cdda08b93e76dd89368bb
2015-09-16Remove Qt bearer plugins from Swift bundle in installation packageTobias Markmann
This is a workaround for QTBUG-34641. The Qt bearer API for detecting network changes will poll for available wireless networks every 30 seconds or so, resulting in needless CPU load. This patch removes the plugins for this API from the installation package, which will disable the constant polling for available wireless networks. Test-Information: Verified that the plugins are removed from the application bundle in the final installation DMG. Change-Id: If46d03ca5623885879ecc10e06a29cec96e7caa4
2015-09-16Only put qt.conf as resource binary for Windows buildsTobias Markmann
Commit 22ea5735ad1a105a4294b7475aba58646ef3ee8a added a qt.conf file to the compiled binary resources of Swift which is picked up by Qt and configures Qt to disable DPI awareness on Windows, as it is not supported by the Qt WebKit widgets yet. However, the Mac application bundle also ships with a qt.conf file which set the correct folders for Qt plugins. This was overridden by the compiled qt.conf resource file. This commit only compiles the qt.conf resoruce file require for Windows on the Windows platform. Test-Information: Tested on Windows 10 with 150% scaling that Swift is scaled up based on the pixel data. Tested on OS X 10.9.5 that the installation package works again. Change-Id: I74ce722cff1090e7dafc3a67e04f2a45d375a43d
2015-09-04Fix middle name and suffix arrangement in vCard dialogTobias Markmann
The vCard fields for middle name and suffix have been swapped at some point in the past. This commit fixes this error. It also specifies the correct tab sequence for the widget. Test-Information: Tested the correct visual appearance and tab sequence on Mac OS X 10.9.5 with Qt 5.4.2. Change-Id: I80d7e21982ddbb836c9f9a690e685a902e54df9c
2015-09-03Initial support for OS X Notification CenterTobias Markmann
This implements basic support for OS X Notification Center notifications with simple banner notifications showing type, contact and message/presence information. A click on the notification opens the chat view to the contact. The Notification Center backend will be used on OS X if the Growl notification backend is not used. This code requires OS X version 10.8 or later. Test-Information: Tested presence and message notifications between multiple Swift accounts and instances on OS X 10.9.5. Change-Id: I7b9e2132cab25e086e0912191562cad8f4cbae38
2015-09-03Add close button to about dialog for Linux desktopsTobias Markmann
The default Debian 7 desktop uses window decorations for dialog windows that does not have close window buttons at the top. This commit adds a dedicated close button to the about window. This button is *not* added on Windows and OS X. Test-Information: Tested looks and function on OS X 10.9.5 with Qt 5.4.2 and Debian 7 with Qt 5.3.2. Change-Id: Ia363f66666eb88d43834ab0556f7b06efd3cedef
2015-09-02Restrict pre-commit copyright check to added filesTobias Markmann
Previously the pre-commit would require a correct copyright header on all files, including modified files that only have a couple lines changed. Now, a correct copyright file header is only required on new files added to the repository. Test-Information: Changed git author information to a new user and tried committing a changed file, and afterwards a new file. Only the commit of a new file failed due to missing copyright header. It was accepted after setting BSD header. Change-Id: I8e1324846fd904a72728e7c01da4c98f49a77282
2015-08-11Fix accelerator for "Chats" tab in the main windowTobias Markmann
Test-Information: Verified behavior with Qt 5.5.0 on Elementary OS 0.2. Change-Id: Id4dd1e5e35c1ec20d0a2dd39727ee0ba352b611a
2015-08-11Make access to deadline_timer thread-safeTobias Markmann
According to boost doucmentation shared deadline_timers are not thread-safe. Adding a mutext to protect access to boost::asio::deadline_timer instance in Swift::BoostTimer. This fixes a data-race reported by TSAN when running Swiften/QA/ClientTest/ClientTest. Test-Information: Verified that the data-race report is gone with this fix. Change-Id: I62c8c3a07d6ea16fe6e2d24c879340040406699b
2015-08-11Disabling HiDPI support for Qt on WindowsTobias Markmann
This is an intermediate solution to the problem that the web views of Qt do not scale to the correct size out of the box. Disabling support for HiDPI mode will let Windows do pixel based scaling. The resulting appearance is not as clear but the web views remain readable. Test-Information: Tested with Qt 5.4.2 on Windows 8. Change-Id: I9460902e728e6190c8382d4eb954135470654e5c
2015-08-11Fix crash on trellis shortcuts if no chat window is openTobias Markmann
Test-Information: Verified that using trellis shortcuts does not crash Swift anymore if no chat window is open. Change-Id: Ie5c7b4675c89c8481cad48f2a348e6520ac42b13
2015-08-11Fix broken bookmarks context menu after reconnectTobias Markmann
Test-Information: Tested that the bookmarks context menu still works after an offline/online cycle. Change-Id: I9248b7405a6a09bc813c6590e0f2f9a4ed92acb3
2015-08-11Add missing virtual keyword on FileTransferManagerImpl dtorTobias Markmann
FileTransferManagerImpl should have a virtual dtor, as the parent class also has a virtual dtor. Test-Information: Unit tests still run. Change-Id: I72a0757a930254caadfd1463b3f90af6c4829bd0
2015-08-11Add 'check_headers' flag to scons for missing include detectionTobias Markmann
Running './scons check_headers=1 will compile each header file as an object file. Test-Information: Tested on OS X 10.9.5 and Elementary OS 0.2. Change-Id: Ia429ccc6dc0a5bd76c08a2c2e91bf192c6ad2901
2015-08-11Remove extra space in file transfer file size textTobias Markmann
Test-Information: Verified the change is visible in the UI. Change-Id: I31ebb28b3930c45e791ffea2ba8eb08364fcbd9b
2015-08-11Add note on use of Connector::stop()Kevin Smith
As the correct API usage might not be obvious Change-Id: I1d4887d7101ce59eb8f3a3dc13d94befe4a58948
2015-07-27Remember directory services used when searching for usersTobias Markmann
Test-Information: Tested by searching at some services and checked that they are present in the combo box after a Swift restart. Change-Id: Ia30d932f20447f44e458af3b32a38665872da025
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-07-21Explicitly disconnect from remaining resources in destructorsTobias Markmann
Explicitly disconnect from remaining resources in the ChainedConnected and ClientSessionStanzaChannel destructors, so the event loop will not call the signal handler methods on a freed object. Test-Information: Repeating the test case of creating a Swift::Client instance, connecting it and then deleting it after a random time below one second. On Mac OS X 10.9.5 running this test case causes two ASAN heap-use-after-free errors and with this patch the errors are gone. Change-Id: I3e48150c3633f4076ca9172aad9e85ba389df950
2015-07-21Sluift: Add set_certificate for sluift clientsRoger Planas
This patch introduces a 'set_certificate' API for Sluift clients, which it is just a wrapper around Swiften's Core client setCertificate. Test-Information: Generated different user certificates for a user (trusted, untrusted, invalid, expired...) and set M-Link to enable flag 'tls_require_client_cert'. Calling 'set_certificate' with these certificates behaved as expected, either letting the Sluift client to authenticate or not. Also tested caling 'set_certificate' with no parameter, and the certificate was successfully cleared (that is, client would no longer be able to connect) Change-Id: Ieb56d59f7f7c1c7027f0fe56905fb83ac3b25298
2015-07-20Do not reallocate FileTransferManager on connect of Clientswift-3.0beta2Tobias Markmann
Now Client allocates a FileTransferManager in its ctor and frees it in its dtor, like all the other resources of the Client class. This fixes an ASAN crash in the use case where you do a file transfer, go offline and online again and try to start another file transfer. Test-Information: Tested that the mentioned use case does not crash anymore, that file transfers still work, and that FileTransferTest still passes. Change-Id: Iddbcd8522af7df528bdc2b030fe616ad3f0c4701
2015-07-17Fix S5B proxy connection management for multiple hosts per JIDTobias Markmann
A recent commit introduced resolving of S5B proxy domain names to their IPv4 and IPv6 addresses. With that a proxy identified by a JID can have more than one host and we try them in parallel until the first succeeds. The old code just handled one host per proxy JID and a failed IPv6 attempt would override the succeeded connection. The code uses shared pointers and the succeeded connecting is deallocated and disconnected when it is replaced with the failing IPv6 connection. The result is the proxy server complaining that we are not connected as we try to activate the proxy stream. This commit changes the the proxy management to handle multiple connections per proxy JID. Failing connections are removed from the proxy sessions data structure. With the first succeeding connections, others are stopped and also removed. Test-Information: Tested on Linux (Elementary OS 0.2) with "Swiften/QA/FileTransferTest/FileTransferTest 4 4", which forces the use of SOCKS5 bytestream proxy. Change-Id: If3071c3d058e1040556bb72702bf83f4f5f25334
2015-07-16Fix memory leak in SOCKS5BytestreamServerManagerTobias Markmann
Test-Information: This LSAN reported leak is gone with this fix. Change-Id: Ib25fdfb7f4a82f62cd3f82ddb99f45618ea72ea9
2015-07-16Fix memory leaks in FileReadBytestream and FileWriteBytestreamTobias Markmann
Reported by LSAN. Test-Information: Detected by running FileTransferTest with LSAN on Linux. The leak reports for the allocations in FileReadBytestream and FileWriteBytestream are gone with this fix. Change-Id: I32711990eca0c9a2a2982837cfac38cb11a28caa
2015-07-15Remove accidental push of a translator into the code contributorsKevin Smith
Change-Id: I8e441ea2f2507f118e740373a8980357e8397492