summaryrefslogtreecommitdiffstats
path: root/Sluift
AgeCommit message (Collapse)Author
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-17Cleanup #pragma pollution in Sluift element convertorsTobias Markmann
There were a lot #pramas to ignore unused private field warnings. The pragmas and the unused fields have been removed. Test-Information: Build on OS X 10.11.3 with XCode Clang. Change-Id: Ie2f5398771088f93631c0f2c03d3cfdcca94cee6
2016-03-15Explicitly convert between nullable and non-nullable on OS XTobias Markmann
Clang was complaining about implicit conversions between nullable and non-nullable NSString pointers. Adjusted our std::string -> NSString* conversion utilities to check for nil and return an empty std::string in that case. Replaced uses of [NSString stringWithUTF8String] with our STD2NSSTRING macro. Turned std::string <-> NSString* conversion macros into functions. Test-Information: Builds without the warning on OS X 10.11.3 and Swift runs without issues. Change-Id: I949f2f3332018391aead58ef362764f4b7955b01
2016-02-10Sluift: Add timeout to roster receiving operationsRoger Planas
This avoids Sluift indefinitely waiting if the server does not respond Test-Information: Before the patch, a sluift client would wait indefinitely if a buggy XMPP server does not respond. With this patch, sluift clients now timeout and through an exception after SLUIFT_TIMEOUT when the server does not respond. Change-Id: I9d36f53a8f4d5b3d594cef68c42de38fd5a1c296
2016-02-10Sluift: Ensure that message event body is retrieved correctlyRoger Planas
As a result of commit "Change stanza body to boost::optional<std::string> type" (commit 1b9ccc1fef6104eaf951153ddccdc6bb15899e9a), Sluift was not populating the 'body' part of the message event, casting it to a bool instead. By adding get_value_or("") to that body part, the actual body value is retrieved, and the message event ends up containing the right information. Test-Information: Without the patch, Sluift's message event body is 'true'. With the patch, Sluift's message event body contains the actual message. Component messages also tested and event body as expected. Change-Id: I366202aa5bf28a3315a81d909ea08f0933aa06d7
2015-11-11Fix sluift API for clearing certificateGurmeen Bindra
Before this patch it was calling the constructor and creating certificate object with empty string. This was causing tests to fail when client was set with null certificate. This object fixes it by setting the certificate object to Null if the certificate file is empty. Test-information: Test cases using sluift with this API that set null certificate now pass Change-Id: Id75e22b58afebb2db463a7a23a4ca0686ef6eb12
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-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-09-18Specify OS X framework version for script interface extractionTobias Markmann
The iTunes support in Sluift requires extraction of the iTunes scripting interface. Clang version Apple LLVM version 7.0.0 will error with "error: type arguments cannot be applied to non-parameterized class 'NSArray'" and similar on the extracted scripting interface. With this change the sdp tool will generate scripting interfaces compatible to OS X 10.10. The generated interface files do not cause the error. Test-Information: Tested the build on OS X 10.10.5 and OS X 10.9.5 and verified that the Sluift command "sluift.itunes.get_current_track()" still works on both systems. Change-Id: If70c797aea69e95c7be3cda4c50b64da45028aac
2015-07-21Sluift: Add set_certificate for sluift clientsRoger Planas
This patch introduces a 'set_certificate' API for Sluift clients, which it is just a wrapper around Swiften's Core client setCertificate. Test-Information: Generated different user certificates for a user (trusted, untrusted, invalid, expired...) and set M-Link to enable flag 'tls_require_client_cert'. Calling 'set_certificate' with these certificates behaved as expected, either letting the Sluift client to authenticate or not. Also tested caling 'set_certificate' with no parameter, and the certificate was successfully cleared (that is, client would no longer be able to connect) Change-Id: Ieb56d59f7f7c1c7027f0fe56905fb83ac3b25298
2015-04-30Honour global sluift timeout setting in add/remove contactEdwin Mons
The add_contact and remove_contact calls used a fixed timeout of -1, which could cause the operation to hang forever, even when a timeout was set. Test-Information: add_contact and remove_contact properly honour global timeout on a broken connection. Change-Id: I6bd877a8123ddab87b1f653c0cfda7a6b101dae7
2015-02-11Sluift: Add set_vcard shortcutRoger Planas
Change-Id: If1f0b08ac600e6c84d367132cc512dc5a3add442
2015-02-11Sluift: Add element convertor for vCardRoger Planas
Change-Id: I55e69471a03b507b3c50ac5fa24b486a0826e1c5
2014-12-15Update Copyright In SluiftKevin Smith
Change-Id: I19f8ae342e028a6a7b4b13758f2e8c170a1db80c
2014-12-14Add index element to ResultSetEdwin Mons
The index element was missing, added it in Swiften and Sluift. Change-Id: I709037fafcc5242c7c2e2fddb8469316c106d51a
2014-12-10Sluift: Add a get_options to retrieve connection settingsRoger Planas
Change-Id: I3767f479609bf64cc6d64932e125c2e66e5f75eb
2014-11-06Cleanup for MAM fin element convertor for Sluift.Tobias Markmann
Test-Information: Compiles, no further testing required by the changes. Change-Id: I8a6174af9728d6b53a506d50e8b5132be103b4d2
2014-11-04Add Sluift element convertor for MAM fin element.Tobias Markmann
Test-Information: Yet to be done. Change-Id: I624a64ae8817695fb1be00f0473ede3915751a21
2014-10-30Add node attribute to MAMQueryEdwin Mons
Added node to MAMQuery, the serializers, unit tests and the Sluift ElementConvertor. Test-Information: Unit tests pass on OS X 10.9 Sluift script querying a pubsub archive sent the right query. Change-Id: If8620104a11b402d7b51a6e9b34ccbe1b7e6d15a
2014-10-30Brining XEP-0313 (MAM) implementation in line with version 3.0.Tobias Markmann
Added support for <fin/> element, including serializer/parsers and unit tests for them. Added more unit tests based on XEP examples for existing parsers. Removed unneccesarry includes from existing MAM implementation. Test-Information: Existing and new unit tests pass successfully. Change-Id: I7e6bf85e0961d59801b452e4559cc1db9e9e6ed8
2014-10-30Add missing virtual and SWIFTEN_OVERRIDE annotations to reduce warnings with ↵Tobias Markmann
C++11. Test-Information: Tested with Clang 3.6.0. Change-Id: I1f9ae8ae535d90f92b7263e86b51fe64b15524b4
2014-10-23Fix code in response to clang warnings.Tobias Markmann
Removes some unused private members and restructure switch statement to handle all cases. Test-Information: Fixed code does not emit the clang warnings anymore. Change-Id: I06a9036b307014e2f882e3cee45a6881b24c3f70
2014-10-17Make core.c generation compatible with Python 2.4Edwin Mons
generate_embedded_lua in Sluift/SConscript used a bytearray, which wasn't available until Python 2.6. Modified the code to use the string data instead of a bytearray. Test-information: Builds on OS X 10.9 and CentOS 5.9 sluift binary works on both platforms Change-Id: Iae29f76e32c8b7a827bc438caf09457b259446ca
2014-09-17Handle Isode's IQ ForwardingKevin Smith
Change-Id: I3b358e6a60f1ff546f2e578b6e0a54072b4c6da5
2014-09-16Add Subject element convertor to SluiftEdwin Mons
Test Information: MAM queries now return a payload of _type='subject'. Change-Id: I4fe4eb5105f4f19d146e4cca741d35bb7760cf6c
2014-08-10Fix invalid characters being allowed in JID domainsRichard Maudsley
Test-Information: Prepare valid and invalid JIDs and make sure that isValid() is reported correctly. Added unit tests. Change-Id: Ic4d86f8b6ea9defc517ada2f8e3cc54979237cf4
2014-07-18Sluift: Add 'show' parameter option to send_presence methodsRoger Planas
Change-Id: I9fbd4514f6bc0d46738154abce495519e43ad46b
2014-07-14Sluift: Add 'fs' moduleRemko Tronçon
The 'fs' module provides filesystem functions. Currently has function to list directory contents and test whether a path is a file. Test-Information: Tested in external script. Change-Id: I14ba614b0b3bd52f5d9e87a40dc6477d99604d88
2014-06-22Sluift component supportEdwin Mons
Change-Id: Ib8af01c04c866e198c04d35236dea4da464c9116
2014-06-08Fix crash in Sluift DOMElementConvertorEdwin Mons
DOMElementConvertor crashed because the stack wasn't large enough for deeper nested element trees. Calling lua_checkstack grows the stack if there's need for it. Normally Lua does this for you, but the DOMElementConverter can spend quite some time in non-Lua space. Change-Id: I23e563d49191b1db1204d2f6fa7d30e2e9d05c1f
2014-05-27Added Sluift MAM examples. send_mam_query becomes set_mam_query.Richard Maudsley
Change-Id: I5d81e2476c83a16a8e478656d11d91137b009f3a
2014-05-19Sluift: Fix conversor build errors for older compilersRoger Planas
Change-Id: Ia3c0195ffc5d93a1d3189fe811929459ee2d06a7
2014-05-19Sluift: Remove residual tprint in pubsub subscribe functionRoger Planas
Change-Id: Ieec3795aa80e7913ee65c536f16361b758e8448c
2014-05-18Sluift: Add assertions on conversionRemko Tronçon
Change-Id: I641380fe7423af7b2c7be992f59244a57fb24b51
2014-05-12Fix create_form to work properly with fieldsEdwin Mons
Change-Id: I02f2ec421bd7ba54f64eff35dc1c6e21a7c22545
2014-05-12Fix to Sluift MAM query parametersEdwin Mons
Change-Id: Ieefb87795316ffa4f513cf1d19d20730596db6d9
2014-05-12Add sluift function create_formEdwin Mons
The function send_mam_query needs an optional form. Created a generic form creation function, and made the pubsub configuration form function use that. Change-Id: I9e839b28df3916c1fd0b09d84a03cc521d1736ad
2014-05-12Add support for <before/> to ResultSetEdwin Mons
Change-Id: I46bd9f24fc887b180cee3c2aa75a6c9e1761473b
2014-05-09Fix MAM Sluift.Richard Maudsley
Change-Id: I75e87e9c1a0f12f6c56dcb63f0a06f715277b99b
2014-05-09Fix compiler warnings in Sluift convertors.Richard Maudsley
Change-Id: I26a212dcf17af79696c0446a88fb2272e890f007
2014-05-02Added Sluift MAM convertors.Richard Maudsley
Change-Id: I472023726e84fbdd14af1fd9f57de411a20eb584
2014-04-30Update LuaElementConvertor interface to work with Element instead of Payload.Richard Maudsley
Change-Id: I4f8b69b1a13fff21c605011f45763e01f03259cf
2014-03-21Sluift: Fix compilation warningRemko Tronçon
Change-Id: Ib542e69848ee85e4a017528e6ffe5da61276619a
2014-03-20Sluift: Initialize client tracing at creation timeRemko Tronçon
This avoids all calls to set_trace_enabled prior to connect() being ignored. Change-Id: Ib4f2bc9815aae2bd456f2ececcb2a37ac460eebc
2014-02-13Fix clang warningsRemko Tronçon
Change-Id: I7cd26f00f626b64da934e9f5594db393d6184b9c
2014-02-02Sluift: Add new_certificateRemko Tronçon
Change-Id: If4e4ef98c00f15c0a88557860f0377843a8713c0
2014-02-02Sluift: Remove accidentally committed code.Remko Tronçon
This was generating incorrect tab completions. Change-Id: I6072de10358d024a3584ae2d7d2fff57149d645f