diff --git a/include/client.h b/include/client.h index caa05192..943098e6 100644 --- a/include/client.h +++ b/include/client.h @@ -609,4 +609,7 @@ extern void close_connection(struct Client *); extern void init_uid(void); extern char *generate_uid(void); +void allocate_away(struct Client *); +void free_away(struct Client *); + #endif /* INCLUDED_client_h */ diff --git a/src/client.c b/src/client.c index c4ade72a..e035c0cf 100644 --- a/src/client.c +++ b/src/client.c @@ -1936,6 +1936,23 @@ free_user(struct User *user, struct Client *client_p) } } +void +allocate_away(struct Client *client_p) +{ + if(client_p->user->away == NULL) + client_p->user->away = rb_bh_alloc(away_heap); +} + + +void +free_away(struct Client *client_p) +{ + if(client_p->user->away != NULL) { + rb_bh_free(away_heap, client_p->user->away); + client_p->user->away = NULL; + } +} + void init_uid(void) {