summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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-18Don't pass the impromptu MUC 'reason' as the room JIDThanos Doukoudakis
Changing the constructor of the CreateImpromptuMUCUIEvent class not to accept default values to its parameters. This approach is less prone to mistakes, like forgetting an argument. This commit fixes SWIFT-271 bug, where only two arguments were being passed in the constructor. As a result the reason string was used to create a room JID, making the room unusable. By passing an empty string, the room JID created is not valid, and when ChatsManager handles the event, it will generate a new valid room JID. Test information: Unit test pass. Tested the creation of new impromptu chat with with windows 10 (qt5.7). Change-Id: I4ce9ee7db14b9125970a03f19d1ac0c32e1b5a0e
2017-04-12Assert first page in QtUserSearchWindow wizard based on typeTobias Markmann
Converted enum to C++11 enum class in process. Coverity raised this issue. Test-Information: All unit tests pass. Using the “Add Contact…” and “Start Chat…” dialogs did not crash. Tested on macOS 10.12.4 with Qt 5.4.2. Change-Id: I0409688b001d1eaaf5fa77a25b1158ce9e611c77
2017-04-10Ignore incoming duplicates of messagesTobias Markmann
This might happen with some servers and their MUC implementation which send you not only the original message but also multiple carbon copies of it for MUC PM conversations. This change will ignore any message that has the same non-empty message ID as the previously incoming message. Test-Information: Added unit test to verify new behaviour. Tested in a MUC where the server would send you the original message and multiple carbon copies of the message. Previously the chat view would show and incoming MUC PM message 4 times. Now it’s only shown once. Builds and tests pass on macOS 10.12.4. Change-Id: Ie7bd29dacc00f8f3962131a529b52a69ff09bd6c
2017-04-07Do not grey out chat view after clearingJoanna Hulboj
Test-Information: Run Swift, open chat window, enter a message and send it. Right click on chat view and choose Clear. Chat log in a view will be cleared but it will stay white. On the top of the chat view will be a message: e.g. Starting chat with test - test@test.isode.net: Offline. Change-Id: Ie453602e2f2b14e3ecca699821521ad33937ccf6
2017-04-07Make day change chat system message DST awareTobias Markmann
Moved the code for day change message handling from Swift/Controllers to Swift/QtUI. Use QDateTime in local time time spec, which allows DST aware calculation of the duration to the next midnight. Added Swift Qt UI unit tests, which are build when Qt has been successfully detected. Test-Information: Added unit tests for duration to next midnight calculation. Set clock shortly before midnight and verified that a single day change message is added to the chat log at midnight. Tested on macOS 10.12.4 with Qt 5.4.2. Change-Id: I34d69eaa3272981fd220a7963a0417f73ff78e68
2017-04-06Reset the chat state to active after a few secondsThanos Doukoudakis
Fix for swift-217 When a user sends a composing Chat State Notification a timer will start. If the user doesn't send or cancel the message before the timer expires, an active CSN will be sent. Test Info: Build on Windows and unit test pass. Tested the new functionality with Windows and Linux Client. Added some test cases to cover the scenario that user goes idle while a CSN composing state has been sent. Updated ChatStateNotifierTest to use gtest. Updated ChatsManagerTest to use a valid TimerFactory object instead of nullptr. Change-Id: I35201947e4f042805a6d9df1340a0335effcd657
2017-04-04Open 1:1 chat to real JIDs from MUC rooms (not PMs) when possibleThanos Doukoudakis
Opens the chat with the user JID instead of the MUC JID. Does not affect existing behaviour on normal one2one chats. Test-Information: Builds on Windows and unit test pass. Tested the behaviour on single chats from contacts list (roster), start new chat with one and multiple users. Also tested on MUC rooms that are non-anonymous, semi-anonymous and anonymous. Change-Id: I2b8fbacb1fa640167ec196d4215a13ad4905d45c
2017-03-31Return unique_ptr instead of pointer to deleted objectTobias Markmann
Coverity raised this issue. Test-Information: Code builds on macOS 10.12.4 and all unit tests pass; Swift runs fine. Change-Id: I8fb0805f6b2e0a21674ea32c0b1aee9e7b985639
2017-03-29Remove nullptr checks that are not neededTobias Markmann
One must pass a valid AvatarManager instance to the MUCController. Asserted the fact at the beginning of the actor. Coverity raised this issue. Test-Information: All unit tests pass on macOS 10.12.4 and Swift client can join MUC conversations without crashing or other noticeable issues. Change-Id: Ibc643f907a31fd1253c63c9a4cef79407d1f96ec
2017-03-28Modified XMLBeautifier to handle split payloadsJoanna Hulboj
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
2017-03-14Show correct avatars for file-transfer messagesTobias Markmann
Previously we simply showed our default avatar. With this change we will use the same avatar as we use for normal chat messages. Test-Information: Tested on macOS 10.12.3 with Qt 5.5.1 by exchanging files between two Swift instances. Change-Id: I20b953a67a290820900b5b35861c1e17f72148bd
2017-03-08Use standard algorithm instead of custom codeTobias Markmann
Test-Information: Builds on macOS 10.12.3 and unit tests pass. Roster filtering still works and does not crash in an ASAN-enabled build. Change-Id: I545a582b003cd0c15dff43b73b0922dcbf4055af
2017-03-07Do not color highlight mentions of the own nickname by defaultTobias Markmann
In the default highlight configuration, mentions of the own nickname should only cause a notification sound and a system notification. Test-Information: Tested mention notifications in a test MUC room and verified that only sound and system notifications are issued in the default highlight configurations. Tested on macOS 10.12.3 with Qt 5.5.1. Change-Id: I44a276ab740d7495930c935a89a2ef81219e24df
2017-03-07Do not highlight in own room join system messagesTobias Markmann
Test-Information: Tested by joining a MUC room and verified that the ‘You have entered room foo as bar.’ message does not contain any highlights. Tested on macOS 10.12.3 with Qt 5.5.1. Change-Id: Ib830d081e74c4289be4bb1469bf005a2e4c4e298
2017-03-03Do not clear join/leave queue for MUC rooms on CSN messagesTobias Markmann
Previously chat-state notification messages would cause the join/leave queue of a MUC room to be cleared, resulting in taking up more vertical space than it had to. Test-Information: Compared two Swift builds (one with this patch and one without) in a room where some occupants would send CSN messages from time to time. With this patch, a CSN message clearly does not cause the join/leave queue to be cleared. Added unit test to verify new behaviour. Tested on macOS 10.12.3 with Qt 5.7.1. Change-Id: I0aee733fa5d16bbfb497a17b3d7a3ffe3fea8f26
2017-03-02Fix keyword highlights not issuing system notificationsTobias Markmann
Adjusted the MUCController tests accordingly, as self-mentions in group chats have been case insensitive and are now case sensitive. Test-Information: Tested on macOS 10.12.3 with Qt 5.7.1, that with a highlight rule for the ‘Swift’ keyword, a system notification is generated when the app is inactive. Change-Id: I325b682c5afa81e05eec8cf3a8a15b2ff0303e5c
2017-02-27Redesign highlight logic and processingTobias Markmann
The new highlight logic follows a simpler model. It supports: * highlighting of whole words in a message * highlighting messages by sender name * highlighting if the user’s name is mentioned Possible actions for these highlights are text colouring, sound playback of WAV files, and system notifications. In addition the user can decide to receive sound and system notification on general incoming direct and group messages. Redesigned the highlight configuration UI dialog for this new model. ChatMessageParser class now deals with all parsing and marking up the chat message with the matching HighlightActions. Highlighter class has been extended to deal with all sound and system notification highlights that should be emitted by a specified chat message. Moved some tests over to gtest in the process. Test-Information: Tested UI on macOS 10.12.3 with Qt 5.7.1. Manually tested that correct system notification are emitted on mentions, keyword highlights and general messages. Added new unit tests to cover new highlighting behaviour. Change-Id: I1c89e29d81022174187fb44af0d384036ec51594
2017-02-23Change the logic of displaying chat room subjectJoanna Hulboj
Test-Information: Run Swift and join any MUC room, on join there is no information displayed regarding room subject. Choose "Change subject", the following information is displayed in the chat window: "The room subject has been removed" after the subject was removed, or "The room subject is now: some subject" after the room subject was set to "some subject". Run Swift join any MUC room, disconnect from server (using another Swift client change subject to "Test") after reconnecting the following information is displayed in chat window: "The room subject is now: Test" Change-Id: Ice901697a6a381464d694147b17830b4e62c8198
2017-02-22Fix double entries in MUC participant lists after merging nicksJoanna Hulboj
Test-Information: Tested using Psi and Swift. Log in to Psi and Swift as UserOne. Enter Room (e.g. testRoom) using Swift and join the same room from Psi using drop down menu Join Groupchat. Splitting: change nick from UserOne to UserTwo. Swift correctly displays: UserOne, UserTwo. Merging: change nick back from UserTwo to UsetOne. Swift correctly displays: UserOne. Change-Id: I291eddd5aed154fb0babe1b0ada0a15a317eacdb
2017-02-22Cache some recently used entity capability lookups in memoryTobias Markmann
Previously any entity capability lookup was only cached on the disk. This meant that even for a cache hit, you would read from disk and parse the disco info XML in the cache, to return the result. This commit adds an addition LRUCache based in-memory cache. This extends the EntityCapsProvider API with a non-const method, i.e. getCapsCached, which allows active caching of results from the disk cache. Test-Information: All unit tests pass on macOS 10.12.3. This noticeably speeds up the duration of a join of a large MUC room, i.e. about 160 occupants, to about half of the previous duration. Change-Id: I0fc254cda962860416713822ddcad15ae13085f1
2017-02-16Remove redundant UIEventStream* member from (MUC|Chat)ControllerTobias Markmann
Clang’s -Wshadow-field rightfully complained about it. Test-Information: Builds on macOS 10.12.3 with clang5 and Qt 5.7.1. All unit tests passed. Change-Id: Ib0705d518298e666c73d84150a043688a9d925ce
2017-02-10Display error message in profile window if vCard request failedTobias Markmann
Also fixed an typo error in GConfProxyProvider.cpp that prevented compilation on Linux. Test-Information: Tested with an XMPP server with vCard support disabled and also with vCard support enabled. Tested profile window and profile editor window. The profile window will show cached vCard data if present and the error message. The profile editor window will only show the error message in case of an error. Tested profile window and profile editor window in a scenario where vCard support is first enabled in the server, then disabled, and finally enabled again, and opening the editors in between. Potential error messages were always correctly cleared before showing the dialog. Tested on macOS 10.12.3 with Qt 5.7.1. Change-Id: I3958c35286f6f0096d1605c29816f666530aae03
2016-12-09Improve documentation of code related to impromptu chatsTobias Markmann
Test-Information: Builds and all tests pass on macOS 10.12.1. Change-Id: I58ca7ba27736d27426350f636dfe910f4f2f1b17
2016-12-09Fix issue with invites to MUC if a MUC PM for that room is openTobias Markmann
Previously if you wanted to invite people to a MUC and had a PM window for a MUC occupant open at the same time, the InviteToMUCUIEvent would be handled by the PM window, by the ChatController of the PM window and not the MUCController of the MUC window. Test-Information: Verified that some scenarios work correctly: - Tested a drop to a MUC window while a MUC PM window is open to an occupant in the MUC. Previously this crashed due to ChatsManager::localMUCServiceJID_ being empty. - Test that impromptu MUC creation to a normal chat works. - Test that impromptu MUC creation to a MUC PM chat works. All unit and integration tests pass on macOS 10.12.1. Change-Id: Ib20de7e925e3503308211936ee47d4ba829d0394
2016-11-30Show MUC PM item-not-found error in MUC PM windowTobias Markmann
Previously, if one would send a MUC PM to a user that has left a room the error response from the MUC would be shown in the MUC room. Now the error will show in the MUC PM window, if the MUC PM full JID has a ChatController. Test-Information: Added unit test verifying new behaviour. Manually verified that the error is shown in the MUC PM window instead of the MUC room window. Change-Id: I1b259d5eee9e22217bbe7e5c09294d2166a77895
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-10Move Qt specific setting constants to QtUISettingConstants.hTobias Markmann
Test-Information: Builds on macOS 10.12.1, ./scons test=all passes, Swift successfully logins and remembered Trellis configuration. Change-Id: Id94d6af1448d44d7d46ba2b8606f3e5ebe98be7a
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-10-21Use unique_ptr instead of manual deleteTobias Markmann
Changed the code to use range-based for loop were possible. Test-Information: Builds and unit tests pass on macOS 10.12 with Qt 5.5.1. Change-Id: I118aa4ac5887544a1b2d8fb6ee2910b44447467a
2016-10-19Fix presence handling of own contact in rosterTobias Markmann
Previously, presence from your own full JID was not applied to your own roster entry. With this commit all presence changes are applied. Test-Information: Added unit test verifying new behavior. All unit tests pass on OS X 10.11.6. Change-Id: Ib93f487329aa1eec0e876857541780ff44b8cac9
2016-10-04Handle boost::bad_lexical_cast exception in StatusCacheTobias Markmann
Modernised code to C++11 lambdas and range-based for loops, and cleaned up includes in the process. Test-Information: All unit tests pass with ASAN-enabled built on macOS 10.12. Verified recent status list is still loaded in Swift UI. Change-Id: I44fe09a079cfae15ed9fb2860e7352badedf6c1c
2016-09-29Fix uninitialised class membersTobias Markmann
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
2016-09-27Add setting to disable automatic software updatesTobias Markmann
The automatic software update feature is enabled by default. Test-Information: Created system-settings.xml disabling the automatic software update feature and verified no Sparkle log output is produced, showing Sparkle is not initialised and run. Tested on macOS 10.12 with Qt 5.5.1. Change-Id: Ief1f4030505a2a3961ac18cd4774863584489727
2016-08-25Alphabetically sort MUC search resultTobias Markmann
This also changes the classes around MUCSearchModel to C++11 smart pointer based memory management. Test-Information: Verified that dtors of MUCSearch*Items are called when old search results are replaced by new search results. This was not the case previously. All unit tests and manual testing with an ASAN enabled build succeeded. Change-Id: I84d62f3b86138728401b98d3774f47c72fdf9a4c
2016-08-09Enable better date formatting in the UITobias Markmann
This adds the ability to provide more specific date formatting via the Translator interface. The default translator will use Boost's formatting capabilities. The QtTranslator use more localized and better readable formatting. Test-Information: Tested with Qt 5.5.1 on OS X 10.11.6. Checked that tooltips and presence text in new chat views show the new formatting. Change-Id: I90ff5ab8b31fb41f2dcbea2c40b8846c534c355f
2016-08-03Open corresponding chat window when sending files via rosterTobias Markmann
Incoming and outgoing file transfers open the corresponding chat window, but only for outgoing file transfers the window is activated, i.e. shown at the top and focused. For incoming transfers the window is opened in the background. Test-Information: Tested on OS X 10.11.6 with Qt 5.5.1 against another Swift instance. Change-Id: Ie786c135d4f7854a558561cadd715dc87a209316
2016-07-27Fix Doxygen warningsTobias Markmann
This fixes Doxygen warnings about missing parameter documentation or documentation of non-existing parameters. Test-Information: Ran ./scons doc=1 without warnings with Doxygen 1.8.11. Change-Id: I360d042e5c80f418e7574a26fa1283a82fc504d4
2016-07-11Fix handling of incorrect MUC component behaviorTobias Markmann
Swift used to crash when a MUC component returned multiple unavailable presences on rejoin of a room hosted on a restarting buggy MUC component. Test-Information: Added test case that used to crash Swift. Tests pass without crash on OS X 10.11.4 Change-Id: I52280976944170c6e143197d4b3dc517dc13ecbb
2016-07-01Implement Message Carbons in Swift and Swift/ControllersTobias Markmann
If the server supports message carbons, Swift will try to enable it. Carbon copied messages will open a chat window in the background if no chat window exists for the conversation. Test-Information: Tested with a XMPP server Swift and a mobile Android client all supporting message carbons. Tested direct messages and MUC PM messages. All working as expected. Added unit tests for message carbons of sent messages and message carbons of received messages. All unit tests pass on OS X 10.11.5 Change-Id: I8d5b5d9975651a2353909dea976f58e4bf12e014
2016-06-23Improve Linux spell checking UX and enable it by defaultTobias Markmann
This removes support for user dictionaries for now. The new UI shows a list human readable languages (in their native spelling) where the user can select one to use for spell checking. Updated our InstallSwiftDependencies.sh based on the package names in their repositories. Test-Information: Tested on Ubuntu 16.04 with Hunspell and tested it still builds on OS X 10.11.4. Did not test InstallSwiftDependencies.sh. Change-Id: I24fc705b1495f7c39a8da149cbd7116e41609998
2016-05-31Fix serialization code in response to VS 2013 warningTobias Markmann
cl.exe from VS 2013 warns about a negative integral constant converted to unsigned type (C4308). This is worked around by using the & operator instead of the << operator, which also allows serialization but does not cause the warning. Test-Information: Tested on Windows 8 with Visual Studio 2013. The build does not cause the warnings on the affected files anymore. Change-Id: I53d82361cb07e36e96e0ff1398e6fb1b35bb01fa
2016-05-26Fix MUC invitation request being overwritten by presence changeTobias Markmann
After an initial presence change, when a client received a MUC invite, a potential following offline presence could replace the previous MUC invite request in the chat view. This commit fixes the issue. Test-Information: Added unit test verifying the new behavior. Verified absence of described bug in Swift GUI. All tests pass on OS X 10.11.5. Change-Id: I8fd9c7ad3f5f5009f48fc3d86017cd94e1998f01
2016-05-04Fix /me message handling for highlighted messagesTobias Markmann
Test-Information: Added a unit test to test for the fix. Tests pass on OS X 10.11.4. Change-Id: Ibf071ae47663bfefdc856339932de6a1fe4a642d
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-22Mark file-transfer notice as read when chat window is activatedTobias Markmann
Applied some foreach modernization in process. Test-Information: Tested by sending files between two Swift instances and verifying the new behavior works as expected. Tested on OS X 10.11.4 with Qt 5.4.2. Change-Id: Ie3f9c2126d946d9041b08be98a19cbfb468871f3
2016-04-14Fix bug of /me commands not being shown as actionsTobias Markmann
Test-Information: Added a test case that verifies this behavior. This test case succeeded before the refactoring in 74e5131 and now succeeds again. Tested Swift UI 1-to-1 and MUC messages with /me commands. Tested on OS X 10.11.4 with open-source clang. Change-Id: I270a0b4e2ddc595919646bddcc5e1f27074c9e1f
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-04Apply automated clang-tidy fixes and add missing includesTobias Markmann
Test-Information: Builds on OS X 10.11.4 and unit tests pass. Change-Id: I8775e8d1e3addbc88b220c1cc618637f706daca2