diff options
Diffstat (limited to 'irc.h')
| -rw-r--r-- | irc.h | 40 | 
1 files changed, 34 insertions, 6 deletions
| @@ -26,6 +26,14 @@  #ifndef _IRC_H  #define _IRC_H +#ifndef CONFIG +#include "config.h" +#endif + +#ifdef WITH_GNUTLS +# include <gnutls/gnutls.h> +#endif +  #define IRC_MAX_LINE 512  #define IRC_MAX_ARGS 16  #define IRC_WORD_WRAP 425 @@ -51,6 +59,7 @@ typedef enum {  	                           Currently just blocks irc_vawrite(). */  	USTATUS_CAP_PENDING = 16,  	USTATUS_SASL_PLAIN_PENDING = 32, +	USTATUS_SASL_AUTHENTICATED = 64,  	/* Not really status stuff, but other kinds of flags: For slightly  	   better password security, since the only way to send passwords @@ -73,6 +82,7 @@ typedef enum {  	CAP_EXTENDED_JOIN = (1 << 2),  	CAP_AWAY_NOTIFY = (1 << 3),  	CAP_USERHOST_IN_NAMES = (1 << 4), +	CAP_SERVER_TIME = (1 << 5),  } irc_cap_flag_t;  struct irc_user; @@ -89,6 +99,13 @@ typedef struct irc {  	struct irc_user *root;  	struct irc_user *user; +#ifdef WITH_GNUTLS +	int  ssl; +	char *certfp; + +	gnutls_session_t ssl_session; +#endif +  	char *password; /* HACK: Used to save the user's password, but before  	                   logging in, this may contain a password we should  	                   send to identify after USER/NICK are received. */ @@ -108,6 +125,7 @@ typedef struct irc {  	gint w_watch_source_id;  	gint ping_source_id;  	gint login_source_id; /* To slightly delay some events at login time. */ +	gint save_source_id;  	struct otr *otr; /* OTR state and book keeping, used by the OTR plugin.  	                    TODO: Some mechanism for plugindata. */ @@ -199,10 +217,12 @@ struct irc_channel_funcs {  };  typedef enum { -	IRC_CHANNEL_USER_OP = 1, -	IRC_CHANNEL_USER_HALFOP = 2, -	IRC_CHANNEL_USER_VOICE = 4, -	IRC_CHANNEL_USER_NONE = 8, +	IRC_CHANNEL_USER_OWNER = 1, +	IRC_CHANNEL_USER_ADMIN = 2, +	IRC_CHANNEL_USER_OP = 4, +	IRC_CHANNEL_USER_HALFOP = 8, +	IRC_CHANNEL_USER_VOICE = 16, +	IRC_CHANNEL_USER_NONE = 32,  } irc_channel_user_flags_t;  typedef struct irc_channel_user { @@ -223,7 +243,7 @@ typedef enum {  struct irc_control_channel {  	irc_control_channel_type_t type;  	struct bee_group *group; -	struct account *account; +	GSList *account;  	struct prpl *protocol;  	char modes[5];  }; @@ -306,6 +326,7 @@ struct irc_channel *irc_channel_with_user(irc_t *irc, irc_user_t *iu);  int irc_channel_set_topic(irc_channel_t *ic, const char *topic, const irc_user_t *who);  void irc_channel_user_set_mode(irc_channel_t *ic, irc_user_t *iu, irc_channel_user_flags_t flags);  void irc_channel_set_mode(irc_channel_t *ic, const char *s); +struct account;  void irc_channel_auto_joins(irc_t *irc, struct account *acc);  void irc_channel_printf(irc_channel_t *ic, char *format, ...);  gboolean irc_channel_name_ok(const char *name); @@ -313,9 +334,10 @@ void irc_channel_name_strip(char *name);  int irc_channel_name_cmp(const char *a_, const char *b_);  char *irc_channel_name_gen(irc_t *irc, const char *name);  gboolean irc_channel_name_hint(irc_channel_t *ic, const char *name); -void irc_channel_update_ops(irc_channel_t *ic, char *value); +void irc_channel_update_ops(irc_channel_t *ic, char *ops, char *ops_mode);  char irc_channel_user_get_prefix(irc_channel_user_t *icu);  char *set_eval_irc_channel_ops(struct set *set, char *value); +char *set_eval_irc_channel_ops_mode(struct set *set, char *value);  gboolean irc_channel_wants_user(irc_channel_t *ic, irc_user_t *iu);  /* irc_commands.c */ @@ -340,6 +362,12 @@ void irc_send_who(irc_t *irc, GSList *l, const char *channel);  void irc_send_msg(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix);  void irc_send_msg_raw(irc_user_t *iu, const char *type, const char *dst, const char *msg);  void irc_send_msg_f(irc_user_t *iu, const char *type, const char *dst, const char *format, ...) G_GNUC_PRINTF(4, 5); + +void irc_send_tagged_msg(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix, const char *tags); +void irc_send_tagged_msg_raw(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *tags); +void irc_send_tagged_msg_f(irc_user_t *iu, const char *type, const char *dst, const char *tags, const char *format, ...) G_GNUC_PRINTF(5, 6); +void irc_send_tagged_msg_vf(irc_user_t *iu, const char *type, const char *dst, const char *tags, const char *format, va_list params); +  void irc_send_nick(irc_user_t *iu, const char *new_nick);  void irc_send_channel_user_mode_diff(irc_channel_t *ic, irc_user_t *iu,                                       irc_channel_user_flags_t old_flags, irc_channel_user_flags_t new_flags); | 
