Changeset e31e5b8 for storage.c


Ignore:
Timestamp:
2013-04-20T13:05:55Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
dd95ce4
Parents:
9b2a8c1 (diff), bfafb99 (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 "storage" branch which I wrote long ago. It separates generation of
XML-formatted user configs from disk I/O so we can try to start using other
mechanisms to store them (a REST API or something, for example).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage.c

    r9b2a8c1 re31e5b8  
    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
Note: See TracChangeset for help on using the changeset viewer.