]> jfr.im git - solanum.git/blobdiff - modules/m_operspy.c
Replace RPL_WHOISTEXT(337) with RPL_WHOISSPECIAL(320) (#419)
[solanum.git] / modules / m_operspy.c
index 0ea5a7f1744d4caa5e760f8f0d8f8ea726241cbb..32a1a96d9daa39a1e1d86a5fe751633d05f1e980 100644 (file)
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: m_operspy.c 254 2005-09-21 23:35:12Z nenolod $
  */
 
 #include "stdinc.h"
 #include "send.h"
 #include "channel.h"
 #include "client.h"
-#include "common.h"
-#include "config.h"
+#include "defaults.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "s_serv.h"
 #include "modules.h"
 #include "logger.h"
 
-static int ms_operspy(struct Client *client_p, struct Client *source_p,
-                     int parc, const char *parv[]);
+static const char operspy_desc[] =
+       "Provides the operspy facility for viewing normally private data";
+
+static void ms_operspy(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
+                      int parc, const char *parv[]);
 
 struct Message operspy_msgtab = {
-       "OPERSPY", 0, 0, 0, MFLG_SLOW,
+       "OPERSPY", 0, 0, 0, 0,
        {mg_ignore, mg_ignore, mg_ignore, mg_ignore, {ms_operspy, 2}, mg_ignore}
 };
 
 mapi_clist_av1 operspy_clist[] = { &operspy_msgtab, NULL };
-DECLARE_MODULE_AV1(operspy, NULL, NULL, operspy_clist, NULL, NULL, "$Revision: 254 $");
+
+DECLARE_MODULE_AV2(operspy, NULL, NULL, operspy_clist, NULL, NULL, NULL, NULL, operspy_desc);
 
 /* ms_operspy()
  *
  * parv[1] - operspy command
  * parv[2] - optional params
  */
-static int
-ms_operspy(struct Client *client_p, struct Client *source_p,
+static void
+ms_operspy(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
           int parc, const char *parv[])
 {
        static char buffer[BUFSIZE];
@@ -85,9 +86,9 @@ ms_operspy(struct Client *client_p, struct Client *source_p,
                        len = strlen(parv[i]) + 1;
 
                        if((size_t)(cur_len + len) >= sizeof(buffer))
-                               return 0;
+                               return;
 
-                       rb_snprintf(ptr, sizeof(buffer) - cur_len, "%s ",
+                       snprintf(ptr, sizeof(buffer) - cur_len, "%s ",
                                 parv[i]);
                        ptr += len;
                        cur_len += len;
@@ -95,7 +96,4 @@ ms_operspy(struct Client *client_p, struct Client *source_p,
 
                report_operspy(source_p, parv[1], buffer);
        }
-
-       return 0;
 }
-