]> PatchyGit - patchyircd.git/commitdiff
lua: make globals global
authorEgor <egor@patchysicp.xyz>
Fri, 27 Oct 2023 21:12:29 +0000 (00:12 +0300)
committerEgor <egor@patchysicp.xyz>
Fri, 27 Oct 2023 21:12:29 +0000 (00:12 +0300)
lua/channeldump.lua
lua/init.lua

index 2aa0d4f..8bf43b3 100644 (file)
@@ -5,7 +5,7 @@ local function showlist(name, ls)
                print("\t\t"..k)
        end
 end
-for k,v in pairs(ircd.channel_map) do
+for k,v in pairs(channel_map) do
        print("Channel "..k)
        if k ~= v.name then
                print("\tName: "..tostring(v.name))
index 64b41c8..ae99ce8 100644 (file)
@@ -3,6 +3,7 @@ function commands.reload(client, source, command, args)
        dofile "lua/init.lua"
        client_notice(client, "done")
 end
+setmetatable(_G, getmetatable(ircd))
 if not managed_hooks then
        managed_hooks = {}
 end
@@ -53,7 +54,7 @@ function commands.echo(client, source, command, args)
        end
 end
 function commands.joinall(client, source, command, args)
-       for k, v in pairs(ircd.channel_map) do
+       for k, v in pairs(channel_map) do
                channel_join(client, k, true)
        end
 end