]> jfr.im git - solanum.git/blobdiff - modules/m_cap.c
Add a cap_change hook
[solanum.git] / modules / m_cap.c
index 30fb0b909fc1c0ab229dadf1354212d62e89c93c..62a930d88e3637f6b9dd249e616208cb1cb175de 100644 (file)
@@ -312,6 +312,7 @@ cap_req(struct Client *source_p, const char *arg)
        int i = 0;
        int capadd = 0, capdel = 0;
        int finished = 0, negate;
+       hook_data_cap_change hdata;
 
        if(!IsRegistered(source_p))
                source_p->flags |= FLAGS_CLICAP;
@@ -399,8 +400,15 @@ cap_req(struct Client *source_p, const char *arg)
                sendto_one(source_p, "%s%s%s", buf_prefix, str_final, buf_list[0]);
        }
 
+       hdata.client = source_p;
+       hdata.oldcaps = source_p->localClient->caps;
+       hdata.add = capadd;
+       hdata.del = capdel;
+
        source_p->localClient->caps |= capadd;
        source_p->localClient->caps &= ~capdel;
+
+       call_hook(h_cap_change, &hdata);
 }
 
 static struct clicap_cmd