From 280c56a7b24dc08b35a1ecd98c8f4b61435d1100 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 27 Mar 2010 13:36:47 -0400 Subject: Added privmsg handlers to users/channels. root commands are coming back. --- irc.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'irc.h') diff --git a/irc.h b/irc.h index 33f25538..b72fdf76 100644 --- a/irc.h +++ b/irc.h @@ -106,8 +106,18 @@ typedef struct irc_user int sendbuf_flags; //struct user *b; + + const struct irc_user_funcs *f; } irc_user_t; +struct irc_user_funcs +{ + gboolean (*privmsg)( irc_user_t *iu, const char *msg ); +}; + +extern const struct irc_user_funcs irc_user_root_funcs; +extern const struct irc_user_funcs irc_user_self_funcs; + typedef enum { IRC_CHANNEL_JOINED = 1, @@ -116,16 +126,25 @@ typedef enum typedef struct irc_channel { irc_t *irc; - int flags; char *name; + char mode[8]; + int flags; + char *topic; char *topic_who; time_t topic_time; - char mode[8]; + GSList *users; struct set *set; + + const struct irc_channel_funcs *f; } irc_channel_t; +struct irc_channel_funcs +{ + gboolean (*privmsg)( irc_channel_t *iu, const char *msg ); +}; + #include "user.h" /* irc.c */ @@ -174,7 +193,7 @@ void irc_send_who( irc_t *irc, GSList *l, const char *channel ); /* irc_user.c */ irc_user_t *irc_user_new( irc_t *irc, const char *nick ); int irc_user_free( irc_t *irc, const char *nick ); -irc_user_t *irc_user_find( irc_t *irc, const char *nick ); +irc_user_t *irc_user_by_name( irc_t *irc, const char *nick ); int irc_user_rename( irc_t *irc, const char *old, const char *new ); gint irc_user_cmp( gconstpointer a_, gconstpointer b_ ); -- cgit v1.2.3