Changeset 6197702 for irc.h


Ignore:
Timestamp:
2010-10-09T18:41:19Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d150a9d
Parents:
23b29c6 (diff), 27b407f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging OTR branch. It's more or less a plugin if you enable it, and
otherwise a no-op. DO NOT INSTALL THIS ON PUBLIC SERVERS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.h

    r23b29c6 r6197702  
    2828
    2929#define IRC_MAX_LINE 512
    30 #define IRC_MAX_ARGS 8
     30#define IRC_MAX_ARGS 16
    3131
    3232#define IRC_LOGIN_TIMEOUT 60
     
    8686        gint login_source_id; /* To slightly delay some events at login time. */
    8787       
     88        struct otr *otr; /* OTR state and book keeping, used by the OTR plugin.
     89                            TODO: Some mechanism for plugindata. */
     90       
    8891        struct bee *b;
    8992} irc_t;
     
    9396        /* Replaced with iu->last_channel IRC_USER_PRIVATE = 1, */
    9497        IRC_USER_AWAY = 2,
     98       
     99        IRC_USER_OTR_ENCRYPTED = 0x10000,
     100        IRC_USER_OTR_TRUSTED   = 0x20000,
    95101} irc_user_flags_t;
    96102
     
    214220} irc_channel_del_user_type_t;
    215221
     222/* These are a glued a little bit to the core/bee layer and a little bit to
     223   IRC. The first user is OTR, and I guess at some point we'll get to shape
     224   this a little bit more as other uses come up. */
     225typedef struct irc_plugin
     226{
     227        /* Called at the end of irc_new(). Can be used to add settings, etc. */
     228        gboolean (*irc_new)( irc_t *irc );
     229        /* At the end of irc_free(). */
     230        void (*irc_free)( irc_t *irc );
     231       
     232        /* Problem with the following two functions is ordering if multiple
     233           plugins are handling them. Let's keep fixing that problem for
     234           whenever it becomes important. */
     235       
     236        /* Called by bee_irc_user_privmsg_cb(). Return NULL if you want to
     237           abort sending the msg. */
     238        char* (*filter_msg_out)( irc_user_t *iu, char *msg, int flags );
     239        /* Called by bee_irc_user_msg(). Return NULL if you swallowed the
     240           message and don't want anything to go to the user. */
     241        char* (*filter_msg_in)( irc_user_t *iu, char *msg, int flags );
     242       
     243        /* From storage.c functions. Ideally these should not be used
     244           and instead data should be stored in settings which will get
     245           saved automatically. Consider these deprecated! */
     246        void (*storage_load)( irc_t *irc );
     247        void (*storage_save)( irc_t *irc );
     248        void (*storage_remove)( const char *nick );
     249} irc_plugin_t;
     250
     251extern GSList *irc_plugins; /* struct irc_plugin */
     252
    216253/* irc.c */
    217254extern GSList *irc_connection_list;
     
    238275
    239276void irc_umode_set( irc_t *irc, const char *s, gboolean allow_priv );
     277
     278void register_irc_plugin( const struct irc_plugin *p );
    240279
    241280/* irc_channel.c */
Note: See TracChangeset for help on using the changeset viewer.