summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-05-14Allow resending messages without 198 acksThanos Doukoudakis
This patch will allow to resend messages that have not been successfully delivered to the server. It requires that the server will have stream management enabled as described in XEP-198. Test-Information: Tested the changes on Windows and Linux. Modified the code to force messages to fail, and then tested the resend functionality. Added ChatControllerTest, with unit Tests for the resend case. The rest of unit test pass. Change-Id: Id095528247b25a47e34c5632b8469ebd4c97149b
2018-04-27Add a new merged roster/chats/MUCs viewKevin Smith
This is hidden behind the FUTURE flag, and is not ready for release yet, but is pretty usable. The three top filters (all/people/rooms) aren't plumbed in yet, recents need to be reinstated, and a favourites system would be very desirable. The code for the existing roster/chatlist is largely unchanged and with FUTURE disabled behaviour should not have changed. Lots of this code has now been put inside #ifndef NOT_YET blocks, to make it easy to find and remove later. When making this default later, all instances of NOT_YET should be inspected, unit tests should be added, and use of RECENT should be inspected - those related to this patch should be removed. Not all code is behind NOT_YET, so references to the old recents and chat lists will need to be manually checked and removed. Test-Information: Existing unit tests pass. New unit tests have not been added yet, and need to be before it's removed from FUTURE guards. Firing up Swift with future enabled shows the new view, and disabled doesn't. In both cases clicking around various things in the rosters opens the expected chats. Change-Id: I0e1ce98e4c644fa5b09ef65986cc826b6b564a7b
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-27Divide differently marked msgs and elide msgs matching roomPeter Burgess
If consecutive message from the same user have differing security markings, then mark them as non continuing to show clearer seperation of messages with different security markings. They are seperated in the same way as consecutive messages from different users are. Further to this, there is a new scheme for displaying message security markings. Messages with a security marking matching the room security marking will not be marked, aside from the first in a series of consecutive messages marked with the same security marking. Unmarked messages in a room with a security marking will be marked as such. This new marking display system can be turned on and off via an xml setting "mucMarkingElision". Test-Information: Unit tests written and passed in MUCControllerTest, runs as expected. Change-Id: Id2b66417f363c49c131d27e738ce786755d65203
2018-02-26Make carbons messages update ‘Recents’ listThanos Doukoudakis
This patch fixeses an issue that occurred when sending a message from another device, the carbons messages were displayed on the chat window but were not updating the recents chats list. Test-Information: Tested by logging in from two clients from the same account, and starting a 1-1 chat with another user. Recent chats tab was updated to both clients. Change-Id: I6e961ebbde6a87e4bcbcc49941ab4bacbac4d9d9
2018-02-14Fix a crash that occurs when inviting users in a chatThanos Doukoudakis
After inviting people to a chat, and converting to a MUC room, some of the chat window signals were still signaling the original chat controller, that has been destroying, causing a crash. Test-Information: Tested the changes in Windows 10 (64 bit), after triggering the dayChangeTimer, and onContinuationsBroken signal that was causing the crash. Change-Id: I70a80ab2653ed87a1dbea851157d95fb5918913f
2017-06-21Add Coala config for whitespace checkingTobias Markmann
Coala ( https://coala.io/ ), is a meta linting tool, that comes with own checks and integration for external tools for a lot languages. This adds a configuration that enforces no trailing whitespace and no lines with only whitespaces. Test-Information: Ran coala and fixes the issues it raised. Change-Id: I30b201135bbe8888d9d1bcadb28f9ced9b5db28f
2017-04-20Verify message IDs during last message correctionTobias Markmann
Previously we did not check the ID in the replace tag against the ID of the last message from that JID because some MUC components change the message ID. In case the ID of the last message and the ID in the replace tag do not match, the message is simply treated as a normal message. Test-Information: Added unit tests to verify the new behavior and adjusted existing test cases for new behavior. Added test cases to ChatsManagerTest.cpp that test verification of replacement IDs for 1-to-1 chats and test non-verification of replacement IDs for MUC. All tests pass on OS X 10.11.6. Change-Id: I85b1d2138b056b445a663f3ee3ab89a56cef4a2a
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-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-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-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-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
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-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-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-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-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-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-29Refactored keyword highlightingTobias Markmann
This commit changes the ChatWindow/ChatView APIs to not pass highlights actions as additional parameters but instead they are now part of the ChatWindow::ChatMessage and its parts. This allows the controllers to do highlighting in one single place and play sound actions on the highlighted message in a single place. On a highlighted message only unique sounds are played and they are played in sequence of the rules that matched the message. Test-Information: Adjusted the existing unit tests accordingly. Added unit tests that check reduplication of highlight action sounds and that the sound actions are emitted correctly. Manually verified that highlight sound actions with and without duplicated sounds are audible on OS X 10.11.3. Change-Id: I68c88e0d285d79d87b2997ed29d92b140480b394
2016-02-15Disable file-transfers to MUC PM contactsswift-3.0rc3Tobias Markmann
Currently the file-transfers to MUC PM contacts fail because the from JID does not match the initiator JID. The initiator JID is always the real client JID at the moment. Disabling file-transfer for MUC PM contacts provides a better UX for now. Test-Information: Tested file-transfer to normal contacts still works. Tested file-transfers to MUC PMs do not start. Change-Id: If5f59eb313a25ca919393f497a57fd339eb17e3e
2016-02-15Fix file-transfer UI replace after presence change glitchTobias Markmann
Forgot to reset the lastWasPresence_ flag when file-transfer UI is added to a chat view. The flag is used to amend the existing presence change log in a chat view in case of consecutive presence changes. Test-Information: Transfer a file to a Swift user and go offline afterwards. Without this patch the file-transfer UI is replaced by a presence change message. With this patch a new presence change message is added instead. Change-Id: I54a5cfd398bd4ba79eb15a1b14b08db3377233a4
2016-02-02Change stanza body to boost::optional<std::string> typeTobias Markmann
Changed MUCController to only handle message stanzas as subject change if <subject/> is present and neither <body/> nor <thread/> is present in the message stanza. Test-Information: Added unit tests verifying behavior described in XEP-0045 section 8.1. Unit tests pass on OS X 10.11.2. Change-Id: I1d22272da1675176be131ab360b214a98f20533f
2016-02-01Fix MUC nickname change error in ChatControllerTobias Markmann
ChatControllers used to wrongly lookup the nickname of a MUC PM contact using the bare room JID after a nickname change. With this change, the new full JID, i.e. with the new nickname as resource part, is used for nickname lookup. Test-Information: Tested with multiple PM chats open in a room. Both PM contacts changing their nicknames. Now only the corresponding chat tab changes its title. Before both used to change their title on a change of a single occupants nickname. ./scons test=system passes on OS X 10.11.3. Change-Id: I1c274498bcd96edd3370f73cb824fc81d726682c
2015-12-17Do not consult presence oracle for MUC PM presenceTobias Markmann
Test-Information: Added unit test verifying the behavior. Verified with multiple Swift instances in a MUC room that for MUC PMs only the same full JID presence counts. Change-Id: I08148221be34c3548f18da634586c828fd60feff
2015-11-06Making virtual calls in constructor of ChatControllers explicitTobias Markmann
Virtual calls in ctors/dtors are tricky as it is not clear what method is going to be called. By changing the code to call the explicit method it is obvious. This issue was raised by Clang Analyzer. This commit also adds missing SWIFTEN_OVERRIDE annotations. Test-Information: Still compiles, tests pass and Clang Analyzer warning so gone. Change-Id: I8096994277ad32933f992b9a11079c761d3ec619
2015-10-30Change bare JID presence lookup code to ignore prioritiesTobias Markmann
Before presence handling code was handled by both, the ContactRosterItem in Swift and the PresenceOracle in Swiften. The ContactRosterItem also considered the presence priority for deciding what presence to show for a bare JID. With this code all full or bare JID presence requests are finally handled by the PresenceOracle. For bare JIDs it is looked up to a presence of one of the available resources of that JID regardless of the priorities. Test-Information: Adjusted tests according to above description and documentation in PresenceOracle. Change-Id: I972a4574f476cdf4d4b5593a035eb1c25ef2f8ba
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-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-03-28Fix typo in ChatController regarding Message ReceiptsTobias Markmann
Test-Information: None. Change-Id: If02bc8bf250b129522bbeb841f699ccea9721422
2015-02-09Fix sender text that is used for matching highlight rulesTobias Markmann
Old behavior: MUC group messages are matched against the nickname as sender. MUC 1-to-1 messages and classic 1-to-1 messages are matched against the display name as sender. New behavior: MUC group messages are matched against the nickname as sender. MUC 1-to-1 messages are matched against the nickname as sender. Classic 1-to-1 messages are matched against the bare JID as sender. Test-Information: Tested on Mac OS X 10.9.5 that a chat rule matching a nickname string and a rule matching a full JID are highlighted correctly. Change-Id: Icaee2c946e34fceb6b1d40561674030740555de1
2014-12-15Update Copyright in SwiftKevin Smith
Change-Id: Idb6ef5fa191b1465c0bf46c47e63b695de07fa0b
2014-10-31Enable unblocking contacts from cog menu.Tobias Markmann
Renamed ChatWindow::setInputEnabled to ChatWindow::setOnline. Moved some input return key disabling logic into QtChatWindow. Test-Information: Tested in Swift, blocking a contact and unblokcing it from cog menu. Return still does not do anything on blocked contacts or when offline. Change-Id: I42faffb8618598fcc7c0bd44148902ea7028258e
2014-10-08Prevent multiple chat window alerts being shown with the same message.Richard Maudsley
Test-Information: Enable message delivery receipts, check that only a single alert is displayed for repeated messages. Change-Id: Ifb9f8bd74e592147745f95678f94c21563d301a5
2014-10-06Do not send chat state notifications to blocked contacts.Tobias Markmann
Test-Information: Started a chat session; then blocked the contact. Previously chat state notifications were send when typing. Now they are not send anymore. Change-Id: Id68f3faee4829e99cbfe1535f48346a8c27712d3
2014-07-28Fix displaying blocked user warning with bound JID chats. Support multiple ↵Richard Maudsley
alert messages. Test-Information: Block a user while the JID is unbound and verify that the yellow warning bar is displayed. Send bidirectional messages to bind the JID then repeat the block request and confirm that the yellow warning bar is displayed and that the user is indeed blocked. Open several alert messages, check that each one can be individually closed via cancelAlert. Change-Id: I120e393c028d15fd5f92154b44a8817cbc41edc9
2014-07-27Fix recent chat items not being shown for private MUC messages.Richard Maudsley
Test-Information: Send private message and verify that the private message item in the recents list is erased when the user leaves the MUC and the chat window is closed. Check that other recent items are not removed. Check that private message recent items are not saved and loaded when the application is restarted. Change-Id: I62b9d324143d2e77ed98592cf37fb681165285c2
2014-07-09Reworked highlight rules dialog. Added support for highlighting individual ↵Richard Maudsley
words in messages. Change-Id: I378fa69077c29008db4ef7c2265e5212924bc2ce
2014-05-30Show most recent time when squashing presence, not the earliestRichard Maudsley
Change-Id: I661b80d589386cf69d720f2786723afb2ab2f2ed
2014-05-29Check if contact supports file transfer before sendingRichard Maudsley
Change-Id: Iadb580ad8b3f258d49b7c1b8713f0f92009e022e
2014-04-25Hide reason field in impromptu chat invites.Richard Maudsley
Change-Id: Icb5075f85a23fc181ff8f5ee00633bb768c4eb5f
2014-02-25Build with new Boostish stuff.Kevin Smith
Can no longer use a shared_ptr as a bool. Change-Id: Ic92ede082e8f923830af943bb522c64e4f5ff453
2014-02-22Handle error responses to XEP-0184 receipt requests.Tobias Markmann
Change-Id: I23d77168c1c387342164d857a3eb5577bff65fb9 License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
2013-10-01Adding support for impromptu MUCs.Tobias Markmann
Change-Id: I363e9d740bbec311454827645f4ea6df8bb60bed License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
2013-08-04Factor Chat Message Parsing out and test itKevin Smith
Change-Id: Ia11dbebc736ecf9996f6d0fcc4550b749c55d433
2013-08-01Refactor chat messages so parsing of links/emoticons happens in controllers.Kevin Smith
Change-Id: I07256f23ffbb6520f5063bdfbed9111946c46746
2013-05-17Fixed unicode path handling.Remko Tronçon
- Use boost::filesystem::path consistently for referring to files. - Use boost::filesystem streams for I/O, such that paths are always handled correctly. - Use stringToPath and pathToString for conversion between strings and boost::filesystem::path, to ensure we have consistent unicode handling across platforms and environments. The default constructor and string conversion uses platform-dependent encoding, depending on the global locale set in the application, which causes problems. So, unless you are in platform dependent code, the default constructor and string() function should not be used. When constructing paths from other paths (e.g. using operator/), also use stringToPath (instead of string arguments) if the path can contain unicode characters. Change-Id: If286bd9e71c8414afc0b24ba67e26ab7608ef6ea