- Timestamp:
- 2008-09-07T17:13:49Z (16 years ago)
- Branches:
- master
- Children:
- 92e90b7
- Parents:
- 0a4f6f4 (diff), ba3a8a5 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage.c
r0a4f6f4 rb99296f 103 103 } 104 104 105 storage_status_t storage_load (const char *nick, const char *password, irc_t * irc) 106 { 107 GList *gl; 105 storage_status_t storage_load (irc_t * irc, const char *password) 106 { 107 GList *gl; 108 109 if (irc && irc->status & USTATUS_IDENTIFIED) 110 return STORAGE_OTHER_ERROR; 108 111 109 112 /* Loop until we don't get NO_SUCH_USER */ … … 112 115 storage_status_t status; 113 116 114 status = st->load(nick, password, irc); 115 if (status == STORAGE_OK) { 116 irc_setpass(irc, password); 117 status = st->load(irc, password); 118 if (status == STORAGE_OK) 117 119 return status; 118 }119 120 120 121 if (status != STORAGE_NO_SUCH_USER) … … 125 126 } 126 127 127 storage_status_t storage_save (irc_t *irc, int overwrite) 128 { 129 return ((storage_t *)global.storage->data)->save(irc, overwrite); 128 storage_status_t storage_save (irc_t *irc, char *password, int overwrite) 129 { 130 storage_status_t st; 131 132 if (password != NULL) { 133 /* Should only use this in the "register" command. */ 134 if (irc->password || overwrite) 135 return STORAGE_OTHER_ERROR; 136 137 irc_setpass(irc, password); 138 } else if ((irc->status & USTATUS_IDENTIFIED) == 0) { 139 return STORAGE_NO_SUCH_USER; 140 } 141 142 st = ((storage_t *)global.storage->data)->save(irc, overwrite); 143 144 if (password != NULL) { 145 irc_setpass(irc, NULL); 146 } 147 148 return st; 130 149 } 131 150 … … 143 162 144 163 status = st->remove(nick, password); 145 if (status != STORAGE_NO_SUCH_USER && 146 status != STORAGE_OK) 164 if (status != STORAGE_NO_SUCH_USER && status != STORAGE_OK) 147 165 ret = status; 148 166 } … … 150 168 return ret; 151 169 } 170 171 #if 0 172 Not using this yet. Test thoroughly before adding UI hooks to this function. 152 173 153 174 storage_status_t storage_rename (const char *onick, const char *nnick, const char *password) … … 189 210 return STORAGE_OK; 190 211 } 212 #endif
Note: See TracChangeset
for help on using the changeset viewer.