Changeset 6197702 for storage.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
  • storage.c

    r23b29c6 r6197702  
    115115                status = st->load(irc, password);
    116116                if (status == STORAGE_OK)
     117                {
     118                        GSList *l;
     119                        for( l = irc_plugins; l; l = l->next )
     120                        {
     121                                irc_plugin_t *p = l->data;
     122                                if( p->storage_load )
     123                                        p->storage_load( irc );
     124                        }
    117125                        return status;
     126                }
    118127               
    119128                if (status != STORAGE_NO_SUCH_USER)
     
    127136{
    128137        storage_status_t st;
     138        GSList *l;
    129139       
    130140        if (password != NULL) {
     
    140150        st = ((storage_t *)global.storage->data)->save(irc, overwrite);
    141151       
     152        for( l = irc_plugins; l; l = l->next )
     153        {
     154                irc_plugin_t *p = l->data;
     155                if( p->storage_save )
     156                        p->storage_save( irc );
     157        }
     158       
    142159        if (password != NULL) {
    143160                irc_setpass(irc, NULL);
     
    151168        GList *gl;
    152169        storage_status_t ret = STORAGE_OK;
     170        gboolean ok = FALSE;
     171        GSList *l;
    153172       
    154173        /* Remove this account from all storage backends. If this isn't
     
    160179
    161180                status = st->remove(nick, password);
     181                ok |= status == STORAGE_OK;
    162182                if (status != STORAGE_NO_SUCH_USER && status != STORAGE_OK)
    163183                        ret = status;
    164184        }
     185       
     186        /* If at least one succeeded, remove plugin data. */
     187        if( ok )
     188                for( l = irc_plugins; l; l = l->next )
     189                {
     190                        irc_plugin_t *p = l->data;
     191                        if( p->storage_remove )
     192                                p->storage_remove( nick );
     193                }
    165194       
    166195        return ret;
Note: See TracChangeset for help on using the changeset viewer.