summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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
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
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-03-09Improve profile editing UX when vCard is not supportedTobias Markmann
Previously, when editing your own vCard and the server responded with an error, the user would indefinitely see a spinner. With this commit, the user will see an error message instead. Test-Information: Tested on OS X 10.11.3, with a XMPP server with enabled and disabled vCards. The enabled case still works as expected and in the disabled case the error message is shown, instead of the indefinite spinner. Change-Id: Ic9167ee633a2f9a9fa3b520f6067dc2c94857c07
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
2016-01-22Add missing Timer related cleanup codeTobias Markmann
This commit adds explicit code to stop timers which are connected to objects that are about to be deleted from memory. Test-Information: ./scons test=system passes on OS X 10.11.3. Change-Id: I139314f3a223e3dc63b78b96be17d3ae53cd3de3
2016-01-19Reset impromptu support flag when logging offTobias Markmann
Test-Information: Added unit test verifying the expected behavior. It passes on OS X 10.11.2. Change-Id: I7531e313bf03dbea276f133db042ce26e6da4a53
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-12-17Show file-transfer description if providedTobias Markmann
Test-Information: Tested by transferring a file between two Swift instances. Tested in WebKit chat views and in plain chat views. Change-Id: Ie46cbd7bac8a36478f64b4557cf55926e6d4af37
2015-12-17Remove superfluous member in ChatsManagerTobias Markmann
Added missing signal disconnects in UserSearchController. Test-Information: All unit tests pass. Change-Id: I13fba64d40f7999c3d2196ad2917ff22392f72b3
2015-12-16Fix crash related to removal of contactsTobias Markmann
Test-Information: Added test@example.com contact and removed it afterwards. Without this patch Swift crashed. With the patch it does not anymore. Change-Id: I09e93340cb0a23291ab094a4cdb7c79ef719645a
2015-11-28Close 'Edit Profile'-dialog on sign outTobias Markmann
Test-Information: Tested going offline and signing out on OS X 10.10.5. Change-Id: I307c318e8b22a62473df142e94d6895490ea2e2d
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-11-06Make methods non-virtual that are not overridden by subclassTobias Markmann
These cases have been uncovered by Clang Analyzer as they were called during some constructor. However, there is no reason for them being virtual. They are never overridden in a derived class. Test-Information: Unit tests still pass on OS X 10.10.5. Change-Id: I90b5396a0dba971d9150c35f9107733f7f4637cd
2015-11-04Fix swiften handling when client certificate is missingGurmeen Bindra
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
2015-10-30Only highlight text if a highlight color is setTobias Markmann
This commit has the default rule set the default color and changes HighlightAction::highlightText_ symbol to HighlightAction::highlightWholeMessage_ as it is more descriptive of its use. Test-Information: Tested highlighting with the default rule set, and one with a highlight color set for the chat rule. Change-Id: Ic638e6347bdf6623ab5959341486233494f005f0
2015-10-30Ignore DND drops of JIDs for contacts already in the conversationTobias Markmann
Swift allows dropping contacts from group chats or the roster on a chat window to invite them or start an impromptu chat. With this commit Swift will ignore drops which only contain JIDs that are already part of the conversation. Test-Information: Tested the described behavior with roster and room contact drags in anonymous and non-anonymous rooms. Change-Id: I2f06082ea4bc1140210f9f1a165bdf276a130273
2015-10-30Fix code in response to unused macro and private field warningsTobias Markmann
Test-Information: Build and tests pass successfully on OS X 10.10.5. Change-Id: I614586660796f9ef043156d09d998d39934a6eca
2015-10-30Fix Doxygen issuesTobias Markmann
Ran ./scons doc=1 with Doxygen 1.8.10 and fix all mentioned errors. Test-Information: Tested building of documentation on OS X 10.10.1 with Doxygen 1.8.10. Change-Id: I136054f457f9b3ff6b269f5ac32bf435450c017c
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-16Mark removed contacts as unavailable in SwiftTobias Markmann
When removing a contact, a XMPP client will not receive an explicit unavailable presence stanza for the contact from the server. Because of that Swift used to show removed contacts still with their old presence in the Chats tab or the chat view. With this patch, the PresenceOracle will flush all known presence of a contact as soon as the JID is removed from the roster. An unavailable presence will stored under the removed bare JID and is emitted via the PresenceOracle::onPresenceChange signal. Test-Information: Added a unit test verifying this behavior. Tested the behavior with two scenarios: a) Account A and B adding each other and accepting the subscription request. Starting a chat between A and B. After removing B in A's account, B used to be shown as available in the chat view and the Chats tab. With this patch B is shown as unavailable. b) Account A and B adding each other and accepting the subscription request. A removing B, and B removing A. After A adds B again, B used to be shown with the old presence even before B accepted the subscription request. This behavior is also fixed with this patch, not showing B as online until B accepted the subscription request. Change-Id: Iba97d3bedd0ac962ea00b25a0d2ed6106ed55a55
2015-10-16Require a node-part for JIDs entered in 'Add contact…'-dialogTobias Markmann
While it is possible to add domain only JIDs to a user's roster this is rarely the intention of a user. This patch adds the requirement of a node-part for the address entered in the dialog and presents a warning if the node-part is missing. Test-Information: Verified that a warning triangle is shown if there is no node-part in the user entered address. Change-Id: I38dd0b34ca7cb19b38bb7e1c457f7a8a9ef84028
2015-10-16Add additional unit tests for Chat <-> JID bindingTobias Markmann
The recent commit 582ca91 changed the behavior the binding between chat sessions and the full JID of a chat contact. This commit adds additional unit tests verifying the behavior of implemented in 582ca91. This means a chat session binds to the full JID of an incoming message only if the message has a non-empty body text or is a 'typing' chat state notification. It also tests the rebind to another resource if a 'typing'-CSN or a body message is received from that resource. Test-Information: All unit tests pass on OS X 10.10.5. Change-Id: Id3f25d8a3ff78c407ed4b2a97bd421dc4aa58688
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-14Annotate getter method as const as it does not write anythingTobias Markmann
Test-Information: Still builds and unit tests pass. Change-Id: I472491184ba10ec3bdbd4cb94613768639ac6f57
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-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-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-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-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-10Implement logic behind 'Clear all' buttonTobias Markmann
The 'Clear all' button in the file transfer overview window was only present in the UI, without any logic behind. That's fixed now. Test-Information: Send a file in between two Swift instances. Verified that the button is enabled/disabled at appropriate times and works as expected if pressed. Change-Id: Ib92621cba479683ade8d815ce5ace9768449a499
2015-07-10Create notice events for incoming file-transfersTobias Markmann
Test-Information: Send a file from one Swift instance to another. The UX is similar to that of a MUC invite, clicking the notice will bring the relevant chat in front. Change-Id: Ief3cd7371ae01b2b38b6d1af36189df961eacef4
2015-07-10Show collecting of file transfer candidates in UITobias Markmann
Show the user the collection of possible file transfer candidates after pressing the 'Start' button for a file transfer. Previously the buttons remained in the UI giving no feedback to the user at all. If no UPnP/NAT-PMP device is present, it this stage can take a couple seconds to timeout and move on to the next stage. Furthermore this commit adds documentation for the different states in the ChatWindow::FileTransferState enum. Test-Information: Tested this in a network environment with no UPnP/NAT-PMP device between two Swift instances. Change-Id: I76ec6e641a2acd683938fe2d8f542d023a244145
2015-07-09Enable SSOMili Verma
Add a hidden option to enable single sign on. When that is enabled, ensure that the user only enters the domain name and that the JID is constructed from the Windows log-on credentials. Test-information: Tested on Windows. Unit tests pass. Change-Id: Ia5592a3893f0807a3801b515c8fcddb580c9ef8d
2015-07-08React to file transfer cancellation before the transfer startedTobias Markmann
Connect FileTransfer::onStateChanged signal earler to slot in FileTransferController, so the slot will be called for state changes that occur before a transfer started. Test-Information: Tested with two Swift instances and cancelling the sender side and receiver side. Without this patch the receiver side UI does not change if the receiver side cancels the transfer. Change-Id: I1d4d3e1ac78689a16120bfa9ccdec30ab1191ee3
2015-07-07Remove partial remains of commented out codeTobias Markmann
Test-Information: Not applicable. Change-Id: I1620be8361c1b70b365011ac7f0ec6ac11dbe76f
2015-07-07Add ability to enter rooms when offlineTobias Markmann
Rooms in the recent chats list and bookmarks can be entered by double click if the user is offline. They are joined when the user goes online again. Test-Information: Tested by going offline via the presence menu and then entering rooms via recent chats and bookmarks. Change-Id: I8c3eadd29c3353c2cf5f04f53b71ef7ad67a5c05
2015-07-07Show old vCard in UI if vCard update is rejected by serverTobias Markmann
Previously QtVCardWidget would work on a shared copy of a VCard and modify the shared version. Now when setting the vCard on the widget it creates its own copy and works on that. The ProfileController holds a reference to the VCard it sets on the UI. If the server rejects an update it can reset the UI to this VCard. Test-Information: Tested against a XMPP server that rejects all vCard updates (mod_readonly). Change-Id: Iaa8eed6406f2dc6cc7ac5434194a7dae4f879b33
2015-07-07Add hidden option to prevent disconnect when smartcard removedMili Verma
This patch adds an option 'disconnectOnCardRemoval' to system-settings.xml which when set to false allows the user's session to stay connected if the smartcard is removed. The default value of this option is true if it is not specified. Test-information: Tested on Windows using NIST smartcards. Tested true and false values set for this option in the file and also when option is not specified (true). Unit tests pass. Change-Id: I7e421b4153ff7d3000f41999add20d339076c96e
2015-06-29Pass an optional error codeMili Verma
This patch creates and passes on an optional boost::system::error_code variable which contains more error info which can be displayed in case of an error. Test-information: Tested using WIP code on Windows. Change-Id: I285b8aec5e9c00d3a8e0d8cc0d5e7b4c5d94c099
2015-06-14Execute sound actions if requested and if text is highlightedTobias Markmann
HighlightRule did not consider keywords in its isMatch() routine. MUCController only triggered possible HighlightActions if it was a direct 1-to-1 MUC message or an impromptu chat message. Both issues are fixed. Additionally fixed the HighlightRuleTest. It had some wrong assertions related to rules being case insensitive by default and keywords match inside longer words by default. Test-Information: Tested with a highlight rule that highlights text and tested that sound actions are executed if the text is highlighted. Additionaly verified that other behaviour (own nick mentions, direct 1-to-1 messages) have their potential sound actions still executed. Change-Id: Ia922a1ff38c66f6458d28a18a8cdde10e821f83d
2015-06-10Add ability to limit SChannel to TLS 1.0Kevin Smith
Some servers have very restrictive TLS stacks that respond badly to a bug in the SChannel TLS implementation, meaning that TLS has to be limited to 1.0. Add ClientOptions.tlsOptions. This is a method of passing options into the TLS stack. It's currently only used for the TLS 1.0 workaround in SChannel, but we might reasonably expose other options in the future, such as limiting cypher suites. Disables use of SSLv3 for SChannel Also updates the coding style in SchannelContext a bit. Test-Information: Compiles on both OS X and Windows(SChannel). OS X doesn't show the new option. Windows shows it, and remembers it between logins. Not tested against a server requiring 1.0 only, but a previous hack with the same approach was tested. Change-Id: I1e7854d43811fd173f21f98d4dc3915fc7a4b322
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