Changeset 297d1d0


Ignore:
Timestamp:
2012-06-07T23:11:15Z (8 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
bfafb99
Parents:
e222c36
Message:

Remove storage_rename() which was never tested/used, and current /NICK support
should be sufficient.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • storage.c

    re222c36 r297d1d0  
    195195        return ret;
    196196}
    197 
    198 #if 0
    199 Not using this yet. Test thoroughly before adding UI hooks to this function.
    200 
    201 storage_status_t storage_rename (const char *onick, const char *nnick, const char *password)
    202 {
    203         storage_status_t status;
    204         GList *gl = global.storage;
    205         storage_t *primary_storage = gl->data;
    206         irc_t *irc;
    207 
    208         /* First, try to rename in the current write backend, assuming onick
    209          * is stored there */
    210         status = primary_storage->rename(onick, nnick, password);
    211         if (status != STORAGE_NO_SUCH_USER)
    212                 return status;
    213 
    214         /* Try to load from a migration backend and save to the current backend.
    215          * Explicitly remove the account from the migration backend as otherwise
    216          * it'd still be usable under the old name */
    217        
    218         irc = g_new0(irc_t, 1);
    219         status = storage_load(onick, password, irc);
    220         if (status != STORAGE_OK) {
    221                 irc_free(irc);
    222                 return status;
    223         }
    224 
    225         g_free(irc->nick);
    226         irc->nick = g_strdup(nnick);
    227 
    228         status = storage_save(irc, FALSE);
    229         if (status != STORAGE_OK) {
    230                 irc_free(irc);
    231                 return status;
    232         }
    233         irc_free(irc);
    234 
    235         storage_remove(onick, password);
    236 
    237         return STORAGE_OK;
    238 }
    239 #endif
  • storage.h

    re222c36 r297d1d0  
    5959storage_status_t storage_remove (const char *nick, const char *password);
    6060
    61 /* storage_status_t storage_rename (const char *onick, const char *nnick, const char *password); */
    62 
    6361void register_storage_backend(storage_t *);
    6462G_GNUC_MALLOC GList *storage_init(const char *primary, char **migrate);
Note: See TracChangeset for help on using the changeset viewer.