diff --git a/include/s_serv.h b/include/s_serv.h index 04193cb7e..4f697dba7 100644 --- a/include/s_serv.h +++ b/include/s_serv.h @@ -56,8 +56,8 @@ extern struct CapabilityIndex *cli_capindex; #define CLICAP_FLAGS_REQACK 0x002 struct ClientCapability { - int (*visible)(void); /* whether or not to display the capability. set to NULL or true return value = displayed */ - const char *(*data)(void); /* any custom data for the capability. set to NULL or return NULL = no data */ + int (*visible)(struct Client *); /* whether or not to display the capability. set to NULL or true return value = displayed */ + const char *(*data)(struct Client *); /* any custom data for the capability. set to NULL or return NULL = no data */ unsigned int flags; }; diff --git a/modules/m_cap.c b/modules/m_cap.c index 167e22a9d..bd1c46f5e 100644 --- a/modules/m_cap.c +++ b/modules/m_cap.c @@ -60,7 +60,7 @@ DECLARE_MODULE_AV1(cap, NULL, NULL, cap_clist, NULL, NULL, "$Revision: 676 $"); #define HasCapabilityFlag(c, f) (c->ownerdata != NULL && (((struct ClientCapability *)c->ownerdata)->flags & (f)) == f) static inline int -clicap_visible(const struct CapabilityEntry *cap) +clicap_visible(struct Client *client_p, const struct CapabilityEntry *cap) { struct ClientCapability *clicap; @@ -75,7 +75,7 @@ clicap_visible(const struct CapabilityEntry *cap) if (clicap->visible == NULL) return 1; - return clicap->visible(); + return clicap->visible(client_p); } /* clicap_find() @@ -188,12 +188,12 @@ clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clea continue; } - if (!clicap_visible(entry)) + if (!clicap_visible(source_p, entry)) continue; caplen = strlen(entry->cap); if (!flags && (source_p->flags & FLAGS_CLICAP_DATA) && clicap != NULL && clicap->data != NULL) - data = clicap->data(); + data = clicap->data(source_p); if (data != NULL) caplen += strlen(data) + 1; @@ -374,7 +374,7 @@ cap_req(struct Client *source_p, const char *arg) } else { - if (!clicap_visible(cap)) + if (!clicap_visible(source_p, cap)) { finished = 0; break; diff --git a/modules/m_sasl.c b/modules/m_sasl.c index 1faf8b1a6..f94ddacdb 100644 --- a/modules/m_sasl.c +++ b/modules/m_sasl.c @@ -81,7 +81,7 @@ mapi_hfn_list_av1 sasl_hfnlist[] = { }; static int -sasl_visible(void) +sasl_visible(struct Client *client_p) { struct Client *agent_p = NULL; @@ -92,7 +92,7 @@ sasl_visible(void) } static const char * -sasl_data(void) +sasl_data(struct Client *client_p) { return *mechlist_buf != 0 ? mechlist_buf : NULL; }