]> jfr.im git - solanum.git/blobdiff - modules/m_time.c
Add umode +I to allow users to hide their idle time (#220)
[solanum.git] / modules / m_time.c
index d3392cb8a02767558d110796fc333656414ce8f7..268e40f601aa34cd725c24da4940636cf17161db 100644 (file)
 #include "modules.h"
 #include "packet.h"
 
-static int m_time(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static char *date(void);
 static const char time_desc[] =
        "Provides the TIME command to show the current server time";
 
+static void m_time(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static char *date(void);
+
 struct Message time_msgtab = {
        "TIME", 0, 0, 0, 0,
        {mg_unreg, {m_time, 0}, {m_time, 2}, mg_ignore, mg_ignore, {m_time, 0}}
@@ -62,7 +63,7 @@ static const char *weekdays[] = {
  * m_time
  *      parv[1] = servername
  */
-static int
+static void
 m_time(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        /* this is not rate limited, so end the grace period */
@@ -72,8 +73,6 @@ m_time(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
        if(hunt_server(client_p, source_p, ":%s TIME :%s", 1, parc, parv) == HUNTED_ISME)
                sendto_one_numeric(source_p, RPL_TIME, form_str(RPL_TIME),
                                   me.name, date());
-
-       return 0;
 }
 
 /* date()
@@ -112,7 +111,7 @@ date(void)
        sprintf(buf, "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u",
                   weekdays[lt->tm_wday], months[lt->tm_mon], lt->tm_mday,
                   lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec,
-                  plus, minswest / 60, minswest % 60);
+                  plus, (unsigned int)minswest / 60, (unsigned int)minswest % 60);
 
        return buf;
 }