summaryrefslogtreecommitdiffstats
path: root/Sluift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-20 18:18:52 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-20 18:18:52 (GMT)
commit0adf0ba15f8217ac760cfafa355f8d712b3c0b6d (patch)
tree491744e03d44efd13402175abdef23fb9ecd1724 /Sluift
parent73aa15c624c1233ab6af9ca3618c95ee05b9cf04 (diff)
downloadswift-0adf0ba15f8217ac760cfafa355f8d712b3c0b6d.zip
swift-0adf0ba15f8217ac760cfafa355f8d712b3c0b6d.tar.bz2
Introduce ClientOptions struct.
Diffstat (limited to 'Sluift')
-rw-r--r--Sluift/sluift.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp
index 260c923..b911772 100644
--- a/Sluift/sluift.cpp
+++ b/Sluift/sluift.cpp
@@ -62,6 +62,10 @@ class SluiftClient {
return client;
}
+ ClientOptions& getOptions() {
+ return options;
+ }
+
void connect() {
rosterReceived = false;
client->connect();
@@ -178,6 +182,7 @@ class SluiftClient {
private:
Client* client;
+ ClientOptions options;
ClientXMLTracer* tracer;
bool rosterReceived;
std::deque<Stanza::ref> pendingEvents;
@@ -452,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;