summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.lua2
-rw-r--r--nanochat/pylon.lua (renamed from nanochat_send/pylon.lua)14
-rw-r--r--wilson.ini.example2
3 files changed, 9 insertions, 9 deletions
diff --git a/main.lua b/main.lua
index 61c75ef..cd81b0e 100644
--- a/main.lua
+++ b/main.lua
@@ -8,7 +8,7 @@ local pylon_classes = {
irc = require'irc.pylon',
xmpp = require'xmpp.pylon',
discord = require'discord.pylon',
- nanochat_send = require'nanochat_send.pylon',
+ nanochat = require'nanochat.pylon',
}
local Wilson = class()
diff --git a/nanochat_send/pylon.lua b/nanochat/pylon.lua
index f7cd60f..7dae58b 100644
--- a/nanochat_send/pylon.lua
+++ b/nanochat/pylon.lua
@@ -6,13 +6,13 @@ local class = require 'r.class'
local BasePylon = require 'pylon'
local Channel = require 'channel'
-local NanochatSend = class.extend(BasePylon)
+local Nanochat = class.extend(BasePylon)
-function NanochatSend:init()
+function Nanochat:init()
self:_check_fields "server port poll"
end
-function NanochatSend:_connect()
+function Nanochat:_connect()
self.sock = socket.connect(self.server, tonumber(self.port))
self.sock:write("LAST 0\n")
self.sock:read("*l") -- discard count
@@ -20,11 +20,11 @@ function NanochatSend:_connect()
self.usids = {}
end
-function NanochatSend:add_channel(channel)
+function Nanochat:add_channel(channel)
-- don't need to do anything
end
-function NanochatSend:recving()
+function Nanochat:recving()
while true do
self.sock:write("SKIP "..self.lastid.."\n")
local deliverables = {}
@@ -61,7 +61,7 @@ function NanochatSend:recving()
end
end
-function NanochatSend:sending()
+function Nanochat:sending()
for dest_channel, message in self.inbox:iter() do
print('NNN',dest_channel,message.sender,message.body)
assert(self.sock:write("SEND "..dest_channel.descriptor.." "..message.sender..": "..message.body.."\n"))
@@ -71,4 +71,4 @@ function NanochatSend:sending()
end
-return NanochatSend
+return Nanochat
diff --git a/wilson.ini.example b/wilson.ini.example
index 859d23b..ee72645 100644
--- a/wilson.ini.example
+++ b/wilson.ini.example
@@ -18,7 +18,7 @@ token=bot_token_here
temp_wh=webhook_here
[pylon nanochat-gloop]
-type=nanochat_send
+type=nanochat
server=gloop.woop.example
port=44322
poll=5