mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:30:12 +01:00
folder handling fix
This commit is contained in:
parent
7dd81479a1
commit
4fac30507d
@ -125,8 +125,8 @@ int import_message(char *filename, struct session_data *sdata, struct __data *da
|
||||
}
|
||||
|
||||
|
||||
unsigned long get_folder_id(struct session_data *sdata, struct __data *data, char *foldername, int parent_id){
|
||||
unsigned long id=0;
|
||||
int get_folder_id(struct session_data *sdata, struct __data *data, char *foldername, int parent_id){
|
||||
int id=-1;
|
||||
|
||||
if(prepare_sql_statement(sdata, &(data->stmt_get_folder_id), SQL_PREPARED_STMT_GET_FOLDER_ID) == ERR) return id;
|
||||
|
||||
@ -149,8 +149,8 @@ unsigned long get_folder_id(struct session_data *sdata, struct __data *data, cha
|
||||
}
|
||||
|
||||
|
||||
unsigned long add_new_folder(struct session_data *sdata, struct __data *data, char *foldername, int parent_id){
|
||||
unsigned long id=0;
|
||||
int add_new_folder(struct session_data *sdata, struct __data *data, char *foldername, int parent_id){
|
||||
int id=0;
|
||||
|
||||
if(prepare_sql_statement(sdata, &(data->stmt_insert_into_folder_table), SQL_PREPARED_STMT_INSERT_INTO_FOLDER_TABLE) == ERR) return id;
|
||||
|
||||
|
@ -55,8 +55,8 @@ int retrieve_email_from_archive(struct session_data *sdata, struct __data *data,
|
||||
int file_from_archive_to_network(char *filename, int sd, int tls_enable, struct __data *data, struct __config *cfg);
|
||||
|
||||
int import_message(char *filename, struct session_data *sdata, struct __data *data, struct __config *cfg);
|
||||
unsigned long get_folder_id(struct session_data *sdata, struct __data *data, char *foldername, int parent_id);
|
||||
unsigned long add_new_folder(struct session_data *sdata, struct __data *data, char *foldername, int parent_id);
|
||||
int get_folder_id(struct session_data *sdata, struct __data *data, char *foldername, int parent_id);
|
||||
int add_new_folder(struct session_data *sdata, struct __data *data, char *foldername, int parent_id);
|
||||
|
||||
int store_index_data(struct session_data *sdata, struct _state *state, struct __data *data, uint64 id, struct __config *cfg);
|
||||
|
||||
|
@ -543,11 +543,11 @@ int main(int argc, char **argv){
|
||||
if(folder){
|
||||
data.folder = get_folder_id(&sdata, &data, folder, 0);
|
||||
|
||||
if(data.folder == 0){
|
||||
if(data.folder == -1){
|
||||
data.folder = add_new_folder(&sdata, &data, folder, 0);
|
||||
}
|
||||
|
||||
if(data.folder == 0){
|
||||
if(data.folder == -1){
|
||||
printf("error: cannot get/add folder '%s'\n", folder);
|
||||
close_database(&sdata);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user