summaryrefslogtreecommitdiffstats
path: root/Swift
AgeCommit message (Collapse)Author
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
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-29Replace chat view theme with one based on the new designTobias Markmann
This also removes the old chat theme resources and some code in QtWebKitChatView that was required for compatibility to Adium-style themes. The new code uses a CSS style in the header to change the font size and does not iterate the whole DOM tree itself anymore. Added new resources for failed and successful asks. Test-Information: Tested MUCs, PMs, message correction and file-transfers with the new chat theme. Change-Id: If922a972c658189444e60a7b00e5e5e96661620d
2016-03-11Fix translatability of vCard editor popup menu itemsTobias Markmann
Previously a preprocess macro expansion variable was passed into Qt's tr() function. Qt's translation tool did not pick these stings up. Test-Information: Builds on OS X 10.11.3 with Qt 5.4.2. Provided german translations for some of the items in the popup menu and then ran Swift with --language de. The translated popup menu items were correctly translated in the UI as expected. Change-Id: I50aeac9dd7277e1ce07b5a362c7474962dbcfad4
2016-03-10Fix crashes in spellchecking code in case of broken backendTobias Markmann
If Swift uses Hunspell as spellchecking backend its configuration can fail, because a dictionary is missing or a wrong path was specified. Instead of crashing, spellchecking will be disabled and a warning is printed to the terminal. Test-Information: Tested on Debian 8 with Qt 5.3.2. Tested enabling/disabling of spellchecking in the UI, selecting different dictionaries and broken dictionaries. Change-Id: Ib6d73ed3d7a6a3701410b0f6dc983d41e807df82
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-03-09Fix warning coloring of chat input fieldTobias Markmann
The previous stylesheet was too generic, as it applied on all widgets and sub widgets, including a potential context menu. This fix will only color alerts and the text input in the warning color. Potential context menus are colored according to the application style. Test-Information: Tested alert colors and text input color on OS X 10.11.3 with Qt 5.4.2. Change-Id: I0d1f704f4eacddf41befb7dfbc8bbf7ef28f88ce
2016-03-04Remove unneeded files from old highlight editor UITobias Markmann
Test-Information: ./scons test=unit passed without errors on OS X 10.11.3. Change-Id: I9303fd2d5a08a17d1e8f2ca015bec7c883aeedad
2016-02-26Fix minor gripes in Dutch translationswift-3.0Edwin Mons
After living with it for a few days, some translations popped out as clumsy. Redoing those. Test-Information: Less annoyance when running Swift RC3 with this translation Change-Id: I7f5b07468e395ad2fe125c173185199f292af7f4
2016-02-26Update German translationTobias Markmann
The user is now addressed in a formal way ("Sie" instead of "Du"). Also removed obsolete strings. Test-Information: Ran Swift in German and saw the correct translation strings. Change-Id: I2755775f40c63f8d42f293b97d7aab4f0f05277b
2016-02-25Disable Hunspell support by default as it is not finished yetTobias Markmann
Our Hunspell support has not been finished and thoroughly tested yet. This commit disabled building with Hunspell by default, even if the dependencies for it are installed on the system. Remove libhunspell-dev from the build depends in Debian packaging. Test-Information: Tested on Debian 8. Tested with and without the hunspell_enable=True flag. With the spellchecking options are shown and however spell checking is not stable. Without it the spellchecking options are not shown and spellchecking is disabled in general, as expected. Change-Id: I100582852cbe128149fdb2e2a28d4ae407398be6
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-15Update Dutch translationEdwin Mons
The non-writable patch added a string, adding a translation for that. This commit also removes vanished and obsolete strings: they have served their purpose. Test-Information: Ran Swift in Dutch on OS X 10.11, received a file and tried to save it to a non-writable location, saw the message. Change-Id: I94de949f5f0b331ee4f633268729faa7265e32d3
2016-02-15Fix crash when saving a received file to non-writable locationTobias Markmann
WriteBytestream::write(…) now returns a boolean indicating its success state (false in case of an error). Adjusted FileWriteBytestream accordingly. The QtWebKitChatView will test if the file path selected by the user is writable before accepting it and starting the transfer. If it is not writable a red warning message will be added to the file-transfer element in the chat view. Test-Information: Added an integration test that tests the new behavior for the FileWriteBytestream class. Tested two file transfers on OS X 10.11.3, one to a write protected location and another to /tmp. The first is not accepted by the UI, and without the UI sanity check it results in a file-transfer error. The second succeeds as expected. Change-Id: I5aa0c617423073feb371365a23a294c149c88036
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-15Update Dutch translationEdwin Mons
Updated all strings, except for the ones in QtPlainChatView. Test-Information: Verified all strings I could find in Dutch translation with Swift running in normal, trellis and netbook mode. Change-Id: I77e01e42206c19728c9d06f9cfbc98d6f980df9e
2016-02-15Move QApplication instantiation in QtUI/main.cpp downEdwin Mons
If there is no X11 display set, bits in libqxcb as used by the plaform integration bits called by QApplication will trigger an abort. Moving this down to just before where the app object is needed allows --help or --version even if there's no DISPLAY, and also improves runtime of these GUI-less operations quite a bit. Test-Information: Test platform Debian 8 x64 with Qt5 Starting swift-im with DISPLAY set works as expected Asking for --version or --help without DISPLAY now works Actually starting the UI still aborts. Change-Id: Id8eeee90598fe2a8e3b26ba042835a0ea928932f
2016-02-11Make Add <field> in the VCard wizard translatableEdwin Mons
Used to use simple string contactenation, but that's unsuitable to at least Dutch. Test-Information: Test platform OS X 10.11 Untranslated VCard field dropdown looks as before. Change-Id: I371b47d570032deffa0ed662ba13964d96b22633
2016-02-10Fix update_translationsEdwin Mons
As of Qt5, lupdate doesn't accept the -codecfortr option anymore. Qt sources are now expected to always use UTF-8. Fixed the lupdate command line so that this option is now only used when building against Qt4. Test-Information: Tested on OS X 10.11 using Qt 5.4 Tested on CentOS 6 using Qt 4.6 Change-Id: Ie5bcb383bc2ebded6dc1deb65d988d3b268dc293
2016-02-04Remove abandoned Swiftob subprojectswift-3.0rc1Tobias Markmann
Swifttob used to be an initial approach of a XMPP bot using Swiften. Today such a bot would probably use Sluift. Test-Information: ./scons test=system passes on OS X 10.11.3. Change-Id: I976f26d906f3007b4395e90fdd966e2c00cb1c2c
2016-02-04Anonymise owner and group in source tar packageEdwin Mons
Requires GNU tar, which isn't installed by default on OS X. Test-Information: Tested on Debian 8 and OS X 10.11 with Homebrew gnu-tar. Change-Id: I2165654489bd01223f1366a71f62fd7fe4187e11
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-24Change version information in about dialog to be selectableTobias Markmann
This is to allow easy copy and paste of Swift version, Qt build version and Qt runtime version into potential bug reports. Test-Information: Tested changed UI behavior on OS X 10.11.2 with Qt 5.4.2. Change-Id: I6234f08e77402c3d1ec2f5b7a98c19b059a445ea
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
2016-01-18Remove unused variable reported by GCCTobias Markmann
Test-Information: Unit tests pass on Debian 8. Change-Id: I648f97a3ebd2c798df809a1f2cb37b689df94f42
2016-01-07Add file extension to star-unchecked.png referenceTobias Markmann
This change is just for consistency and does not change the behavior. Test-Information: Checked and uncheck star still works in vCard. Change-Id: Ib6597b48cec9d3498611524c9a97fce62811ec02
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-30Workaround QTabBar early eliding bug on OS XTobias Markmann
The issue is visible when having two chat windows with the same label. One of them is elided even though enough horizontal space is available. Test-Information: Tested multiple chats including some with the same tab label. Tested many open chat windows overflowing the horizontal space of the tab bar to test scroll behavior on overflow. Verified that the code stops the early eliding bug on OS X 10.10.5 with Qt 5.4.2. Verified that workaround is not needed on Debian 8.2 with Qt 5.4.2. Change-Id: I2dc0d417fb6f402dda2f7575a83ca3faf4eb63cf
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-26Request redraw of recent chats on compactness changeTobias Markmann
Test-Information: Verified UI in the 'Chats' tab is directly updated after compactness change on Debian 8.2. Change-Id: I20fcf863983ff206be4cb427d4d77bd42f23e53e
2015-11-25Fix Ctrl + Tab shortcut when MUC contact list is selectedTobias Markmann
This also fixes the issue of Ctrl + Backtab moving two tabs back on Windows. Test-Information: Tested on Debian 8.2 with Gnome 3 and Qt 5.3.2, OS X 10.10.5 with Qt 5.4.2 and Windows 8 with Qt 5.4.2. Verified that Ctrl + Tab works correctly. Verified that Ctrl + Tab works correctly when the chat room contact list is selected. Verified that Ctrl + Backtab works correctly. Change-Id: I9e461d741a399aed59142505e29c03cebe26097e
2015-11-11Break out of .deb packaging on errorKevin Smith
Test-Information: Ran the script until it started building (then cancelled it). Change-Id: I803f8aae2b042dea9870491dfd46bbc5a6fd88f6
2015-11-11Update .deb platformsKevin Smith
Test-Information: Built using the script Change-Id: Id4f6dd0d36e975341b5b30298db4541fbe018b2e
2015-11-10Update .deb packaging for Qt5Kevin Smith
Test-Information: Generated (unsigned) debs on Ubuntu 15.10 Change-Id: Ibacee5d63c0662d2a9cfbc61e0d0f2c48fd93736
2015-11-10Fix certificate-less login in SwiftTobias Markmann
Commit 8405fa1 changed the client certificate handling inside Swiften to not fallback to certificate-less authentication if there is an error. This commit fixes Swift to only pass a certificate during login if a file is set and the user wants to authenticate using client certificates. Test-Information: Tested certificate-less login (worked). Tested certificate-based login (worked). Tested certificate-based login with deleted certificate file (correct error reported). Change-Id: I3b1393688c4802abfd7f66b7cb49ddd8c518e62b
2015-11-09Improve QtTextEdit::sizeHint() for symmetric vertical paddingTobias Markmann
Test-Information: Verified UI under OS X 10.10.5 and Debian 8.2. Change-Id: Ifaf063eed06f51c94d4103c5397187e62035fb90
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