Changeset 03df717


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.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r398a139 r03df717  
    11091109}
    11101110
     1111static void bee_irc_log(bee_t *bee, const char *tag, const char *msg)
     1112{
     1113        irc_t *irc = (irc_t *) bee->ui_data;
     1114
     1115        irc_rootmsg(irc, "%s - %s", tag, msg);
     1116}
     1117
    11111118const struct bee_ui_funcs irc_ui_funcs = {
    11121119        bee_irc_imc_connected,
     
    11371144        bee_irc_ft_close,
    11381145        bee_irc_ft_finished,
     1146
     1147        bee_irc_log,
    11391148};
  • 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.