Skip to content

Commit ab3c84b

Browse files
committed
Bump modules that use the user_identify hook for struct change
This hook now has its own structure as a parameter, passing the user as before but also the service that logged them in
1 parent fd48889 commit ab3c84b

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

‎src/gen_vhostonreg.c‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ user_add_host(myuser_t *mu)
1818
int maxlen1, i;
1919
char newhost[COMPAT_HOSTLEN + 1];
2020
const char *p;
21+
mowgli_node_t *n;
2122
bool invalidchar = false;
2223

2324
maxlen1 = COMPAT_HOSTLEN - 1 - strlen(me.hidehostsuffix);
@@ -55,6 +56,9 @@ user_add_host(myuser_t *mu)
5556
mowgli_strlcat(newhost, me.hidehostsuffix, sizeof newhost);
5657

5758
metadata_add(mu, "private:usercloak", newhost);
59+
60+
MOWGLI_ITER_FOREACH(n, mu->logins.head)
61+
do_sethost(n->data, newhost);
5862
}
5963

6064
static void
@@ -68,19 +72,27 @@ handle_verify_register(hook_user_req_t *req)
6872
return;
6973

7074
user_add_host(mu);
71-
72-
MOWGLI_ITER_FOREACH(n, mu->logins.head)
73-
{
74-
u = n->data;
75-
hook_call_user_identify(u); /* XXX */
76-
}
7775
}
7876

77+
#if (CURRENT_ABI_REVISION >= 730000)
78+
static void
79+
hook_user_identify(struct hook_user_identify *hdata)
80+
{
81+
user_t *u = hdata->u;
82+
#else
7983
static void
8084
hook_user_identify(user_t *u)
8185
{
86+
#endif
87+
if (me.hidehostsuffix == NULL)
88+
return;
89+
90+
/* if they have not completed verification, don't do anything */
91+
if (u->myuser->flags & MU_WAITAUTH)
92+
return;
93+
8294
/* if they have an existing cloak, don't do anything */
83-
if ((metadata_find(u->myuser, "private:usercloak")) || (me.hidehostsuffix == NULL))
95+
if ((metadata_find(u->myuser, "private:usercloak")) != NULL)
8496
return;
8597

8698
/* they do not, add one. */

‎src/ns_ajoin.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,16 @@ ns_cmd_ajoin(sourceinfo_t *si, int parc, char *parv[])
176176
}
177177
}
178178

179+
#if (CURRENT_ABI_REVISION >= 730000)
180+
static void
181+
ajoin_on_identify(struct hook_user_identify *hdata)
182+
{
183+
user_t *u = hdata->u;
184+
#else
179185
static void
180186
ajoin_on_identify(user_t *u)
181187
{
188+
#endif
182189
myuser_t *mu = u->myuser;
183190
metadata_t *md;
184191
char buf[512];
@@ -216,7 +223,6 @@ static command_t ns_ajoin = {
216223
static void
217224
mod_init(module_t *const restrict m)
218225
{
219-
hook_add_event("user_identify");
220226
hook_add_user_identify(ajoin_on_identify);
221227

222228
service_named_bind_command("nickserv", &ns_ajoin);

0 commit comments

Comments
 (0)