aboutsummaryrefslogtreecommitdiff
path: root/src/irc/message.lua
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-11-21 19:16:03 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-11-21 19:16:03 +0100
commit783fefdcb375ab58382579afeb092c67b8832813 (patch)
treefbb3b16efd0b74796c33c2e8754863ea148f2c6c /src/irc/message.lua
parent09628cded4b1d5a47b82d0b13eaf1789adb35e91 (diff)
downloadluairc-783fefdcb375ab58382579afeb092c67b8832813.tar.xz
Port to Lua 5.3HEADmaster
Diffstat (limited to 'src/irc/message.lua')
-rw-r--r--src/irc/message.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/irc/message.lua b/src/irc/message.lua
index e05e87e..4471ba8 100644
--- a/src/irc/message.lua
+++ b/src/irc/message.lua
@@ -1,19 +1,16 @@
---
-- Implementation of IRC server message parsing
-- initialization {{{
-local base = _G
-local constants = require 'irc.constants'
-local ctcp = require 'irc.ctcp'
-local irc_debug = require 'irc.debug'
-local misc = require 'irc.misc'
-local socket = require 'socket'
-local string = require 'string'
-local table = require 'table'
+local constants = libs.constants
+local ctcp = libs.ctcp
+local irc_debug = libs.debug
+local misc = libs.misc
+local socket = libs.socket
-- }}}
---
-- This module contains parsing functions for IRC server messages.
-module 'irc.message'
+local message = {}
-- internal functions {{{
-- _parse {{{
@@ -32,7 +29,7 @@ module 'irc.message'
-- to the received command</li>
--
-- </ul>
-function _parse(str)
+function message._parse(str)
-- low-level ctcp quoting {{{
str = ctcp._low_dequote(str)
-- }}}
@@ -49,8 +46,8 @@ function _parse(str)
local reply = false
if command:find("^%d%d%d$") then
reply = true
- if constants.replies[base.tonumber(command)] then
- command = constants.replies[base.tonumber(command)]
+ if constants.replies[tonumber(command)] then
+ command = constants.replies[tonumber(command)]
else
irc_debug._warn("Unknown server reply: " .. command)
end
@@ -67,3 +64,5 @@ function _parse(str)
end
-- }}}
-- }}}
+
+return message