/usr/share/eiskaltdcpp/luascripts/adccommands.lua is in eiskaltdcpp-scripts 2.2.9-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | --// adccommands.lua: rev005/20080510
--// adccommands.lua: Let you change your nick on ADC hubs
local adccommands = {}
function adccommands.tokenize(text)
local ret = {}
string.gsub(text, "([^ ]+)", function(s) table.insert(ret, s) end )
return ret
end
function adccommands.changeNick(hub, newnick)
local sid = hub:getOwnSid()
newnick = dcu:AdcEscape(newnick)
DC():SendHubMessage( hub:getId(), "BINF " .. sid .. " NI" .. newnick .. "\n" )
end
dcpp:setListener( "ownChatOut", "adccommands",
function( hub, text )
if (hub:getProtocol() == "adc" and string.sub(text, 1, 1) == "/") then
local params = adccommands.tokenize(text)
if params[1] == "/help" then
hub:addLine( "(adccommands.lua) /nick <nick>", true )
return nil
elseif params[1] == "/nick" then
if params[2] then
adccommands.changeNick(hub, string.sub(text, 7))
return true
else
hub:addLine("Usage: /nick <nick>")
return true
end
end
end
end
)
DC():PrintDebug( " ** Loaded adccommands.lua **" )
|