diff --git a/modules/m_cap.c b/modules/m_cap.c index e88b8fad..856a7ad6 100644 --- a/modules/m_cap.c +++ b/modules/m_cap.c @@ -42,6 +42,7 @@ #include "s_serv.h" #include "s_user.h" #include "send.h" +#include "s_conf.h" typedef int (*bqcmp)(const void *, const void *); @@ -210,6 +211,18 @@ clicap_generate(struct Client *source_p, const char *subcmd, int flags, int clea continue; } + if (clicap_list[i].cap_serv == CLICAP_SASL) + { + struct Client *agent_p = NULL; + + if (!ConfigFileEntry.sasl_service) + continue; + + agent_p = find_named_client(ConfigFileEntry.sasl_service); + if (agent_p == NULL || !IsService(agent_p)) + continue; + } + /* \r\n\0, possible "-~=", space, " *" */ if(buflen + clicap_list[i].namelen >= BUFSIZE - 10) { @@ -411,6 +424,24 @@ cap_req(struct Client *source_p, const char *arg) break; } + if (cap->cap_serv == CLICAP_SASL) + { + struct Client *agent_p = NULL; + + if (!ConfigFileEntry.sasl_service) + { + finished = 0; + break; + } + + agent_p = find_named_client(ConfigFileEntry.sasl_service); + if (agent_p == NULL || !IsService(agent_p)) + { + finished = 0; + break; + } + } + if(cap->flags & CLICAP_FLAGS_STICKY) { strcat(pbuf[i], "=");