Changeset 2dcaf9a
- Timestamp:
- 2010-09-01T22:35:06Z (14 years ago)
- Branches:
- master
- Children:
- 76e2f62, 858ea01
- Parents:
- 934db064
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r934db064 r2dcaf9a 240 240 message and don't want anything to go to the user. */ 241 241 char* (*filter_msg_in)( irc_user_t *iu, char *msg, int flags ); 242 243 /* From storage.c functions. Ideally these should not be used 244 and instead data should be stored in settings which will get 245 saved automatically. Consider these deprecated! */ 246 void (*storage_load)( irc_t *irc ); 247 void (*storage_save)( irc_t *irc ); 248 void (*storage_remove)( const char *nick ); 242 249 } irc_plugin_t; 243 250 -
otr.c
r934db064 r2dcaf9a 448 448 otr_filter_msg_out, 449 449 otr_filter_msg_in, 450 otr_load, 451 otr_save, 452 otr_remove, 450 453 }; 451 454 … … 1663 1666 fclose(irc->otr->from); 1664 1667 fclose(irc->otr->to); 1668 irc->otr->from = irc->otr->to = NULL; 1665 1669 kill(irc->otr->keygen, SIGTERM); 1666 1670 waitpid(irc->otr->keygen, NULL, 0); -
storage.c
r934db064 r2dcaf9a 115 115 status = st->load(irc, password); 116 116 if (status == STORAGE_OK) 117 { 118 GSList *l; 119 for( l = irc_plugins; l; l = l->next ) 120 { 121 irc_plugin_t *p = l->data; 122 if( p->storage_load ) 123 p->storage_load( irc ); 124 } 117 125 return status; 126 } 118 127 119 128 if (status != STORAGE_NO_SUCH_USER) … … 127 136 { 128 137 storage_status_t st; 138 GSList *l; 129 139 130 140 if (password != NULL) { … … 140 150 st = ((storage_t *)global.storage->data)->save(irc, overwrite); 141 151 152 for( l = irc_plugins; l; l = l->next ) 153 { 154 irc_plugin_t *p = l->data; 155 if( p->storage_save ) 156 p->storage_save( irc ); 157 } 158 142 159 if (password != NULL) { 143 160 irc_setpass(irc, NULL); … … 151 168 GList *gl; 152 169 storage_status_t ret = STORAGE_OK; 170 gboolean ok = FALSE; 171 GSList *l; 153 172 154 173 /* Remove this account from all storage backends. If this isn't … … 160 179 161 180 status = st->remove(nick, password); 181 ok |= status == STORAGE_OK; 162 182 if (status != STORAGE_NO_SUCH_USER && status != STORAGE_OK) 163 183 ret = status; 164 184 } 185 186 /* If at least one succeeded, remove plugin data. */ 187 if( ok ) 188 for( l = irc_plugins; l; l = l->next ) 189 { 190 irc_plugin_t *p = l->data; 191 if( p->storage_remove ) 192 p->storage_remove( nick ); 193 } 165 194 166 195 return ret;
Note: See TracChangeset
for help on using the changeset viewer.