diff options
Diffstat (limited to 'Sluift/sluift.cpp')
-rw-r--r-- | Sluift/sluift.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp index 49cfec4..b911772 100644 --- a/Sluift/sluift.cpp +++ b/Sluift/sluift.cpp @@ -4,16 +4,15 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -extern "C" { - #include "sluift.h" - #include <lauxlib.h> -} +#include "sluift.h" +#include <lauxlib.h> #include <iostream> #include <string> #include <deque> #include <boost/assign/list_of.hpp> +#include <Swiften/Base/foreach.h> #include <Swiften/Swiften.h> #include "Watchdog.h" @@ -63,6 +62,10 @@ class SluiftClient { return client; } + ClientOptions& getOptions() { + return options; + } + void connect() { rosterReceived = false; client->connect(); @@ -179,6 +182,7 @@ class SluiftClient { private: Client* client; + ClientOptions options; ClientXMLTracer* tracer; bool rosterReceived; std::deque<Stanza::ref> pendingEvents; @@ -453,12 +457,12 @@ static int sluift_client_set_options(lua_State* L) { luaL_checktype(L, 2, LUA_TTABLE); lua_getfield(L, 2, "compress"); if (!lua_isnil(L, -1)) { - client->getClient()->setUseStreamCompression(lua_toboolean(L, -1)); + client->getOptions().useStreamCompression = lua_toboolean(L, -1); } lua_getfield(L, 2, "tls"); if (!lua_isnil(L, -1)) { bool useTLS = lua_toboolean(L, -1); - client->getClient()->setUseTLS(useTLS ? Client::UseTLSWhenAvailable : Client::NeverUseTLS); + client->getOptions().useTLS = (useTLS ? ClientOptions::UseTLSWhenAvailable : ClientOptions::NeverUseTLS); } lua_pushvalue(L, 1); return 0; |