From cd47e717cb2d5789a69582f2661bd110e1e72f37 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Tue, 22 May 2012 15:42:30 +0100
Subject: Fix options passing in Sluift connect() call


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();
 		}
-- 
cgit v0.10.2-6-g49f6