Changeset 6197702 for irc.c


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.c

    r23b29c6 r6197702  
    2929
    3030GSList *irc_connection_list;
     31GSList *irc_plugins;
    3132
    3233static gboolean irc_userping( gpointer _irc, gint fd, b_input_condition cond );
     
    4243        char *host = NULL, *myhost = NULL;
    4344        irc_user_t *iu;
     45        GSList *l;
    4446        set_t *s;
    4547        bee_t *b;
     
    165167        nogaim_init();
    166168       
     169        for( l = irc_plugins; l; l = l->next )
     170        {
     171                irc_plugin_t *p = l->data;
     172                if( p->irc_new )
     173                        p->irc_new( irc );
     174        }
     175       
    167176        return irc;
    168177}
     
    208217void irc_free( irc_t * irc )
    209218{
     219        GSList *l;
     220       
    210221        irc->status |= USTATUS_SHUTDOWN;
    211222       
     
    215226                if( storage_save( irc, NULL, TRUE ) != STORAGE_OK )
    216227                        log_message( LOGLVL_WARNING, "Error while saving settings for user %s", irc->user->nick );
     228       
     229        for( l = irc_plugins; l; l = l->next )
     230        {
     231                irc_plugin_t *p = l->data;
     232                if( p->irc_free )
     233                        p->irc_free( irc );
     234        }
    217235       
    218236        irc_connection_list = g_slist_remove( irc_connection_list, irc );
     
    933951        return SET_INVALID;
    934952}
     953
     954void register_irc_plugin( const struct irc_plugin *p )
     955{
     956        irc_plugins = g_slist_prepend( irc_plugins, (gpointer) p );
     957}
Note: See TracChangeset for help on using the changeset viewer.