summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/Examples/Login.lua')
-rw-r--r--Sluift/Examples/Login.lua32
1 files changed, 19 insertions, 13 deletions
diff --git a/Sluift/Examples/Login.lua b/Sluift/Examples/Login.lua
index 1733bb9..c43b72a 100644
--- a/Sluift/Examples/Login.lua
+++ b/Sluift/Examples/Login.lua
@@ -1,16 +1,20 @@
---
--- Copyright (c) 2010 Remko Tronçon
--- Licensed under the GNU General Public License v3.
--- See Documentation/Licenses/GPLv3.txt for more information.
---
+--[[
+ Copyright (c) 2010-2013 Remko Tronçon
+ Licensed under the GNU General Public License v3.
+ See Documentation/Licenses/GPLv3.txt for more information.
+--]]
--- This script logs into an XMPP server, and sends initial presence
--- Useful as initialization script for an interactive session ('-i'),
--- or as a starting point for scripts.
---
--- The following environment variables are used:
--- * SLUIFT_JID, SWIFT_PASS: JID and password to log in with
--- * SLUIFT_DEBUG: Sets whether debugging should be turned on
+--[[
+
+ This script logs into an XMPP server, and sends initial presence
+ Useful as initialization script for an interactive session ('-i'),
+ or as a starting point for scripts.
+
+ The following environment variables are used:
+ * SLUIFT_JID, SWIFT_PASS: JID and password to log in with
+ * SLUIFT_DEBUG: Sets whether debugging should be turned on
+
+--]]
require "sluift"
sluift.debug = os.getenv("SLUIFT_DEBUG") or false
@@ -18,6 +22,8 @@ sluift.debug = os.getenv("SLUIFT_DEBUG") or false
print("Connecting " .. os.getenv("SLUIFT_JID") .. " ...")
c = sluift.new_client(os.getenv("SLUIFT_JID"), os.getenv("SLUIFT_PASS"))
c:set_options({compress = false, tls = false})
-c:connect():send_presence("")
+c:connect()
+c:send_presence("")
print("Connected ...")
+print("Use the 'c' variable to communicate.")