Various changes for libratbox.

This commit is contained in:
Jilles Tjoelker 2008-04-01 23:03:14 +02:00
parent 555ac41f14
commit 0e7cb7e6a1
7 changed files with 25 additions and 22 deletions

View file

@ -596,7 +596,7 @@ extern client_t *find_person(const char *);
extern client_t *find_named_person(const char *);
extern client_t *next_client(struct Client *, const char *);
#define accept_message(s, t) ((s) == (t) || (dlinkFind((s), &((t)->localClient->allow_list))))
#define accept_message(s, t) ((s) == (t) || (rb_dlinkFind((s), &((t)->localClient->allow_list))))
extern void del_all_accepts(struct Client *client_p);
extern void dead_link(struct Client *client_p);

View file

@ -50,11 +50,12 @@ static int m_privmsg(struct Client *, struct Client *, int, const char **);
static int m_notice(struct Client *, struct Client *, int, const char **);
static void expire_tgchange(void *unused);
static struct ev_entry *expire_tgchange_event;
static int
modinit(void)
{
eventAddIsh("expire_tgchange", expire_tgchange, NULL, 300);
expire_tgchange_event = rb_event_addish("expire_tgchange", expire_tgchange, NULL, 300);
expire_tgchange(NULL);
return 0;
}
@ -62,7 +63,7 @@ modinit(void)
static void
moddeinit(void)
{
eventDelete(expire_tgchange, NULL);
rb_event_delete(expire_tgchange_event);
}
struct Message privmsg_msgtab = {

View file

@ -731,6 +731,7 @@ static void
set_initial_nick(struct Client *client_p, struct Client *source_p, char *nick)
{
char buf[USERLEN + 1];
char note[NICKLEN + 10];
/* This had to be copied here to avoid problems.. */
source_p->tsinfo = CurrentTime;
@ -740,8 +741,8 @@ set_initial_nick(struct Client *client_p, struct Client *source_p, char *nick)
strcpy(source_p->name, nick);
add_to_client_hash(nick, source_p);
/* fd_desc is long enough */
rb_note(client_p->localClient->F->fd, "Nick: %s", nick);
rb_snprintf(note, sizeof(note), "Nick: %s", nick);
rb_note(client_p->localClient->F, note);
if(source_p->flags & FLAGS_SENTUSER)
{
@ -760,6 +761,7 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
struct Client *target_p;
rb_dlink_node *ptr, *next_ptr;
struct Channel *chptr;
char note[NICKLEN + 10];
int samenick;
if (dosend)
@ -849,8 +851,8 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
rb_dlinkDestroy(ptr, &source_p->on_allow_list);
}
/* fd_desc is long enough */
rb_note(client_p->localClient->F->fd, "Nick: %s", nick);
rb_snprintf(note, sizeof(note), "Nick: %s", nick);
rb_note(client_p->localClient->F, note);
return;
}
@ -1187,7 +1189,7 @@ register_client(struct Client *client_p, struct Client *server,
source_p = make_client(client_p);
user = make_user(source_p);
dlinkAddTail(source_p, &source_p->node, &global_client_list);
rb_dlinkAddTail(source_p, &source_p->node, &global_client_list);
source_p->hopcount = atoi(parv[2]);
source_p->tsinfo = newts;
@ -1271,7 +1273,7 @@ register_client(struct Client *client_p, struct Client *server,
}
if(IsOper(source_p) && !IsService(source_p))
dlinkAddAlloc(source_p, &oper_list);
rb_dlinkAddAlloc(source_p, &oper_list);
SetRemoteClient(source_p);
@ -1280,7 +1282,7 @@ register_client(struct Client *client_p, struct Client *server,
source_p->servptr = server;
dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
rb_dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
/* fake direction */
if(source_p->servptr->from != source_p->from)

View file

@ -422,10 +422,10 @@ ms_server(struct Client *client_p, struct Client *source_p, int parc, const char
SetServer(target_p);
dlinkAddTail(target_p, &target_p->node, &global_client_list);
dlinkAddTailAlloc(target_p, &global_serv_list);
rb_dlinkAddTail(target_p, &target_p->node, &global_client_list);
rb_dlinkAddTailAlloc(target_p, &global_serv_list);
add_to_client_hash(target_p->name, target_p);
dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->servers);
rb_dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->servers);
target_p->serv->nameinfo = scache_connect(target_p->name, target_p->info, IsHidden(target_p));
@ -570,11 +570,11 @@ ms_sid(struct Client *client_p, struct Client *source_p, int parc, const char *p
target_p->servptr = source_p;
SetServer(target_p);
dlinkAddTail(target_p, &target_p->node, &global_client_list);
dlinkAddTailAlloc(target_p, &global_serv_list);
rb_dlinkAddTail(target_p, &target_p->node, &global_client_list);
rb_dlinkAddTailAlloc(target_p, &global_serv_list);
add_to_client_hash(target_p->name, target_p);
add_to_id_hash(target_p->id, target_p);
dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->servers);
rb_dlinkAdd(target_p, &target_p->lnode, &target_p->servptr->serv->servers);
target_p->serv->nameinfo = scache_connect(target_p->name, target_p->info, IsHidden(target_p));

View file

@ -214,7 +214,7 @@ mo_kline(struct Client *client_p, struct Client *source_p,
{
if(kline_queued == 0)
{
eventAddOnce("check_klines", check_klines_event, NULL,
rb_event_addonce("check_klines", check_klines_event, NULL,
ConfigFileEntry.kline_delay);
kline_queued = 1;
}
@ -330,7 +330,7 @@ handle_remote_kline(struct Client *source_p, int tkline_time,
{
if(kline_queued == 0)
{
eventAddOnce("check_klines", check_klines_event, NULL,
rb_event_addonce("check_klines", check_klines_event, NULL,
ConfigFileEntry.kline_delay);
kline_queued = 1;
}

View file

@ -81,14 +81,14 @@ DECLARE_MODULE_AV1(list, _modinit, _moddeinit, list_clist, NULL, list_hfnlist, "
static int _modinit(void)
{
eventAdd("safelist_iterate_clients", safelist_iterate_clients, NULL, 3);
rb_event_add("safelist_iterate_clients", safelist_iterate_clients, NULL, 3);
return 0;
}
static void _moddeinit(void)
{
eventDelete(safelist_iterate_clients, NULL);
rb_event_delete(safelist_iterate_clients, NULL);
}
static void safelist_check_cliexit(hook_data_client_exit * hdata)

View file

@ -380,7 +380,7 @@ quote_splitmode(struct Client *source_p, char *charval)
splitmode = 0;
splitchecking = 0;
eventDelete(check_splitmode, NULL);
rb_event_delete(check_splitmode, NULL);
}
/* ON */
else if(newval == 1)
@ -393,7 +393,7 @@ quote_splitmode(struct Client *source_p, char *charval)
splitchecking = 0;
/* we might be deactivating an automatic splitmode, so pull the event */
eventDelete(check_splitmode, NULL);
rb_event_delete(check_splitmode, NULL);
}
/* AUTO */
else if(newval == 2)