diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-07-04 21:29:43 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-07-04 21:29:43 +0000 |
commit | 1f13d094d7326b589c3be69c878c7c1650be1312 (patch) | |
tree | bf73772ced9605edeaf0b8f668f03313a65194b0 | |
parent | 268c8181dbcc476053f6db6033d9943da336569f (diff) |
- find_accept(): solved XXX
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2364 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | include/client.h | 3 | ||||
-rw-r--r-- | modules/m_accept.c | 4 | ||||
-rw-r--r-- | src/client.c | 7 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/client.h b/include/client.h index a5ba80c..66227aa 100644 --- a/include/client.h +++ b/include/client.h @@ -454,7 +454,8 @@ extern dlink_list oper_list; /* our opers, duplicated in local_client_l extern int accept_message(struct Client *, struct Client *); extern unsigned int idle_time_get(const struct Client *, const struct Client *); extern struct split_nuh_item *find_accept(const char *, const char *, - const char *, struct Client *, int); + const char *, struct Client *, + int (*)(const char *, const char *)); extern void del_accept(struct split_nuh_item *, struct Client *); extern void del_all_accepts(struct Client *); extern void exit_client(struct Client *, struct Client *, const char *); diff --git a/modules/m_accept.c b/modules/m_accept.c index 84cec49..7815083 100644 --- a/modules/m_accept.c +++ b/modules/m_accept.c @@ -151,7 +151,7 @@ m_accept(struct Client *client_p, struct Client *source_p, split_nuh(&nuh); - if ((accept_p = find_accept(nick, user, host, source_p, 0)) == NULL) + if ((accept_p = find_accept(nick, user, host, source_p, irccmp)) == NULL) { sendto_one(source_p, form_str(ERR_ACCEPTNOT), me.name, source_p->name, nick, user, host); @@ -181,7 +181,7 @@ m_accept(struct Client *client_p, struct Client *source_p, split_nuh(&nuh); - if ((accept_p = find_accept(nick, user, host, source_p, 0)) != NULL) + if ((accept_p = find_accept(nick, user, host, source_p, irccmp)) != NULL) { sendto_one(source_p, form_str(ERR_ACCEPTEXIST), me.name, source_p->name, nick, user, host); diff --git a/src/client.c b/src/client.c index 2fc453d..25ee4c8 100644 --- a/src/client.c +++ b/src/client.c @@ -1107,11 +1107,10 @@ del_accept(struct split_nuh_item *accept_p, struct Client *client_p) struct split_nuh_item * find_accept(const char *nick, const char *user, - const char *host, struct Client *client_p, int do_match) + const char *host, struct Client *client_p, + int (*cmpfunc)(const char *, const char *)) { dlink_node *ptr = NULL; - /* XXX We wouldn't need that if match() would return 0 on match */ - int (*cmpfunc)(const char *, const char *) = do_match ? match : irccmp; DLINK_FOREACH(ptr, client_p->localClient->acceptlist.head) { @@ -1140,7 +1139,7 @@ accept_message(struct Client *source, dlink_node *ptr = NULL; if (source == target || find_accept(source->name, source->username, - source->host, target, 1)) + source->host, target, match)) return 1; if (HasUMode(target, UMODE_SOFTCALLERID)) |