Changeset be999a5 for storage.c


Ignore:
Timestamp:
2010-08-23T23:12:24Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
ad2d8bc
Parents:
237eadd (diff), eb6df6a (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:

First step in this merge. Mostly a bzr merge and then a cleanup of conflicts
and parts I want to/have to redo (because of ui-fix).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage.c

    r237eadd rbe999a5  
    2828#define BITLBEE_CORE
    2929#include "bitlbee.h"
     30#include "otr.h"
    3031
    3132extern storage_t storage_text;
     
    114115
    115116                status = st->load(irc, password);
    116                 if (status == STORAGE_OK)
     117                if (status == STORAGE_OK) {
     118                        otr_load(irc);
    117119                        return status;
    118                
     120                }
    119121                if (status != STORAGE_NO_SUCH_USER)
    120122                        return status;
     
    137139                return STORAGE_NO_SUCH_USER;
    138140        }
    139        
     141
     142        otr_save(irc);
    140143        st = ((storage_t *)global.storage->data)->save(irc, overwrite);
    141144       
     
    163166                        ret = status;
    164167        }
     168        if (ret == STORAGE_OK) {
     169                otr_remove(nick);
     170        }
    165171       
    166172        return ret;
     
    176182        storage_t *primary_storage = gl->data;
    177183        irc_t *irc;
    178 
     184       
    179185        /* First, try to rename in the current write backend, assuming onick
    180186         * is stored there */
    181187        status = primary_storage->rename(onick, nnick, password);
    182         if (status != STORAGE_NO_SUCH_USER)
     188        if (status != STORAGE_NO_SUCH_USER) {
     189                otr_rename(onick, nnick);
    183190                return status;
     191        }
    184192
    185193        /* Try to load from a migration backend and save to the current backend.
     
    205213
    206214        storage_remove(onick, password);
     215        otr_rename(onick, nnick);
    207216
    208217        return STORAGE_OK;
Note: See TracChangeset for help on using the changeset viewer.