Changeset 03df717 for protocols


Ignore:
Timestamp:
2015-12-01T04:45:20Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
05aba55
Parents:
398a139
git-author:
dequis <dx@…> (01-12-15 04:38:30)
git-committer:
dequis <dx@…> (01-12-15 04:45:20)
Message:

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.

Location:
protocols
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/bee.h

    r398a139 r03df717  
    129129        void (*ft_close)(struct im_connection *ic, struct file_transfer *ft);
    130130        void (*ft_finished)(struct im_connection *ic, struct file_transfer *ft);
     131
     132        void (*log)(bee_t *bee, const char *tag, const char *msg);
    131133} bee_ui_funcs_t;
    132134
  • protocols/nogaim.c

    r398a139 r03df717  
    207207        account_t *a;
    208208
     209        if (!ic->bee->ui->log) {
     210                return;
     211        }
     212
    209213        va_start(params, format);
    210214        text = g_strdup_vprintf(format, params);
     
    225229        /* If we found one, include the screenname in the message. */
    226230        if (a) {
    227                 /* FIXME(wilmer): ui_log callback or so */
    228                 irc_rootmsg(ic->bee->ui_data, "%s - %s", ic->acc->tag, text);
     231                ic->bee->ui->log(ic->bee, ic->acc->tag, text);
    229232        } else {
    230                 irc_rootmsg(ic->bee->ui_data, "%s - %s", ic->acc->prpl->name, text);
     233                ic->bee->ui->log(ic->bee, ic->acc->prpl->name, text);
    231234        }
    232235
Note: See TracChangeset for help on using the changeset viewer.