]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/remotectl.rb
plugins: raise a descriptive LoadError when the db is corrupt on load
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / remotectl.rb
index b5b460fe296db8b57764488f42df11d4764fb068..31d48fe397cbf22a0e059c71207a166d9da9c621 100644 (file)
@@ -15,16 +15,15 @@ class RemoteCtlPlugin < Plugin
 
     def remote_command(m, params)
         s = params[:string].to_s
-        new_m = PrivMessage.new(@bot, @bot.server, m.source, @bot.nick, 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)