aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-05-30 21:11:20 -0300
committerdequis <dx@dxzone.com.ar>2015-05-30 21:11:20 -0300
commit0f7eccff5b3f7436f50c66e4270009fa6290a578 (patch)
tree6bb388836ad43e2beea4880082b0728201c09772 /protocols/jabber/jabber.c
parentc42d9916663ecae98d01c539cf038d9bc99acfbb (diff)
parentf453a7faa95f9210adbdba20644f280cce68c42e (diff)
Merge branch 'develop'
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r--protocols/jabber/jabber.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index 04db365e..431b3e54 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -99,8 +99,17 @@ static void jabber_init(account_t *acc)
s = set_add(&acc->set, "user_agent", "BitlBee", NULL, acc);
s = set_add(&acc->set, "xmlconsole", "false", set_eval_bool, acc);
+
+ s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc);
s->flags |= ACC_SET_OFFLINE_ONLY;
+ /* changing this is rarely needed so keeping it secret */
+ s = set_add(&acc->set, "mail_notifications_limit", "5", set_eval_int, acc);
+ s->flags |= SET_HIDDEN_DEFAULT;
+
+ 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 |
ACC_FLAG_HANDLE_DOMAINS;
}
@@ -259,6 +268,14 @@ void jabber_connect(struct im_connection *ic)
imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL);
}
+ if (set_getbool(&acc->set, "mail_notifications")) {
+ /* It's gmail specific, but it checks for server support before enabling it */
+ jd->flags |= JFLAG_GMAILNOTIFY;
+ if (set_getstr(&acc->set, "mail_notifications_handle")) {
+ imcb_add_buddy(ic, set_getstr(&acc->set, "mail_notifications_handle"), NULL);
+ }
+ }
+
jabber_generate_id_hash(jd);
}
@@ -333,6 +350,7 @@ static void jabber_logout(struct im_connection *ic)
g_free(jd->oauth2_access_token);
g_free(jd->away_message);
g_free(jd->internal_jid);
+ g_free(jd->gmail_tid);
g_free(jd->username);
g_free(jd->me);
g_free(jd);