mirror of
https://github.com/ShadowNinja/LuaIRC.git
synced 2025-01-10 01:50:26 +01:00
Fixed name tracking a bit, should be fairly complete now
This commit is contained in:
parent
a8211a7678
commit
009e09dae6
@ -33,6 +33,9 @@ end
|
||||
|
||||
function meta:part(channel)
|
||||
self:send("PART %s", channel)
|
||||
if self.track_users then
|
||||
self.channels[channel] = nil
|
||||
end
|
||||
end
|
||||
|
||||
function meta:trackUsers(b)
|
||||
|
27
init.lua
27
init.lua
@ -170,6 +170,33 @@ handlers["PART"] = function(o, prefix, channel, reason)
|
||||
o:invoke("OnPart", user, channel, reason)
|
||||
end
|
||||
|
||||
handlers["QUIT"] = function(o, prefix, msg)
|
||||
local user = parsePrefix(prefix)
|
||||
if o.track_users then
|
||||
for channel, v in pairs(o.channels) do
|
||||
v.users[user.nick] = nil
|
||||
end
|
||||
end
|
||||
o:invoke("OnQuit", user, msg)
|
||||
end
|
||||
|
||||
handlers["NICK"] = function(o, prefix, newnick)
|
||||
local user = parsePrefix(prefix)
|
||||
if o.track_users then
|
||||
for channel, v in pairs(o.channels) do
|
||||
local users = v.users
|
||||
local oldinfo = users[user.nick]
|
||||
if oldinfo then
|
||||
users[newnick] = oldinfo
|
||||
users[user.nick] = nil
|
||||
o:invoke("NickChange", user, newnick, channel)
|
||||
end
|
||||
end
|
||||
else
|
||||
o:invoke("NickChange", user, newnick)
|
||||
end
|
||||
end
|
||||
|
||||
--NAMES list
|
||||
handlers["353"] = function(o, prefix, me, chanType, channel, names)
|
||||
if o.track_users then
|
||||
|
Loading…
Reference in New Issue
Block a user