Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage.c

    r3183c21 r823de9d  
    2929#include "bitlbee.h"
    3030#include "crypting.h"
     31#include "otr.h"
    3132
    3233extern storage_t storage_text;
     
    116117
    117118                status = st->load(irc, password);
    118                 if (status == STORAGE_OK)
     119                if (status == STORAGE_OK) {
     120                        otr_load(irc);
    119121                        return status;
     122                }
    120123               
    121124                if (status != STORAGE_NO_SUCH_USER)
     
    139142                return STORAGE_NO_SUCH_USER;
    140143        }
    141        
     144
     145        otr_save(irc);
    142146        st = ((storage_t *)global.storage->data)->save(irc, overwrite);
    143147       
     
    165169                        ret = status;
    166170        }
     171        if (ret == STORAGE_OK) {
     172                otr_remove(nick);
     173        }
    167174       
    168175        return ret;
     
    178185        storage_t *primary_storage = gl->data;
    179186        irc_t *irc;
    180 
     187       
    181188        /* First, try to rename in the current write backend, assuming onick
    182189         * is stored there */
    183190        status = primary_storage->rename(onick, nnick, password);
    184         if (status != STORAGE_NO_SUCH_USER)
     191        if (status != STORAGE_NO_SUCH_USER) {
     192                otr_rename(onick, nnick);
    185193                return status;
     194        }
    186195
    187196        /* Try to load from a migration backend and save to the current backend.
     
    207216
    208217        storage_remove(onick, password);
     218        otr_rename(onick, nnick);
    209219
    210220        return STORAGE_OK;
Note: See TracChangeset for help on using the changeset viewer.