diff --git a/telegram.c b/telegram.c index a6190fc..e214cfc 100755 --- a/telegram.c +++ b/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); /** diff --git a/telegram.h b/telegram.h index d9dd34e..59efb8f 100644 --- a/telegram.h +++ b/telegram.h @@ -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 */