X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/cbeab4bc340b7b3f4fbf424ff327758defb9598a..ea41b24fd4807e3565bf5f8f293e2efc4c20b62d:/modules/m_capab.c diff --git a/modules/m_capab.c b/modules/m_capab.c index c2b49609..56732e23 100644 --- a/modules/m_capab.c +++ b/modules/m_capab.c @@ -31,8 +31,10 @@ #include "parse.h" #include "modules.h" -static int mr_capab(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static int me_gcap(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static const char capab_desc[] = "Provides the commands used for server-to-server capability negotiation"; + +static void mr_capab(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static void me_gcap(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message capab_msgtab = { "CAPAB", 0, 0, 0, 0, @@ -44,13 +46,14 @@ struct Message gcap_msgtab = { }; mapi_clist_av1 capab_clist[] = { &capab_msgtab, &gcap_msgtab, NULL }; -DECLARE_MODULE_AV1(capab, NULL, NULL, capab_clist, NULL, NULL, "$Revision: 1295 $"); + +DECLARE_MODULE_AV2(capab, NULL, NULL, capab_clist, NULL, NULL, NULL, NULL, capab_desc); /* * mr_capab - CAPAB message handler * parv[1] = space-separated list of capabilities */ -static int +static void mr_capab(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { int i; @@ -59,16 +62,16 @@ mr_capab(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source /* ummm, this shouldn't happen. Could argue this should be logged etc. */ if(client_p->localClient == NULL) - return 0; + return; if(client_p->user) - return 0; + return; /* CAP_TS6 is set in PASS, so is valid.. */ if((client_p->localClient->caps & ~CAP_TS6) != 0) { exit_client(client_p, client_p, client_p, "CAPAB received twice"); - return 0; + return; } else client_p->localClient->caps |= CAP_CAP; @@ -82,11 +85,9 @@ mr_capab(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source for (s = rb_strtok_r(t, " ", &p); s; s = rb_strtok_r(NULL, " ", &p)) client_p->localClient->caps |= capability_get(serv_capindex, s, NULL); } - - return 0; } -static int +static void me_gcap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { @@ -95,7 +96,7 @@ me_gcap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_ char *p; if(!IsServer(source_p)) - return 0; + return; /* already had GCAPAB?! */ if(!EmptyString(source_p->serv->fullcaps)) @@ -108,6 +109,4 @@ me_gcap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_ for (s = rb_strtok_r(t, " ", &p); s; s = rb_strtok_r(NULL, " ", &p)) source_p->serv->caps |= capability_get(serv_capindex, s, NULL); - - return 0; }