From 03df717bf8e01754c730c3ab5e08ed6a920dcb40 Mon Sep 17 00:00:00 2001 From: dequis Date: Tue, 1 Dec 2015 01:38:30 -0300 Subject: Add 'log' UI function, to avoid direct calls to irc_rootmsg from nogaim Just a trivial wrapper over irc_rootmsg(), but will help me to slightly reduce the ugliness of an unavoidably ugly hack for libpurple. --- protocols/nogaim.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'protocols/nogaim.c') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 459a3913..21152e0f 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -206,6 +206,10 @@ static void serv_got_crap(struct im_connection *ic, char *format, ...) char *text; account_t *a; + if (!ic->bee->ui->log) { + return; + } + va_start(params, format); text = g_strdup_vprintf(format, params); va_end(params); @@ -224,10 +228,9 @@ static void serv_got_crap(struct im_connection *ic, char *format, ...) /* If we found one, include the screenname in the message. */ if (a) { - /* FIXME(wilmer): ui_log callback or so */ - irc_rootmsg(ic->bee->ui_data, "%s - %s", ic->acc->tag, text); + ic->bee->ui->log(ic->bee, ic->acc->tag, text); } else { - irc_rootmsg(ic->bee->ui_data, "%s - %s", ic->acc->prpl->name, text); + ic->bee->ui->log(ic->bee, ic->acc->prpl->name, text); } g_free(text); -- cgit v1.2.3