9 static int mo_oaccept(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[]);
11 struct Message oaccept_msgtab
= {
12 "OACCEPT", 0, 0, 0, MFLG_SLOW
,
13 {mg_unreg
, mg_not_oper
, mg_ignore
, mg_ignore
, mg_ignore
, {mo_oaccept
, 2}}
16 mapi_clist_av1 oaccept_clist
[] = { &oaccept_msgtab
, NULL
};
18 DECLARE_MODULE_AV1(oaccept
, NULL
, NULL
, oaccept_clist
, NULL
, NULL
, "$Id $");
21 mo_oaccept(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
24 struct DictionaryIter iter
;
25 struct Client
*target_p
;
26 char *text
= rb_strdup("");
28 if(!(target_p
= find_client(parv
[1])))
30 sendto_one(source_p
, form_str(ERR_NOSUCHNICK
), parv
[1]);
34 rb_sprintf(text
, "O%s", source_p
->id
);
36 /* Don't allow someone to pointlessly fill up someone's metadata
37 * with identical OACCEPT entries. */
38 DICTIONARY_FOREACH(md
, &iter
, target_p
->user
->metadata
)
40 if(!strcmp(md
->value
, "OACCEPT") && !strcmp(md
->name
, text
))
42 sendto_one_notice(source_p
, ":You're already on %s's OACCEPT list", target_p
->name
);
47 user_metadata_add(target_p
, text
, "OACCEPT", 1);
49 sendto_wallops_flags(UMODE_WALLOP
, &me
,
50 "OACCEPT called for %s by %s!%s@%s",
52 source_p
->name
, source_p
->username
, source_p
->host
);
53 sendto_server(NULL
, NULL
, NOCAPS
, NOCAPS
,
54 ":%s WALLOPS :OACCEPT called for %s by %s!%s@%s",
55 me
.name
, target_p
->name
, source_p
->name
, source_p
->username
,