Move config function to avoid predeclaration
This commit is contained in:
parent
c81ce16e80
commit
f09b4c1c87
2 changed files with 12 additions and 7 deletions
17
telegram.c
17
telegram.c
|
@ -63,6 +63,18 @@ void telegram_change_state(struct telegram *instance, int state, void *data)
|
|||
} while ((curr = g_list_next(change_listeners)) != NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the configuration path for the given config file and the given instance
|
||||
*
|
||||
* @returns The full path to the configuration.
|
||||
*
|
||||
* NOTE: the returned string must be freed manually using gfree
|
||||
*/
|
||||
char *telegram_get_config(struct telegram *instance, char *config)
|
||||
{
|
||||
return g_strdup_printf("%s/%s", instance->config_path, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle state changes of the telegram instance
|
||||
*
|
||||
|
@ -254,11 +266,6 @@ void telegram_store_session(struct telegram *instance)
|
|||
write_state_file(&instance->proto, instance->state_path);
|
||||
}
|
||||
|
||||
char *telegram_get_config(struct telegram *instance, char *config)
|
||||
{
|
||||
return g_strdup_printf("%s/%s", instance->config_path, config);
|
||||
}
|
||||
|
||||
void on_authorized(struct mtproto_connection *c, void* data);
|
||||
|
||||
/**
|
||||
|
|
|
@ -151,8 +151,6 @@ struct telegram *telegram_new(struct dc *DC, const char* login, const char* conf
|
|||
*/
|
||||
void telegram_restore_session(struct telegram *instance);
|
||||
|
||||
char *telegram_get_config(struct telegram *instance, char *config);
|
||||
|
||||
/**
|
||||
* Store
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue