diff options
Diffstat (limited to 'protocols/bee_user.c')
-rw-r--r-- | protocols/bee_user.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/protocols/bee_user.c b/protocols/bee_user.c index 562b31b3..3088de5c 100644 --- a/protocols/bee_user.c +++ b/protocols/bee_user.c @@ -270,13 +270,30 @@ void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *ms } } -void imcb_notify_email(struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at) +void imcb_notify_email(struct im_connection *ic, char *format, ...) { + const char *handle; + va_list params; + char *msg; + + if (!set_getbool(&ic->acc->set, "mail_notifications")) { + return; + } + + va_start(params, format); + msg = g_strdup_vprintf(format, params); + va_end(params); + + /* up to the protocol to set_add this if they want to use this */ + handle = set_getstr(&ic->acc->set, "notify_handle"); + if (handle != NULL) { - imcb_buddy_msg(ic, handle, msg, flags, sent_at); + imcb_buddy_msg(ic, handle, msg, 0, 0); } else { imcb_log(ic, "%s", msg); } + + g_free(msg); } void imcb_buddy_typing(struct im_connection *ic, const char *handle, uint32_t flags) |