local msg = message._parse(raw_msg)
misc._try_call_warn("Unhandled server message: " .. msg.command,
handlers["on_" .. msg.command:lower()],
- (misc.parse_user(msg.from)), base.unpack(msg.args))
+ (misc._parse_user(msg.from)), base.unpack(msg.args))
return true
end
-- }}}
base.assert(serverinfo.channels[chan],
"Received topic message for unknown channel: " .. chan)
serverinfo.channels[chan]._topic.text = new_topic
- serverinfo.channels[chan]._topic.user = (misc.parse_user(from))
+ serverinfo.channels[chan]._topic.user = from
serverinfo.channels[chan]._topic.time = os.time()
if serverinfo.channels[chan].join_complete then
callback("topic_change", serverinfo.channels[chan])
return val
end
-- }}}
--- }}}
--- public functions {{{
--- parse_user {{{
----
+-- _parse_user {{{
+--
-- Gets the various parts of a full username.
-- @param user A usermask (i.e. returned in the from field of a callback)
-- @return nick
-- @return username (if it exists)
-- @return hostname (if it exists)
-function parse_user(user)
+function _parse_user(user)
local found, bang, nick = user:find("^([^!]*)!")
if found then
user = user:sub(bang + 1)