]> jfr.im git - irc/atheme/atheme-contrib-modules.git/commitdiff
ircd_loveserv.c: a few fixups
authorAaron Jones <redacted>
Sat, 30 Jun 2018 16:30:13 +0000 (16:30 +0000)
committerAaron Jones <redacted>
Sat, 30 Jun 2018 16:30:13 +0000 (16:30 +0000)
- Make private variables compilation-unit-static
- Apply atheme/atheme@e1df27b9fbecc2267baa

ircd_loveserv.c

index 089cc4e6caf9cc90fc171c4a95b959ec4bfcec09..0a6333cd969fc69fb5c3eb847042a67ab5a22bc8 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "atheme-compat.h"
 
-service_t *loveserv;
+static service_t *loveserv = NULL;
 
 static void
 _ls_admirer(sourceinfo_t *si, int parc, char *parv[])
@@ -31,8 +31,6 @@ _ls_admirer(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "You have a secret admirer ;)");
 }
 
-command_t ls_admirer = { "ADMIRER", "Tell somebody they have a secret admirer.", AC_NONE, 1, _ls_admirer, { .path = "" } };
-
 static void
 _ls_rose(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -55,8 +53,6 @@ _ls_rose(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s has sent you a pretty rose: \00303--<--<--<{\00304@", si->su->nick);
 }
 
-command_t ls_rose = { "ROSE", "Sends a rose to somebody.", AC_NONE, 1, _ls_rose, { .path = "" } };
-
 static void
 _ls_chocolate(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -79,8 +75,6 @@ _ls_chocolate(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s would like you to have this YUMMY box of chocolates.", si->su->nick);
 }
 
-command_t ls_chocolate = { "CHOCOLATE", "Sends chocolates to somebody.", AC_NONE, 1, _ls_chocolate, { .path = "" } };
-
 static void
 _ls_candy(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -103,8 +97,6 @@ _ls_candy(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s would like you to have this bag of heart-shaped candies.", si->su->nick);
 }
 
-command_t ls_candy = { "CANDY", "Sends a bag of candy to somebody.", AC_NONE, 1, _ls_candy, { .path = "" } };
-
 static void
 _ls_hug(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -127,8 +119,6 @@ _ls_hug(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s has sent you a \002BIG WARM HUG\002.", si->su->nick);
 }
 
-command_t ls_hug = { "HUG", "Reach out and hug somebody.", AC_NONE, 1, _ls_hug, { .path = "" } };
-
 static void
 _ls_kiss(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -151,8 +141,6 @@ _ls_kiss(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s has sent you a \00304kiss\003.", si->su->nick);
 }
 
-command_t ls_kiss = { "KISS", "Kiss somebody.", AC_NONE, 1, _ls_kiss, { .path = "" } };
-
 static void
 _ls_lovenote(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -176,8 +164,6 @@ _ls_lovenote(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s has sent you a love-note which reads: %s", si->su->nick, note);
 }
 
-command_t ls_lovenote = { "LOVENOTE", "Sends a lovenote to somebody.", AC_NONE, 2, _ls_lovenote, { .path = "" } };
-
 static void
 _ls_apology(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -201,8 +187,6 @@ _ls_apology(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s would like to apologize for: %s", si->su->nick, note);
 }
 
-command_t ls_apology = { "APOLOGY", "Sends an apology to somebody.", AC_NONE, 2, _ls_apology, { .path = "" } };
-
 static void
 _ls_thankyou(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -226,8 +210,6 @@ _ls_thankyou(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s would like to thank you for: %s", si->su->nick, note);
 }
 
-command_t ls_thankyou = { "THANKYOU", "Sends a thank-you note to somebody.", AC_NONE, 2, _ls_thankyou, { .path = "" } };
-
 static void
 _ls_spank(sourceinfo_t *si, int parc, char *parv[])
 {
@@ -250,8 +232,6 @@ _ls_spank(sourceinfo_t *si, int parc, char *parv[])
        notice(loveserv->nick, target, "%s has given you a virtual playful spanking.", si->su->nick);
 }
 
-command_t ls_spank = { "SPANK", "Gives somebody a spanking.", AC_NONE, 1, _ls_spank, { .path = "" } };
-
 static void
 _ls_chocobo(sourceinfo_t *si, int parc, char *parv[])  /* silly */
 {
@@ -274,16 +254,119 @@ _ls_chocobo(sourceinfo_t *si, int parc, char *parv[])    /* silly */
        notice(loveserv->nick, target, "%s would like you to have this chocobo. \00308Kweh!\003", si->su->nick);
 }
 
-command_t ls_chocobo = { "CHOCOBO", "Sends a chocobo to somebody.", AC_NONE, 1, _ls_chocobo, { .path = "" } };
-
 static void
 _ls_help(sourceinfo_t *si, int parc, char *parv[])
 {
         command_help(si, si->service->commands);
 }
 
-command_t ls_help = { "HELP", "Displays contextual help information.",
-                                AC_NONE, 1, _ls_help, { .path = "help" } };
+static command_t ls_admirer = {
+       "ADMIRER",
+       N_("Tell somebody they have a secret admirer."),
+       AC_NONE,
+       1,
+       &_ls_admirer,
+       { .path = "" },
+};
+
+static command_t ls_rose = {
+       "ROSE",
+       N_("Sends a rose to somebody."),
+       AC_NONE,
+       1,
+       &_ls_rose,
+       { .path = "" },
+};
+
+static command_t ls_chocolate = {
+       "CHOCOLATE",
+       N_("Sends chocolates to somebody."),
+       AC_NONE,
+       1,
+       &_ls_chocolate,
+       { .path = "" },
+};
+
+static command_t ls_candy = {
+       "CANDY",
+       N_("Sends a bag of candy to somebody."),
+       AC_NONE,
+       1,
+       &_ls_candy,
+       { .path = "" },
+};
+
+static command_t ls_hug = {
+       "HUG",
+       N_("Reach out and hug somebody."),
+       AC_NONE,
+       1,
+       &_ls_hug,
+       { .path = "" },
+};
+
+static command_t ls_kiss = {
+       "KISS",
+       N_("Kiss somebody."),
+       AC_NONE,
+       1,
+       &_ls_kiss,
+       { .path = "" },
+};
+
+static command_t ls_lovenote = {
+       "LOVENOTE",
+       N_("Sends a lovenote to somebody."),
+       AC_NONE,
+       2,
+       &_ls_lovenote,
+       { .path = "" },
+};
+
+static command_t ls_apology = {
+       "APOLOGY",
+       N_("Sends an apology to somebody."),
+       AC_NONE,
+       2,
+       &_ls_apology,
+       { .path = "" },
+};
+
+static command_t ls_thankyou = {
+       "THANKYOU",
+       N_("Sends a thank-you note to somebody."),
+       AC_NONE,
+       2,
+       &_ls_thankyou,
+       { .path = "" },
+};
+
+static command_t ls_spank = {
+       "SPANK",
+       N_("Gives somebody a spanking."),
+       AC_NONE,
+       1,
+       &_ls_spank,
+       { .path = "" },
+};
+
+static command_t ls_chocobo = {
+       "CHOCOBO",
+       N_("Sends a chocobo to somebody."),
+       AC_NONE,
+       1,
+       &_ls_chocobo,
+       { .path = "" },
+};
+
+static command_t ls_help = {
+       "HELP",
+       N_("Displays contextual help information."),
+       AC_NONE,
+       1,
+       &_ls_help,
+       { .path = "help" },
+};
 
 static void
 mod_init(module_t *const restrict m)