Changeset 05aba55 for protocols/purple


Ignore:
Timestamp:
2015-12-01T04:55:21Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
48b5fef
Parents:
03df717
Message:

purple: Implement PurpleNotifyUiOps.notify_message

Which has no connection context. Luckily local_bee exists, and libpurple
only supports only one irc user per process.

This sucks.

And yesterday I was naively thinking (again) that local_bee might not be
needed, that maybe we can do things properly. Of course it only took a
look at that one reverted commit (56985aa) to remember that life is
unfair, and that, under Moloch, everyone is irresistably incentivized to
ignore the things that unite us in favor of forever picking at the
things that divide us in exactly the way that is most likely to make
them more divisive. That being said, I think all these hacks are going
to look nicer once I sandbox the whole thing in a separate process with
one IM account per process, as opposed to one irc use per process. Then
we'll be able to rely on global state exclusively, which is saner.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r03df717 r05aba55  
    12881288};
    12891289
     1290/* Absolutely no connection context at all. Thanks purple! brb crying */
     1291static void *prplcb_notify_message(PurpleNotifyMsgType type, const char *title,
     1292                                   const char *primary, const char *secondary)
     1293{
     1294        char *text = g_strdup_printf("%s%s - %s%s%s",
     1295                (type == PURPLE_NOTIFY_MSG_ERROR) ? "Error: " : "",
     1296                title,
     1297                primary ?: "",
     1298                (primary && secondary) ? " - " : "",
     1299                secondary ?: ""
     1300        );
     1301
     1302        if (local_bee->ui->log) {
     1303                local_bee->ui->log(local_bee, "purple", text);
     1304        }
     1305
     1306        g_free(text);
     1307
     1308        return NULL;
     1309}
     1310
    12901311static void *prplcb_notify_email(PurpleConnection *gc, const char *subject, const char *from,
    12911312                                 const char *to, const char *url)
     
    13481369static PurpleNotifyUiOps bee_notify_uiops =
    13491370{
    1350         NULL,
     1371        prplcb_notify_message,
    13511372        prplcb_notify_email,
    13521373        NULL,
Note: See TracChangeset for help on using the changeset viewer.