diff options
author | dequis <dx@dxzone.com.ar> | 2015-05-30 21:11:20 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-05-30 21:11:20 -0300 |
commit | 0f7eccff5b3f7436f50c66e4270009fa6290a578 (patch) | |
tree | 6bb388836ad43e2beea4880082b0728201c09772 /protocols/yahoo/yahoo.c | |
parent | c42d9916663ecae98d01c539cf038d9bc99acfbb (diff) | |
parent | f453a7faa95f9210adbdba20644f280cce68c42e (diff) |
Merge branch 'develop'
Diffstat (limited to 'protocols/yahoo/yahoo.c')
-rw-r--r-- | protocols/yahoo/yahoo.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 728803fb..9da12949 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -122,7 +122,13 @@ static char *byahoo_strip(const char *in) static void byahoo_init(account_t *acc) { - set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); + set_t *s; + + s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); + s->flags |= ACC_SET_OFFLINE_ONLY; + + s = set_add(&acc->set, "mail_notifications_handle", NULL, NULL, acc); + s->flags |= ACC_SET_OFFLINE_ONLY | SET_NULL_OK; acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE; } @@ -144,6 +150,10 @@ static void byahoo_login(account_t *acc) imcb_log(ic, "Connecting"); yd->y2_id = yahoo_init(acc->user, acc->pass); yahoo_login(yd->y2_id, yd->current_status); + + if (set_getbool(&acc->set, "mail_notifications") && set_getstr(&acc->set, "mail_notifications_handle")) { + imcb_add_buddy(ic, set_getstr(&acc->set, "mail_notifications_handle"), NULL); + } } static void byahoo_logout(struct im_connection *ic) @@ -949,12 +959,10 @@ void ext_yahoo_mail_notify(int id, const char *from, const char *subj, int cnt) { struct im_connection *ic = byahoo_get_ic_by_id(id); - if (!set_getbool(&ic->acc->set, "mail_notifications")) { - ; /* The user doesn't care. */ - } else if (from && subj) { - imcb_log(ic, "Received e-mail message from %s with subject `%s'", from, subj); + if (from && subj) { + imcb_notify_email(ic, "Received e-mail message from %s with subject `%s'", from, subj); } else if (cnt > 0) { - imcb_log(ic, "Received %d new e-mails", cnt); + imcb_notify_email(ic, "Received %d new e-mails", cnt); } } |