From 03e24016fcfe496622c6b411fd8f3b6ce15ae84e Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 1 Apr 2008 16:12:16 -0500 Subject: [PATCH] Clean these modules up. --- modules/m_list.c | 10 ++++++---- modules/m_services.c | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/m_list.c b/modules/m_list.c index cbc5e9a..f668e73 100644 --- a/modules/m_list.c +++ b/modules/m_list.c @@ -79,16 +79,18 @@ mapi_hfn_list_av1 list_hfnlist[] = { DECLARE_MODULE_AV1(list, _modinit, _moddeinit, list_clist, NULL, list_hfnlist, "$Revision: 3372 $"); +static struct ev_entry *iterate_clients_ev = NULL; + static int _modinit(void) { - rb_event_add("safelist_iterate_clients", safelist_iterate_clients, NULL, 3); + iterate_clients_ev = rb_event_add("safelist_iterate_clients", safelist_iterate_clients, NULL, 3); return 0; } static void _moddeinit(void) { - rb_event_delete(safelist_iterate_clients, NULL); + rb_event_delete(iterate_clients_ev); } static void safelist_check_cliexit(hook_data_client_exit * hdata) @@ -224,7 +226,7 @@ static int mo_list(struct Client *client_p, struct Client *source_p, int parc, c */ static int safelist_sendq_exceeded(struct Client *client_p) { - if (linebuf_len(&client_p->localClient->buf_sendq) > (get_sendq(client_p) / 2)) + if (rb_linebuf_len(&client_p->localClient->buf_sendq) > (get_sendq(client_p) / 2)) return YES; else return NO; @@ -260,7 +262,7 @@ static void safelist_client_instantiate(struct Client *client_p, struct ListClie sendto_one(client_p, form_str(RPL_LISTSTART), me.name, client_p->name); /* pop the client onto the queue for processing */ - dlinkAddAlloc(client_p, &safelisting_clients); + rb_dlinkAddAlloc(client_p, &safelisting_clients); /* give the user some initial data to work with */ safelist_iterate_client(client_p); diff --git a/modules/m_services.c b/modules/m_services.c index 81326bf..539d20d 100644 --- a/modules/m_services.c +++ b/modules/m_services.c @@ -154,6 +154,7 @@ me_rsfnc(struct Client *client_p, struct Client *source_p, struct Client *target_p; struct Client *exist_p; time_t newts, curts; + char note[NICKLEN + 10]; if(!(source_p->flags & FLAGS_SERVICE)) return 0; @@ -237,7 +238,8 @@ me_rsfnc(struct Client *client_p, struct Client *source_p, del_all_accepts(target_p); - rb_note(target_p->localClient->F->fd, "Nick: %s", target_p->name); + rb_snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name); + rb_note(target_p->localClient->F, note); return 0; }