summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-02-03 13:45:44 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-02-04 15:41:17 (GMT)
commitde378c0b47268aea03177165156627659e28dde3 (patch)
tree3da89610ffb11bcdcc850ad260d01830187444c2 /Swiftob/scripts
parent20333d5b8dc0f97b60415f0daf3c53a573e0ff8f (diff)
downloadswift-de378c0b47268aea03177165156627659e28dde3.zip
swift-de378c0b47268aea03177165156627659e28dde3.tar.bz2
Remove abandoned Swiftob subprojectswift-3.0rc1
Swifttob used to be an initial approach of a XMPP bot using Swiften. Today such a bot would probably use Sluift. Test-Information: ./scons test=system passes on OS X 10.11.3. Change-Id: I976f26d906f3007b4395e90fdd966e2c00cb1c2c
Diffstat (limited to 'Swiftob/scripts')
-rw-r--r--Swiftob/scripts/agenda.lua94
-rw-r--r--Swiftob/scripts/badWords.lua15
-rw-r--r--Swiftob/scripts/echo.lua5
-rw-r--r--Swiftob/scripts/eval.lua14
-rw-r--r--Swiftob/scripts/irssiLogs.lua23
-rw-r--r--Swiftob/scripts/logAllMessages.lua6
-rw-r--r--Swiftob/scripts/version.lua32
7 files changed, 0 insertions, 189 deletions
diff --git a/Swiftob/scripts/agenda.lua b/Swiftob/scripts/agenda.lua
deleted file mode 100644
index 897b89c..0000000
--- a/Swiftob/scripts/agenda.lua
+++ /dev/null
@@ -1,94 +0,0 @@
-agendas = {}
-currents = {}
-
-function full_agenda(from)
- fullagenda = {}
- fullagenda[1] = "Roll call"
- fullagenda[2] = "Agenda bashing"
- for i, v in ipairs(agendas[from]) do
- table.insert(fullagenda, v)
- end
- table.insert(fullagenda, "Date of next meeting")
- table.insert(fullagenda, "Any other business")
- return fullagenda
-end
-
-function agenda_full_command(command, params, message)
- from = message['frombare']
- ensure_loaded(from)
- agenda = agendas[from]
- fullagenda = full_agenda(from)
- reply = ""
- for i, v in ipairs(fullagenda) do
- reply = reply..i..") "..v.."\n"
- end
- reply = reply.."Fini"
- swiftob_reply_to(message, reply)
-end
-
-function agenda_append_command(command, params, message)
- from = message['frombare']
- agenda_append(from, params)
- agenda_save(from)
- swiftob_reply_to(message, "Done.")
-end
-
-function agenda_up_command(command, params, message)
- from = message['frombare']
- ensure_loaded(from)
- up = tonumber(params)
- if up == nil then up = 1 end
- currents[from] = currents[from] + up
- if currents[from] <= 0 then currents[from] = 1 end
- item = full_agenda(from)[currents[from]]
- if item == nil then item = "Fini." end
- reply = currents[from]..") "..item
- swiftob_reply_to(message, reply)
-end
-
-
-function agenda_clear_command(command, params, message)
- from = message['frombare']
- agendas[from] = {}
- agenda_save(from)
- swiftob_reply_to(message, "Done.")
-end
-
-function agenda_save(from)
- agenda = agendas[from]
- swiftob_store_setting("count@@@"..from, #agenda)
- for i, v in ipairs(agenda) do
- swiftob_store_setting(i.."@@@"..from, v)
- end
-end
-
-function ensure_loaded(from)
- if agendas[from] == nil then
- agenda_load(from)
- end
-end
-
-function agenda_load(from)
- agendas[from] = {}
- currents[from] = 0
- num_items = tonumber(swiftob_get_setting("count@@@"..from))
- if num_items == nil then num_items = 0 end
- for i = 1, num_items do
- agenda_append(from, swiftob_get_setting(i.."@@@"..from))
- end
-end
-
-function agenda_append(from, item)
- ensure_loaded(from)
- agenda = agendas[from]
- table.insert(agenda, item)
- agendas[from] = agenda
-end
-
-swiftob_register_command("agenda", "Anyone", "print the full agenda", agenda_full_command)
-swiftob_register_command("agendaappend", "Owner", "append an item to the agenda", agenda_append_command)
-swiftob_register_command("agendaclear", "Owner", "clear the agenda", agenda_clear_command)
-swiftob_register_command("agendaup", "Owner", "Moves the current counter by n, and returns the current agenda item", agenda_up_command)
-
-
-
diff --git a/Swiftob/scripts/badWords.lua b/Swiftob/scripts/badWords.lua
deleted file mode 100644
index 2c16214..0000000
--- a/Swiftob/scripts/badWords.lua
+++ /dev/null
@@ -1,15 +0,0 @@
-function bad_words(body, muc, nick, message)
- words = {"sbwriel"}
- print("Received line from '" .. nick .. "' in '" .. muc .. "':")
- print(body)
-
- for _, word in pairs(words) do
- if string.len(string.match(body, word)) > 0 then
- --swiftob_reply_to(message, "Kicking "..nick.." for bad word "..word)
- swiftob_muc_kick(muc, nick)
- end
- end
-end
-
-swiftob_register_listener(bad_words)
-
diff --git a/Swiftob/scripts/echo.lua b/Swiftob/scripts/echo.lua
deleted file mode 100644
index a478a46..0000000
--- a/Swiftob/scripts/echo.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-function echo_message(command, params, message)
- swiftob_reply_to(message, params)
-end
-
-swiftob_register_command("echo", "Anyone", "What did you say?", echo_message)
diff --git a/Swiftob/scripts/eval.lua b/Swiftob/scripts/eval.lua
deleted file mode 100644
index c9840dc..0000000
--- a/Swiftob/scripts/eval.lua
+++ /dev/null
@@ -1,14 +0,0 @@
-
-function eval_command(command, params, message)
- assert(loadstring(params))()
- swiftob_reply_to(message, "done")
-end
-
-function evalr_command(command, params, message)
- result = assert(loadstring(params))()
- swiftob_reply_to(message, "" .. result)
-end
-
-swiftob_register_command("eval", "Owner", "Evaluate an expression", eval_command)
-swiftob_register_command("evalr", "Owner", "Evaluate an expression and return the result", evalr_command)
-
diff --git a/Swiftob/scripts/irssiLogs.lua b/Swiftob/scripts/irssiLogs.lua
deleted file mode 100644
index 3cecd9d..0000000
--- a/Swiftob/scripts/irssiLogs.lua
+++ /dev/null
@@ -1,23 +0,0 @@
-function irssi_log_to_file(muc, line)
- filename = muc:gsub("@", "_at_")
- filename = filename:gsub("%.%.", "_")
- filename = filename:gsub("/", "_")
- filename = filename:gsub("\\", "_")
- file = io.open(filename, "a+")
- if file == nil then
- io.close()
- else
- file:write(line)
- file:write("\n")
- file:close()
- end
-
-end
-
-function irssi_log_message(body, muc, nick, message)
- time = os.date("%H:%M")
- irssi_log_to_file(muc, time.." <"..nick.."> "..body)
-end
-
-swiftob_register_listener(irssi_log_message)
-
diff --git a/Swiftob/scripts/logAllMessages.lua b/Swiftob/scripts/logAllMessages.lua
deleted file mode 100644
index a14c0f3..0000000
--- a/Swiftob/scripts/logAllMessages.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-function log_a_message(body, muc, nick, message)
- print("Received line from '" .. nick .. "' in '" .. muc .. "':")
- print(body)
-end
-
-swiftob_register_listener(log_a_message)
diff --git a/Swiftob/scripts/version.lua b/Swiftob/scripts/version.lua
deleted file mode 100644
index 25e8870..0000000
--- a/Swiftob/scripts/version.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-function friendly_version(version)
- result = version['name']
- if version['version'] ~= nil and version['version'] ~= "" then
- result = result.." version "..version['version']
- end
- if version['os'] ~= nil and version['os'] ~= "" then
- result = result .." on "..version['os']
- end
- return result
-end
-
-function version_command(command, params, message)
- jid = swiftob_muc_input_to_jid(params, message['from'])
- if jid == nil then
-
- else
- swiftob_get_software_version({
- to=jid,
- timeout=10,
- success_callback=function(result)
- swiftob_reply_to(message, params.." is running "..friendly_version(result))
- end,
- failure_callback=function(error)
- swiftob_reply_to(message, "Error getting version from "..params..": "..error)
- end,
- timeout_callback=function()
- swiftob_reply_to(message, "Timeout waiting for version from "..params)
- end})
- end
-end
-
-swiftob_register_command("version", "Anyone", "Ask for someone's version", version_command)