From af42bc4434a4eedaf13e057a73e17fe46e0eb110 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 11 Oct 2016 23:40:15 +0100 Subject: [PATCH] Add win_print_http_upload --- src/tools/http_upload.c | 2 +- src/ui/window.c | 6 ++++++ src/ui/window.h | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tools/http_upload.c b/src/tools/http_upload.c index fc41ec5e..23315460 100644 --- a/src/tools/http_upload.c +++ b/src/tools/http_upload.c @@ -146,7 +146,7 @@ http_file_put(void *userdata) if (asprintf(&msg, "Uploading '%s': 0%%", upload->filename) == -1) { msg = strdup(FALLBACK_MSG); } - win_print_with_receipt(upload->window, '!', 0, NULL, 0, THEME_TEXT_ME, NULL, msg, upload->put_url); + win_print_http_upload(upload->window, msg, upload->put_url); free(msg); char *cert_path = prefs_get_string(PREF_TLS_CERTPATH); diff --git a/src/ui/window.c b/src/ui/window.c index a410d6d5..b0ca6215 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1038,6 +1038,12 @@ win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *tim va_end(arg); } +void +win_print_http_upload(ProfWin *window, const char *const message, char *url) +{ + win_print_with_receipt(window, '!', 0, NULL, 0, THEME_TEXT_ME, NULL, message, url); +} + void win_print_with_receipt(ProfWin *window, const char show_char, int pad_indent, GTimeVal *tstamp, int flags, theme_item_t theme_item, const char *const from, const char *const message, char *id) diff --git a/src/ui/window.h b/src/ui/window.h index cc9ae8df..4b82b1d4 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -61,8 +61,12 @@ void win_show_status_string(ProfWin *window, const char *const from, const char *const default_show); void win_print_incoming_message(ProfWin *window, GDateTime *timestamp, const char *const from, const char *const message, prof_enc_t enc_mode); + +void win_print_http_upload(ProfWin *window, const char *const message, char *url); + void win_print_with_receipt(ProfWin *window, const char show_char, int pad_indent, GTimeVal *tstamp, int flags, theme_item_t theme_item, const char *const from, const char *const message, char *id); + void win_newline(ProfWin *window); void win_redraw(ProfWin *window); int win_roster_cols(void);