X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fremotectl.rb;h=31d48fe397cbf22a0e059c71207a166d9da9c621;hb=51c35168127e0faed56bceb3f5103f92ed31478c;hp=cb7775e2835b4e6336fbc47943155e69f48ed693;hpb=8669de30cea27aee0116bb4420cbf15232c8c352;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/remotectl.rb b/data/rbot/plugins/remotectl.rb index cb7775e2..31d48fe3 100644 --- a/data/rbot/plugins/remotectl.rb +++ b/data/rbot/plugins/remotectl.rb @@ -15,16 +15,15 @@ class RemoteCtlPlugin < Plugin def remote_command(m, params) s = params[:string].to_s - new_m = PrivMessage.new(@bot, @bot.server, @bot.server.user('-remote.client-'), @bot.myself, s) - @bot.plugins.delegate "listen", new_m - @bot.plugins.privmsg(new_m) + u = @bot.server.user("remote:#{m.source.username}") + @bot.auth.login(u, m.source.username, m.source.password) + fake_message(s, :source => u) end end me = RemoteCtlPlugin.new me.remote_map 'dispatch *string', - :action => 'remote_command', - :action_path => 'dispatch' + :action => 'remote_command' me.default_auth('*', false)