From 8ae80a755af6a6219acb253abe801aba2834c0a6 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 14 Dec 2015 16:23:00 +0100 Subject: [PATCH] Add getter for MatrixHTTPAPI:base-url --- .../reference/matrix-glib/matrix-glib-sections.txt | 1 + src/matrix-http-api.c | 14 ++++++++++++++ src/matrix-http-api.h | 1 + 3 files changed, 16 insertions(+) diff --git a/docs/reference/matrix-glib/matrix-glib-sections.txt b/docs/reference/matrix-glib/matrix-glib-sections.txt index 4e611ce..d7afec1 100644 --- a/docs/reference/matrix-glib/matrix-glib-sections.txt +++ b/docs/reference/matrix-glib/matrix-glib-sections.txt @@ -56,6 +56,7 @@ matrix_api_get_type matrix_http_api_new matrix_http_api_get_validate_certificate matrix_http_api_set_validate_certificate +matrix_http_api_get_base_url MatrixHTTPAPI MatrixHTTPAPIClass diff --git a/src/matrix-http-api.c b/src/matrix-http-api.c index 09de4a9..956f053 100644 --- a/src/matrix-http-api.c +++ b/src/matrix-http-api.c @@ -305,3 +305,17 @@ matrix_http_api_get_validate_certificate(MatrixHTTPAPI *api) return priv->validate_certificate; } + +/** + * matrix_http_api_get_base_url: + * @api: a #MatrixHTTPAPI implementation + * + * Returns: (transfer none): the base URL set for @api + */ +const gchar * +matrix_http_api_get_base_url(MatrixHTTPAPI *api) +{ + MatrixHTTPAPIPrivate *priv = matrix_http_api_get_instance_private(api); + + return priv->url; +} diff --git a/src/matrix-http-api.h b/src/matrix-http-api.h index 4024cf1..c70c21c 100644 --- a/src/matrix-http-api.h +++ b/src/matrix-http-api.h @@ -48,6 +48,7 @@ GType matrix_http_api_get_type(void) G_GNUC_CONST; void matrix_http_api_set_validate_certificate(MatrixHTTPAPI *api, gboolean validate_certificate); gboolean matrix_http_api_get_validate_certificate(MatrixHTTPAPI *api); +const gchar *matrix_http_api_get_base_url(MatrixHTTPAPI *api); MatrixHTTPAPI *matrix_http_api_new(const gchar *base_url, const gchar *token); G_END_DECLS