Changeset dd43c62 for protocols/purple


Ignore:
Timestamp:
2015-05-28T05:26:24Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
faeb521
Parents:
3d31618
git-author:
Artem Savkov <artem.savkov@…> (28-03-15 01:23:42)
git-committer:
dequis <dx@…> (28-05-15 05:26:24)
Message:

Gmail notifications support through new imcb_notify_email() API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r3d31618 rdd43c62  
    238238                s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc);
    239239                s->flags |= ACC_SET_OFFLINE_ONLY;
     240
     241                s = set_add(&acc->set, "notify_handle", NULL, NULL, acc);
     242                s->flags |= ACC_SET_OFFLINE_ONLY | SET_NULL_OK;
    240243        }
    241244
     
    332335
    333336        purple_account_set_enabled(pd->account, "BitlBee", TRUE);
     337
     338        if (set_getbool(&acc->set, "mail_notifications") && set_getstr(&acc->set, "notify_handle")) {
     339                imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL);
     340        }
    334341}
    335342
     
    12541261{
    12551262        struct im_connection *ic = purple_ic_by_gc(gc);
    1256 
    1257         imcb_log(ic, "Received e-mail from %s for %s: %s <%s>", from, to, subject, url);
     1263        char *msg = g_strdup_printf("Received e-mail from %s for %s: %s <%s>", from, to, subject, url);
     1264
     1265        imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0);
     1266        g_free(msg);
    12581267
    12591268        return NULL;
Note: See TracChangeset for help on using the changeset viewer.