From 4337f29d0a292bc520aeec1bebce816cc9045d37 Mon Sep 17 00:00:00 2001 From: Matthew Barksdale Date: Sat, 5 Mar 2011 14:40:39 -0500 Subject: [PATCH] Added a subroutine to access the OPER command, I'm eventually going to build upon this to be a full API for oper commands --- modules/Oper.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/Oper.pm b/modules/Oper.pm index 8210b96..69fb312 100644 --- a/modules/Oper.pm +++ b/modules/Oper.pm @@ -38,7 +38,7 @@ sub on_connect # They don't exist - don't continue. return if !$u or !$p; # Send the OPER command. - Auto::socksnd($svr, "OPER $u $p"); + oper($svr, $u, $p); return 1; } @@ -61,6 +61,15 @@ sub is_opered { return; } +# Start of the API + +# Sends the OPER command to the specified server. +sub oper { + my ($svr, $user, $pass) = @_; + Auto::socksnd($svr, "OPER $user $pass"); + return 1; +} + # Start initialization. API::Std::mod_init('Oper', 'Xelhua', '1.01', '3.0.0a7', __PACKAGE__); # build: perl=5.010000