summaryrefslogtreecommitdiffstats
path: root/Swift
AgeCommit message (Collapse)Author
2019-01-21Make Version.py compatible with both Py2 and Py3Edwin Mons
The merge of 4.x changes onto master introduced changes to Pyhon scripts that weren't compatible with Python 3. The Version.py script is now compatible with both Python 2 and Python 3, and a slightly underimplemented test has been expanded to actually live up to its name. getGitBuildVersion has been refactored completely. It has been simplified to require only one invocation of git describe, unit tests for the parsing have been added, and a way to call getGitBuildVersion from the commandline has been added to Version.py (to avoid adding a unit test that would call out to an external tool). DocBook.py has been made compatible with Python3, and some additional logic to prevent emitting b'path/to/docbook/xml' instead of the desired 'path/to/docbook/xml' has been added. Generation of COPYING in Swift/QtUI now uses the upstream version provided with SCons 3, and our custom version has been removed. Unused code in the SwiftenDevelopersGuide SConscript with invalid regular expressions has been removed, and the remaining regular expressions in SConscripts have been fixed. Test-Information Code has been tested on macOS 10.14. Scons now completes a build on a clean tree using either Python 2 or Python 3. Running it on a previouly built tree works with either, as well, mixing versions between invocations is not an issue. Swift unit tests pass with Python 3.7.0. Version.py unit tests pass with Python 2.7.15 and 3.7.0. Running with doc=1 works with both Python 2 and Python 3, even if the docbook points to a path with unicode characters in it. Resulting COPYING file has been verified both visually and against a Python2 generated one on master. Resulting XML files for documentation have been inspected. Resulting manual HTML and PDF files have been inspected. Change-Id: I54de909d80b8e35a8c351261ae10ce3537729c84
2019-01-15Merge tag 'swift-4.x' into masterTobias Markmann
* branch 'swift-4.x': Update for Debian Don't crash on missing bookmark result Add missing include for QAbstractItemModel Update Debian changelog Fix convertToWindowsVersion() function to handle more RCs Fix error response handling when requesting VCards Test-Information: ./scons test=all succeeded on macOS 10.14.2. Change-Id: I99d20a8b0e1b0be501fbbe95adebbff15f510184
2019-01-07Update for Debianswift-4.0.3Tobias Markmann
Fix UTF-8 handling issues in BuildTools/SCons/Tools/textfile.py . Test-Information: Tested that ./scons test=unit Swift works on Debain Unstable (sid) and macOS 10.14.2. Tested that build_for_debian.sh runs successfully on latest Debian Unstable (sid). Change-Id: I29d8c97ce3b4eb3e4fd680bdc814fb0c911262ff
2018-11-14Fix various uses of numeric_cast in UI bitsEdwin Mons
Apart from QtUI bits, this addresses use of uncaught numeric cast exceptions in message count handling, the spell parser and the MacOS idle querier. The WindowsServicePrincipalName logic previously had an issue where using ports from 32768 onwards would result in a bad_numeric_cast exception to be thrown. This has been addressed at the same time as the uncaught exceptions, and all ports should work now. The tags file has been extended to ignore more files. Change-Id: I73ced35f06517bee5c58f990d20fa437b40ac84e
2018-11-08Change unread counters to size_tEdwin Mons
Since the counters cannot be negative, changing the type used for unread counters to size_t seems a better fit, and it avoids the need for numeric_casts. Test-Information: Unit tests pass on macOS 10.13 Change-Id: I61badcfc410f0cce7f922da90b50ef5a809c6521
2018-07-27Autofix boost-use-to-string clang-tidy warningsKevin Smith
Done by adding --fix --fix-errors to the clang-tidy args in the Makefile Test-Information: Unit tests pass (macOS) Change-Id: I3a4df955ac3553afeb9384f23f9d8b2ef01117e2
2018-07-27Fix compiler warningsKevin Smith
This doesn't address the issue in ChattablesTest that the checks against 0 are being reported as checking null against 0 literals. Test-Information: Fewer warnings after the change (macOS). Change-Id: I24330f0ab99d6eb267e03a46983ced75e42c22cc
2018-07-26Handle changes in the new roster model properlyPeter Burgess
The new roster was temporarily resetting the model every time there was a change, this patch sets it up properly to use beginXxxRows, endXxxRows and dataChanged instead. Test-Information: Unit test created to check the onBeginAdd and onAdded signals get called at the correct time and that data is stored properly when a JID is added. Also tested live on test server, checked what happens when the user first logs in, and when contacts log on and off. There was some concern over the new setState function, and its impact on populating the new roster on login. I ran multiple tests, swift-4 vs swift-5 with the new roster, I tested having 3000 users with and without presence in the roster, 100 users and 3000 users split into 30 groups of 100. We tested both the time to populate the roster (pre presence) and the time from login until the roster become responsive and usable. The results weren't terribly different between swift-4 and swift-5 with the new roster, and swift-5 was populating both the old and new rosters, therefore we concluded that the new roster is not causing a significant slowing down during login. Change-Id: I2aba5cbcd81296b49d36c54ee7f07453f1b2db08
2018-07-24Add a XEP-346 FDP Form Submission DialogPeter Burgess
A new form submission dialog that will discover nodes containing fdp form templates in a given pubsub domain, and will present the form to the user ready to be filled out and submitted. Test-Infomation: Personally tested the request for all node items, loading the latest form from one of the discovered nodes, submitting a form and checking it turns up on my mlink server using mlc, checked that the submitted infomation is correct, what happens when an incorrect domain is queried, what happens when a valid domain is queried but it has no fdp nodes, and what happens when a form is requested from an invalid node. Unit tests written to test success and failure of the three controller functions requestPubSubNodeData(), requestTemplateForm() and testSubmitForm(). Change-Id: If8c57bb4e3120dd44d52f7332069eb18a14cb385
2018-07-19Rename MainController to AccountControllerThanos Doukoudakis
Change-Id: I9c006a2435294f2afb95a95bd856ad64274a8752 Test-Information: None.
2018-07-19Fix compiler warningsKevin Smith
Test-Information: Compiles now, didn't before (mac allow_warnings=0). Change-Id: I6bff608d8c308e933e8582242a3c9d55858981ce
2018-07-19Add server avatars to multiaccountThanos Doukoudakis
This patch implements a Model/View/Delegate for the multiple accounts a user might have. The list is shown on the left of the client, with an avatar, status presence and unread message counter. Mouse over a server avatar will show the user jid that was used to connect to the server. Server avatars are currently using the default Swift logo, server information are not connected with the actual data, and the presence icon is not being rendered. Future patches will improve this and connect to the actual server data. Test-Information Tested the changes in the UI in Windows 10 Qt5.8 and Ubuntu 16.04 Qt 5.6. Tested the status change, login, logout and saving account information during startup. Change-Id: I4aa86afffe6a02d589b47185cc587b2e09de7450
2018-07-18Add support for multiple accountsThanos Doukoudakis
Added support for multiple accounts and a list of servers where the user can switch between the accounts. Future patches will make the list widget to use server avatars with user status. Upon startup the client will reconnect with all previous accounts. If the user log outs with any of the accounts then it will not login automatically for future sessions, the credential though will be available to the user. Upon upgrading from previous versions, the client will migrate the account that was previously marked to auto-login to the new configuration and enable it. After the migration the autologin setting will be set to false. Some of the settings and command line arguments have been made obsolete due to these changes and removed, including SSO support, which will be re-introduced in a future patch. Test-Information: Tested the changes in Windows and Linux, tested adding and removing accounts, and switching between them. Tested the new configuration for accounts, the upgrade behaviour when an account is marked/not marked to autojoin, and the migration to the new configuration. Verified that the auto-login setting is set to false after the migration, and that the migrated account can be disabled (currently only by signing out). Change-Id: I63662f80e006112fde6f418f9743e2b420e81870
2018-07-17Add unit test for missing bookmark responsesKevin Smith
Test-Information: Without the recent fix for missing bookmark results, tests crash, on master they pass Change-Id: Iab2d55d6d60e5926485d31f4dd63a117a9d12aee
2018-07-16Change some spelling mistakes and improve styleThanos Doukoudakis
Test-Information: None. Change-Id: Idea7be5b1dd5d1829cd1a468d12cb527204ab397
2018-07-12Fix Python 3 compatibility of our SCons and tooling Python codeTobias Markmann
For the upcoming update to Scons 3, which works with Python 2 and Python 3, this change makes our code compatible with Python 3 so that it still works with Python 2. Test-Information: Tested these changes with SCons 3.0.1 on macOS 10.13.6 with Python 2.7.15 and Python 3.7.0. Change-Id: Idb5207b179a79a0dbe89d7e620d182a7d2f1ca6c
2018-06-21Add a leave room option in MUC roomsThanos Doukoudakis
This patch will add a leave room option in the cog menu of a MUC room, allowing the user to leave the room and close the window. Additionally when joining or leaving a room the autojoin field will change to true or false respectively. This patch also fixes a minor issue with a gui option that was not identifying bookmarked rooms at the cog menu. The autojoin option on the Enter room, Bookmark room and Edit Bookmark menu has been removed, since the default behaviour will be to automatically bookmark every MUC room the user joins, setting autojoin to true. If the user chooses to leave the room, then the autojoin flag will be set to false and the bookmark will be updated. Test-Information: Tested the changes in the UI in Windows Qt 5.9. Updated the ChatsManagerTests unit tests to check the chattables and the behaviour of the bookmarks, when joining and leaving MUCs. Change-Id: Iad1f34480a1e0b9df25c73b49247acc7b7825e20
2018-06-21Add missing include for QAbstractItemModelTobias Markmann
This fixes building Swift with Qt 5.11. Test-Information: Builds and tests pass on macOS 10.13.5 with Qt 5.11.0. Change-Id: I1be2cd081d8a520ec38ab7cca5ada0d7fc39b777
2018-05-29Sort input file listBernhard M. Wiedemann
so that the swift-im openSUSE package builds in a reproducible way in spite of indeterministic filesystem readdir order See https://reproducible-builds.org/ for why this is good. License: This patch is BSD licensed - see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Builds on different machines should no longer have differences in Swiften.h Change-Id: I8066a66db83c7d7ff10858196cb72b13af3f6008
2018-05-18Remove remants of non-netbook mode related codePeter Burgess
This includes removing the class QtChatTabsShortcutOnlySubstitute, passing around QtChatTabs instead of QtChatTabsBase, removing checks and casts relating to the possible use of either QtChatTabs or QtChatTabsShortcutOnlySubstitute, checks to see if the splitter exists as the splitter should now always exist. Test-Information: Program still builds and runs fine. Both login and main windows open and work correctly. Chat tabs open and close without fault. Unit tests still pass. Removing loginWindowGeometry from the config file causes no issues. Change-Id: Iab58ab7fd23571f4aeeb7c8a9a988bdb1500ba5b
2018-05-18Add underscore to QtUIFactory's member variablesPeter Burgess
Patch to add an underscore to the end of old QtUIFactory's member variable names that are missing one. Test-Information: Swift still builds and runs, no noticable problems logging in, chatting, opening new chat tabs etc, no unit tests broke. Change-Id: I938d1c325ccefd775d3742ee2b509f98e84c426d
2018-05-18Open swift with sensible geometry in netbook mode the first timePeter Burgess
If swift has never been run in netbook mode before, then netbook mode geometry is set by some hard coded default value during construction of QtSingleWindow. The code to set and utilize the original non-netbook mode geometry has been removed. Test-information: No unit tests as all changes at Qt specific. Tested after deleting config file. Tested after replacing config file with one that has no SINGLE_WINDOW_XXX settings (so a config file you would find if swift had never been opened in netbook mode). Tested with one or other of the SINGLE_WINDOW_XXX settings missing Tested with config file that contains all SINGLE_WINDOW_XXX settings Change-Id: I0075456796bd830b855629fbd03d601df7f2891c
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-05-10Enable Emojis on Windows and LinuxThanos Doukoudakis
This patch enables emojis for Linux and Windows. In windows, currently the emojis are only black and white, due to some inconsistencies in the UI. For Linux the Noto Colour Emoji font (https://www.google.com/get/noto/) is used. The client must be build with Qt 5.6 or newer to support the emoji characters. Test-Information: Tested the changes with Qt 5.8 on Windows 10 and Linux Ubuntu 17.10. Built and tested the appimage on Ubuntu 17.10 and Ubuntu 16.04. Change-Id: I6d0f2842349eae789d773c33d1a93ad33304df3e
2018-05-09Remove ability to hide rosters via QSplitterTobias Markmann
Previously, you could move the QSplitter slider all to one side and thereby hide the account and MUC rosters. However, these splitters can be hard to get back their previous positions. Test-Information: Verified in Swift that you can not hide/collapse the roster in the UI anymore on macOS 10.13.4. Change-Id: If6622684feb47e5b4172405fe15c3a90178d7b9d
2018-05-09Fix extra semicolon warning in QtDBUSURIHandler.cppTobias Markmann
Test-Information: N/A. Change-Id: I4ddf3ad405e424a2b038e8a7421ad455df412960
2018-05-09Add timer for QtChatWindow focus to stop messages appearing unreadPeter Burgess
When a QtChatWindow's text input receives focus, it initiates a one second timer. When it times out, the QtChatWindow checks whether the QtChatWindow in general has focus. If so, it will reset the unread count to 0. If it doesn't still have focus, it will not alter the message count and the chat will still show as having unread messages. Test-Information: This is in the Qt user interface, so no unit tests have been written. Tested thoroughly on a test server on ubuntu 17.10. Tested what happens when the chat window is changed via both a click on the roster (both old and new) and a click on the tabs. All three scenarios produce the desired results when both keeping focus for the full second, or when losing focus before the second is up. Change-Id: Idfa66990545051cfe6c9853418b2138ee0f1f57c
2018-05-08Fix scrolling to currently selected item in QtExpandedListViewTobias Markmann
Test-Information: Verified this by running Swift and using a large roster. Clicking on items near the top resulted in the scroll area jumping around. It does not anymore and works as expected. Change-Id: Ic543015aa46120cf0ec082c10b72c944b5559ef8
2018-05-07Replace boost::lambda with C++11 lambdasTobias Markmann
Test-Information: Builds on macOS 10.13.4 with clang trunk. All unit and integration tests pass. Produces fewer warnings with clang trunk (previously reported marked-unused-but-used warnings). Change-Id: I849d764537cfbc380155e87b033dc5e517b3c342
2018-05-07Allow to hide empty overview bundles in rosterTobias Markmann
This fixes a regression of commit 19eefe668. Test-Information: Ran Swift and verified that the 'Unread' bundle is never shown if empty. Change-Id: If13b84291e08d14bbbed57f53e0999e78e20f21d
2018-05-04Set QSplitter width to 0px on macOS for more native lookTobias Markmann
Finder, Mail and other applications all use one or zero width splitters. Test-Information: Rebuilt and verified the splitter look more similar to those in Mail and Finder on macOS 10.13.4. Change-Id: I14827bf3e17d73b24f634031c90ff6b062f5611d
2018-05-04Use dedicated QtExpandedListView in new roster UITobias Markmann
QtExpandedListView is always high enough to show all entries in the model. It also correctly hands off scrolling events to the parent widget for smooth scrolling. Test-Information: Tested on macOS 10.13.4 with a well sized roster, that sizing and scrolling works as expected. Tested with Qt 5.5.1. Change-Id: I6d93db3045e1c2f343b89c0d45874d8f85a20c0a
2018-05-04Fix issues raised by some warnings and reenable them in SwiftTobias Markmann
Test-Information: Builds and test pass on macOS 10.13.4 with clang trunk. Change-Id: Ib4826c38a85fd2097137c09014ba4da6c98879da
2018-05-02Make new roster's sort case insensitivePeter Burgess
The new roster design (behind future setting) is showing the contact list with case sensitivity. This patch makes it case insensitive. Test-Information: I have tested it on my test server, created several contacts whose names in my roster start with either a lowercase or uppercase "u". The patch puts them in the expected order. Change-Id: Iaba812454eba8282745e1df5b621c0d7ff0fb93f
2018-04-28Show away contacts as yellowKevin Smith
Test-Information: Tried assorted yellows, this one doesn't look too terrible. Change-Id: I32c52dc262c1c49c741286d3402e8357559c411a
2018-04-28Don't duplicate blue-roster entries on reconnectKevin Smith
Test-Information: Log in, go offline, go online. Before the patch this'd trigger duplicate entries (and now it doesn't). Change-Id: I651f8a0285e5e0748c263ab42f56aa86a3a2a3a1
2018-04-28Disable false-positive clang warningKevin Smith
Test-Information: ./scons check=1 allow_warnings=0 now passes on latest macOS Change-Id: I4411d6b4953e6e2eb7fbb53e460fef296d24b0e6
2018-04-28Allow Qt to generate 0 as nullptrKevin Smith
Without this, Qt-generated code can't be compiled allow_warnings=0 on macOS Test-Information: ./scons allow_warnings=0 Change-Id: Ifc9409f54ebd60dcfd2eef5d5619fc96e2a52e5f
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-04-10Update Debian changelogTobias Markmann
Closed two further bugs from the Debian bug tracker in the changelog entry for 4.0.2. Test-Information: None. Change-Id: I74dd7350990ddd1627b2b9c64b322ed84f3a6186
2018-04-05Fix convertToWindowsVersion() function to handle more RCsswift-4.0.2Tobias Markmann
The new version conversion function allows up to 8 patch releases, up to 11 RC releases, up to 7 beta releases, and up to 5 alpha releases. The script fails hard on invalid input, thus failing the build when used. It also allows for checking the release tag in the release process. Test-Information: Added unit tests for some critical properties of the conversion. As previously the minor number of the Windows version triplet was not used, all new versions using this new scheme are considered newer, for the same major version. Change-Id: I53552a72ceaf7fe90f919990bd3d3be45a976c03
2018-03-28Fix error response handling when requesting VCardsswift-4.0.1Tobias Markmann
When fetching a vCard, an empty vCard response and an item-not-found error are semantically the same. Changed the code to treat and item-not-found error as an empty vCard in this case. This enables setting your own vCard on servers that do not return an empty vCard for fresh accounts and generally improves UX when fetching others vCards. Test-Information: Added unit tests verifying new behaviour. Tested with Swift against a Prosody IM instance. Without this change you cannot set the vCard on a fresh user. With this patch you can set your own vCard. Change-Id: I5f9adb4c3d6b6a1a320b834be918ab5ab0b52975
2018-03-27Fix empty marking colour handling in MUCControllerPeter Burgess
When there is a room security marking and the colours have the value "" they should be set to the default black and white. Instead they were being set to "", so I have updated this and uncommented the relevant unit test. Test-Information: The uncommented unit test is now passing, and all other related unit tests still pass. A MUC room with a marking but blank colour values has been tested on a test server and works as expected. Change-Id: I1138ca1f035f8b7c0367c36ec3a65cc857721b8c
2018-03-27Convert cppunit tests into gtests for MUCControllerTestPeter Burgess
As stated above, and one test has been commented out as it was not being run when it was a cppunit test and it fails due to a bug in MUCController. The bug fix patch to follow shortly. Test-Information: All tests run and pass except the one mentioned above that has been temporarily commented out. Change-Id: Ie1ce6039c3b6c97e0072b7518b3337d5dfbf6362
2018-03-27Add new ReferencePayload element class, parser and serializerPeter Burgess
Added a new element object ReferencePayload, and created the parser and serializer to handle this element. Currently no functionality to send references directly in swift, nor to render their contents. Test-Information: Unit tests written and passed for serializer and parser, testing various types of valid and invalid references, and testing references with embedded payloads. Change-Id: I81fd5d9e020fac1729640f297705806af97f6388
2018-03-24Add option for enabling future featuresKevin Smith
Test-Information: None Change-Id: I548a18ff47c45eafda31584858607e5705386911
2018-03-24Always use netbook modeKevin Smith
Thus begins 5.0's UI reworking. This removes the option for netbook mode, leaving it always-on. Test-Information: Ran with no parameters on macOS, resized the window, quit, restarted, size seemed to have persisted. Logged in, menus seem to work (debug console at least). Sign out, log in again was fine. Change-Id: I365eb6ada33994b75636675576a1443f9b385593
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-03-19Update Swift and Swiften changelog for upcoming 4.0 releaseswift-4.0Tobias Markmann
Test-Information: None. Change-Id: I4d89315b084406f44654c4d6a7e2e9c8da0874ce
2018-03-13Tiny fix adding #ifdef to call to logMessage()Peter Burgess
In ChatControllerBase::handleIncomingMessage(), there is a call to logMessage() that should have been wrapped in "#ifdef SWIFT_EXPERIMENTAL_HISTORY", and now it is. Test-information Unit tests still pass, swift still runs as expected. Change-Id: Ia985565d496d73a5c6fed5ce79390b7b0a4b0551