summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-05-22 14:42:30 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-05-22 14:42:30 (GMT)
commitcd47e717cb2d5789a69582f2661bd110e1e72f37 (patch)
tree2f96e24e6780d0d943a0fee15495c710ba4a57df /Sluift/sluift.cpp
parent2d87e3b4f19e64c255cf21732c11a65c85b96883 (diff)
downloadswift-contrib-cd47e717cb2d5789a69582f2661bd110e1e72f37.zip
swift-contrib-cd47e717cb2d5789a69582f2661bd110e1e72f37.tar.bz2
Fix options passing in Sluift connect() call
Diffstat (limited to 'Sluift/sluift.cpp')
-rw-r--r--Sluift/sluift.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp
index 5bcc059..85b35f9 100644
--- a/Sluift/sluift.cpp
+++ b/Sluift/sluift.cpp
@@ -68,7 +68,7 @@ class SluiftClient {
void connect() {
rosterReceived = false;
- client->connect();
+ client->connect(options);
}
void connect(const std::string& host) {
@@ -205,7 +205,10 @@ static inline SluiftClient* getClient(lua_State* L) {
static int sluift_client_connect(lua_State *L) {
try {
SluiftClient* client = getClient(L);
- std::string host(luaL_checkstring(L, 2));
+ std::string host;
+ if (lua_type(L, 2) != LUA_TNONE) {
+ host = luaL_checkstring(L, 2);
+ }
if (host.empty()) {
client->connect();
}