From fe63ed318317f4ca91ad5e56a4d77c879b97c8e6 Mon Sep 17 00:00:00 2001 From: Evan Klitzke Date: Wed, 20 May 2015 15:19:14 -0700 Subject: teach nick_lc to handle # and other non-letters correctly --- nick.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nick.c b/nick.c index fb84f986..31cf4f34 100644 --- a/nick.c +++ b/nick.c @@ -367,9 +367,13 @@ int nick_lc(irc_t *irc, char *nick) int i; if (tab['A'] == 0) { + /* initialize table so nonchars are mapped to themselves */ + for (i = 0; i < sizeof(tab); i++) { + tab[i] = i; + } + /* replace uppercase chars with lowercase chars */ for (i = 0; nick_lc_chars[i]; i++) { tab[(int) nick_uc_chars[i]] = nick_lc_chars[i]; - tab[(int) nick_lc_chars[i]] = nick_lc_chars[i]; } } -- cgit v1.2.3 From 24f113b01e1117ab031a1ede6d418030fc69d63d Mon Sep 17 00:00:00 2001 From: Artem Savkov Date: Mon, 25 May 2015 18:49:59 +0000 Subject: Lowering xmpp presence priority on away. When user set's away lower xmpp presence priority by 5 as most clients do, new priority won't go below zero though. --- protocols/jabber/presence.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/protocols/jabber/presence.c b/protocols/jabber/presence.c index 82ea5f8f..c8664a24 100644 --- a/protocols/jabber/presence.c +++ b/protocols/jabber/presence.c @@ -180,6 +180,22 @@ xt_status jabber_pkt_presence(struct xt_node *node, gpointer data) return XT_HANDLED; } +static char *choose_priority(struct im_connection *ic) +{ + struct jabber_data *jd = ic->proto_data; + char *prio = set_getstr(&ic->acc->set, "priority"); + + if (jd->away_state->code != NULL) { + int new_prio = (atoi(prio) - 5); + if (new_prio < 0) { + new_prio = 0; + } + return g_strdup_printf("%d", new_prio); + } + + return g_strdup(prio); +} + /* Whenever presence information is updated, call this function to inform the server. */ int presence_send_update(struct im_connection *ic) @@ -188,9 +204,10 @@ int presence_send_update(struct im_connection *ic) struct xt_node *node, *cap; GSList *l; int st; + char *prio = choose_priority(ic); node = jabber_make_packet("presence", NULL, NULL, NULL); - xt_add_child(node, xt_new_node("priority", set_getstr(&ic->acc->set, "priority"), NULL)); + xt_add_child(node, xt_new_node("priority", prio, NULL)); if (jd->away_state) { xt_add_child(node, xt_new_node("show", jd->away_state->code, NULL)); } @@ -221,6 +238,7 @@ int presence_send_update(struct im_connection *ic) } xt_free_node(node); + g_free(prio); return st; } -- cgit v1.2.3 From 3d31618b5f50552b71d8c6f1b3fa733a212ee89c Mon Sep 17 00:00:00 2001 From: dequis Date: Thu, 24 Jul 2014 07:41:47 -0300 Subject: jabber: Refactor conference message handling - Improve handling of "unknown 'from'" - Try a bit harder to detect the source of the message, and fall back to messages sent from a fake temporary user. - Fix receiving topic when it was set by someone who left the room. - Add jabber_get_bare_jid() utility function --- protocols/jabber/conference.c | 120 ++++++++++++++++++++++------------------- protocols/jabber/jabber.h | 1 + protocols/jabber/jabber_util.c | 16 ++++++ 3 files changed, 82 insertions(+), 55 deletions(-) diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index bcf05b3c..be63e115 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -353,78 +353,88 @@ void jabber_chat_pkt_message(struct im_connection *ic, struct jabber_buddy *bud, { struct xt_node *subject = xt_find_node(node->children, "subject"); struct xt_node *body = xt_find_node(node->children, "body"); - struct groupchat *chat = bud ? jabber_chat_by_jid(ic, bud->bare_jid) : NULL; - struct jabber_chat *jc = chat ? chat->data : NULL; - char *s; + struct groupchat *chat = NULL; + struct jabber_chat *jc = NULL; + char *from = NULL; + char *nick = NULL; + char *final_from = NULL; + char *bare_jid = NULL; - if (subject && chat) { - s = (bud && bud->ext_jid) ? strchr(bud->ext_jid, '/') : NULL; - if (s) { - *s = 0; + from = (bud) ? bud->full_jid : xt_find_attr(node, "from"); + + if (from) { + nick = strchr(from, '/'); + if (nick) { + *nick = 0; } - imcb_chat_topic(chat, bud ? bud->ext_jid : NULL, subject->text_len > 0 ? - subject->text : NULL, jabber_get_timestamp(node)); - if (s) { - *s = '/'; + chat = jabber_chat_by_jid(ic, from); + if (nick) { + *nick = '/'; + nick++; } } - if (bud == NULL || (jc && ~jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me)) { - char *nick; + jc = (chat) ? chat->data : NULL; - if (body == NULL || body->text_len == 0) { - /* Meh. Empty messages aren't very interesting, no matter - how much some servers love to send them. */ - return; + if (!bud) { + struct xt_node *c; + char *s; + + /* Try some clever stuff to find out the real JID here */ + c = xt_find_node_by_attr(node->children, "delay", "xmlns", XMLNS_DELAY); + + if (c && ((s = xt_find_attr(c, "from")) || + (s = xt_find_attr(c, "from_jid")))) { + /* This won't be useful if it's the MUC JID */ + if (!(jc && jabber_compare_jid(s, jc->name))) { + /* Hopefully this one makes more sense! */ + bud = jabber_buddy_by_jid(ic, s, GET_BUDDY_FIRST | GET_BUDDY_CREAT); + } } - s = xt_find_attr(node, "from"); /* pkt_message() already NULL-checked this one. */ - nick = strchr(s, '/'); - if (nick) { - /* If this message included a resource/nick we don't know, - we might still know the groupchat itself. */ - *nick = 0; - chat = jabber_chat_by_jid(ic, s); - *nick = '/'; + } - nick++; - } else { - /* message.c uses the EXACT_JID option, so bud should - always be NULL here for bare JIDs. */ - chat = jabber_chat_by_jid(ic, s); + if (subject && chat) { + char *subject_text = subject->text_len > 0 ? subject->text : NULL; + if (g_strcmp0(chat->topic, subject_text) != 0) { + bare_jid = (bud) ? jabber_get_bare_jid(bud->ext_jid) : NULL; + imcb_chat_topic(chat, bare_jid, subject_text, + jabber_get_timestamp(node)); + g_free(bare_jid); } + } + if (body == NULL || body->text_len == 0) { + /* Meh. Empty messages aren't very interesting, no matter + how much some servers love to send them. */ + return; + } + + if (chat == NULL) { if (nick == NULL) { - /* This is fine, the groupchat itself isn't in jd->buddies. */ - if (chat) { - imcb_chat_log(chat, "From conference server: %s", body->text); - } else { - imcb_log(ic, "System message from unknown groupchat %s: %s", s, body->text); - } + imcb_log(ic, "System message from unknown groupchat %s: %s", from, body->text); } else { - /* This can happen too, at least when receiving a backlog when - just joining a channel. */ - if (chat) { - imcb_chat_log(chat, "Message from unknown participant %s: %s", nick, body->text); - } else { - imcb_log(ic, "Groupchat message from unknown JID %s: %s", s, body->text); - } + imcb_log(ic, "Groupchat message from unknown JID %s: %s", from, body->text); } return; - } else if (chat == NULL) { - /* How could this happen?? We could do kill( self, 11 ) - now or just wait for the OS to do it. :-) */ + } else if (chat != NULL && bud == NULL && nick == NULL) { + imcb_chat_log(chat, "From conference server: %s", body->text); + return; + } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me) { + /* exclude self-messages since they would get filtered out + * but not the ones in the backlog */ return; } - if (body && body->text_len > 0) { - s = (bud->ext_jid) ? strchr(bud->ext_jid, '/') : NULL; - if (s) { - *s = 0; - } - imcb_chat_msg(chat, bud->ext_jid, body->text, 0, jabber_get_timestamp(node)); - if (s) { - *s = '/'; - } + + if (bud && jc && bud != jc->me) { + bare_jid = jabber_get_bare_jid(bud->ext_jid ? bud->ext_jid : bud->full_jid); + final_from = bare_jid; + } else { + final_from = nick; } + + imcb_chat_msg(chat, final_from, body->text, 0, jabber_get_timestamp(node)); + + g_free(bare_jid); } diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h index 8416e1a7..b8ef8b08 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -311,6 +311,7 @@ time_t jabber_get_timestamp(struct xt_node *xt); struct jabber_error *jabber_error_parse(struct xt_node *node, char *xmlns); void jabber_error_free(struct jabber_error *err); gboolean jabber_set_me(struct im_connection *ic, const char *me); +char *jabber_get_bare_jid(char *jid); extern const struct jabber_away_state jabber_away_state_list[]; diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index 779d502b..38daaa26 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -819,3 +819,19 @@ gboolean jabber_set_me(struct im_connection *ic, const char *me) return TRUE; } + +/* Returns new reference! g_free() afterwards. */ +char *jabber_get_bare_jid(char *jid) +{ + char *s = NULL; + + if (jid == NULL) { + return NULL; + } + + if ((s = strchr(jid, '/'))) { + return g_strndup(jid, s - jid); + } else { + return g_strdup(jid); + } +} -- cgit v1.2.3 From dd43c6256c143e9e6a479e024cb5b7631027efba Mon Sep 17 00:00:00 2001 From: Artem Savkov Date: Fri, 27 Mar 2015 22:23:42 -0300 Subject: Gmail notifications support through new imcb_notify_email() API --- doc/user-guide/commands.xml | 22 ++++++++ protocols/bee.h | 2 + protocols/bee_user.c | 9 +++ protocols/jabber/iq.c | 135 ++++++++++++++++++++++++++++++++++++++++++++ protocols/jabber/jabber.c | 12 ++++ protocols/jabber/jabber.h | 4 ++ protocols/msn/msn.c | 10 +++- protocols/msn/ns.c | 14 +++-- protocols/purple/purple.c | 11 +++- protocols/yahoo/yahoo.c | 28 ++++++--- 10 files changed, 233 insertions(+), 14 deletions(-) diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index 4d6e7659..40387585 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -1022,6 +1022,28 @@ + + empty + + + + This setting is available for protocols with e-mail notification functionality. If set to empty all e-mail notifications will go to control channel, if set to some string - this will be the name of a contact who will PRIVMSG you on every new notification. + + + + + + + false + + + + Same as "mail_notifications" but GMail specific. + + + + + 140 diff --git a/protocols/bee.h b/protocols/bee.h index 36ff2889..1d87f743 100644 --- a/protocols/bee.h +++ b/protocols/bee.h @@ -155,6 +155,8 @@ G_MODULE_EXPORT void imcb_buddy_times(struct im_connection *ic, const char *hand /* Call when a handle says something. 'flags' and 'sent_at may be just 0. */ G_MODULE_EXPORT void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *msg, guint32 flags, time_t sent_at); +G_MODULE_EXPORT void imcb_notify_email(struct im_connection *ic, const char *handle, char *msg, guint32 flags, + time_t sent_at); /* bee_chat.c */ /* These two functions are to create a group chat. diff --git a/protocols/bee_user.c b/protocols/bee_user.c index 2eb24997..562b31b3 100644 --- a/protocols/bee_user.c +++ b/protocols/bee_user.c @@ -270,6 +270,15 @@ 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) +{ + if (handle != NULL) { + imcb_buddy_msg(ic, handle, msg, flags, sent_at); + } else { + imcb_log(ic, "%s", msg); + } +} + void imcb_buddy_typing(struct im_connection *ic, const char *handle, uint32_t flags) { bee_user_t *bu; diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 33889d32..4eef6925 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -26,6 +26,7 @@ static xt_status jabber_parse_roster(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); static xt_status jabber_iq_display_vcard(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); +static xt_status jabber_gmail_handle_new(struct im_connection *ic, struct xt_node *node); xt_status jabber_pkt_iq(struct xt_node *node, gpointer data) { @@ -140,6 +141,10 @@ xt_status jabber_pkt_iq(struct xt_node *node, gpointer data) (s = xt_find_attr(c, "xmlns")) && (strcmp(s, XMLNS_SI) == 0)) { return jabber_si_handle_request(ic, node, c); + } else if ((c = xt_find_node(node->children, "new-mail")) && + (s = xt_find_attr(c, "xmlns")) && + (strcmp(s, XMLNS_GMAILNOTIFY) == 0)) { + return jabber_gmail_handle_new(ic, node); } else if (!(c = xt_find_node(node->children, "query")) || !(s = xt_find_attr(c, "xmlns"))) { return XT_HANDLED; @@ -341,6 +346,9 @@ xt_status jabber_pkt_bind_sess(struct im_connection *ic, struct xt_node *node, s if (!jabber_write_packet(ic, reply)) { return XT_ABORT; } + if (jd->flags & JFLAG_GMAILNOTIFY && node == NULL) { + jabber_iq_query_server(ic, jd->server, XMLNS_DISCO_INFO); + } } else if ((jd->flags & (JFLAG_WANT_BIND | JFLAG_WANT_SESSION)) == 0) { if (!jabber_get_roster(ic)) { return XT_ABORT; @@ -370,6 +378,25 @@ int jabber_get_roster(struct im_connection *ic) return st; } +xt_status jabber_iq_query_gmail(struct im_connection *ic); + +static xt_status jabber_gmail_handle_new(struct im_connection *ic, struct xt_node *node) +{ + struct xt_node *response; + struct jabber_data *jd = ic->proto_data; + + response = jabber_make_packet("iq", "result", g_strdup_printf("%s@%s", jd->username, jd->server), NULL); + + jabber_cache_add(ic, response, NULL); + if (!jabber_write_packet(ic, response)) { + return XT_ABORT; + } + + jabber_iq_query_gmail(ic); + + return XT_HANDLED; +} + static xt_status jabber_parse_roster(struct im_connection *ic, struct xt_node *node, struct xt_node *orig) { struct jabber_data *jd = ic->proto_data; @@ -709,6 +736,34 @@ xt_status jabber_iq_parse_features(struct im_connection *ic, struct xt_node *nod return XT_HANDLED; } +xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); + +xt_status jabber_iq_query_gmail(struct im_connection *ic) +{ + struct xt_node *node, *query; + struct jabber_data *jd = ic->proto_data; + + node = xt_new_node("query", NULL, NULL); + xt_add_attr(node, "xmlns", XMLNS_GMAILNOTIFY); + if (jd->gmail_time) { + char *formatted = g_strdup_printf("%" G_GUINT64_FORMAT, (jd->gmail_time + 1)); + xt_add_attr(node, "newer-than-time", formatted); + g_free(formatted); + } + if (jd->gmail_tid) { + xt_add_attr(node, "newer-than-tid", jd->gmail_tid); + } + + if (!(query = jabber_make_packet("iq", "get", jd->me, node))) { + imcb_log(ic, "WARNING: Couldn't generate server query"); + xt_free_node(node); + } + + jabber_cache_add(ic, query, jabber_iq_parse_gmail); + + return jabber_write_packet(ic, query) ? XT_HANDLED : XT_ABORT; +} + xt_status jabber_iq_parse_server_features(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); xt_status jabber_iq_query_server(struct im_connection *ic, char *jid, char *xmlns) @@ -730,6 +785,73 @@ xt_status jabber_iq_query_server(struct im_connection *ic, char *jid, char *xmln return jabber_write_packet(ic, query) ? XT_HANDLED : XT_ABORT; } +xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, struct xt_node *orig) +{ + struct xt_node *c; + struct jabber_data *jd = ic->proto_data; + char *xmlns, *from; + guint64 l_time = 0; + char *tid = NULL; + + if (!(c = xt_find_node(node->children, "mailbox")) || + !(from = xt_find_attr(node, "from")) || + !(xmlns = xt_find_attr(c, "xmlns")) || + (g_strcmp0(xmlns, XMLNS_GMAILNOTIFY) != 0)) { + imcb_log(ic, "WARNING: Received incomplete mailbox packet for gmail notify"); + return XT_HANDLED; + } + + c = c->children; + + while ((c = xt_find_node(c, "mail-thread-info"))) { + struct xt_node *thread, *s; + char *subject = NULL; + char *snippet = NULL; + char *msg = NULL; + guint64 t_time; + + t_time = g_ascii_strtoull(xt_find_attr(c, "date"), NULL, 10); + if (t_time && t_time > l_time) { + l_time = t_time; + tid = xt_find_attr(c, "tid"); + } + + thread = c->children; + + if ((s = xt_find_node(thread, "subject"))) { + subject = s->text; + } + + if ((s = xt_find_node(thread, "snippet"))) { + snippet = s->text; + } + + if (subject) { + msg = g_strdup_printf("New mail for %s. Subj: %s", from, subject); + } else { + msg = g_strdup_printf("New mail for %s.", from); + } + imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); + + if (snippet) { + imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), snippet, 0, 0); + } + + c = c->next; + g_free(msg); + } + + if (l_time && (!jd->gmail_time || l_time > jd->gmail_time)) { + jd->gmail_time = l_time; + if (tid) { + g_free(jd->gmail_tid); + jd->gmail_tid = g_strdup(tid); + } + } + + return XT_HANDLED; +} + /* * Query the server for "items", query each "item" for identities, query each "item" that's a proxy for it's bytestream info */ @@ -780,6 +902,19 @@ xt_status jabber_iq_parse_server_features(struct im_connection *ic, struct xt_no c = c->next; } + + if (jd->flags & JFLAG_GMAILNOTIFY) { + /* search for gmail notification feature */ + c = xt_find_node(node->children, "query"); + c = c->children; + while ((c = xt_find_node(c, "feature"))) { + if (strcmp(xt_find_attr(c, "var"), XMLNS_GMAILNOTIFY) == 0) { + jabber_iq_query_gmail(ic); + } + c = c->next; + } + } + } else if (strcmp(xmlns, XMLNS_BYTESTREAMS) == 0) { char *host, *jid, *port_s; int port; diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 04db365e..184021dd 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -99,8 +99,13 @@ 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, "gmail_notifications", "false", set_eval_bool, acc); s->flags |= ACC_SET_OFFLINE_ONLY; + s = set_add(&acc->set, "notify_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; } @@ -258,6 +263,12 @@ void jabber_connect(struct im_connection *ic) I think this shouldn't break anything. */ imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL); } + if (set_getbool(&acc->set, "gmail_notifications")) { + jd->flags |= JFLAG_GMAILNOTIFY; + if (set_getstr(&acc->set, "notify_handle")) { + imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + } + } jabber_generate_id_hash(jd); } @@ -333,6 +344,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); diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h index b8ef8b08..37c99ff0 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -45,6 +45,7 @@ typedef enum { activates all XEP-85 related code. */ JFLAG_XMLCONSOLE = 64, /* If the user added an xmlconsole buddy. */ JFLAG_STARTTLS_DONE = 128, /* If a plaintext session was converted to TLS. */ + JFLAG_GMAILNOTIFY = 256, /* If gmail notification is enabled */ JFLAG_GTALK = 0x100000, /* Is Google Talk, as confirmed by iq discovery */ JFLAG_HIPCHAT = 0x200000, /* Is hipchat, because prpl->name says so */ @@ -101,6 +102,8 @@ struct jabber_data { presence_send_update() to inform the server about the changes. */ const struct jabber_away_state *away_state; char *away_message; + guint64 gmail_time; + char *gmail_tid; md5_state_t cached_id_prefix; GHashTable *node_cache; @@ -223,6 +226,7 @@ struct jabber_transfer { #define XMLNS_DELAY_OLD "jabber:x:delay" /* XEP-0091 */ #define XMLNS_DELAY "urn:xmpp:delay" /* XEP-0203 */ #define XMLNS_XDATA "jabber:x:data" /* XEP-0004 */ +#define XMLNS_GMAILNOTIFY "google:mail:notify" /* Not a XEP */ #define XMLNS_CHATSTATES "http://jabber.org/protocol/chatstates" /* XEP-0085 */ #define XMLNS_DISCO_INFO "http://jabber.org/protocol/disco#info" /* XEP-0030 */ #define XMLNS_DISCO_ITEMS "http://jabber.org/protocol/disco#items" /* XEP-0030 */ diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 4acff23a..c5567a14 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -45,7 +45,11 @@ static void msn_init(account_t *acc) s = set_add(&acc->set, "port", MSN_NS_PORT, set_eval_int, acc); s->flags |= ACC_SET_OFFLINE_ONLY; - set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); + s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); + s->flags |= ACC_SET_OFFLINE_ONLY; + + s = set_add(&acc->set, "notify_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; @@ -81,6 +85,10 @@ static void msn_login(account_t *acc) imcb_log(ic, "Connecting"); msn_ns_connect(ic, server, set_getint(&ic->acc->set, "port")); + + if (set_getbool(&acc->set, "mail_notifications") && set_getstr(&acc->set, "notify_handle")) { + imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + } } static void msn_logout(struct im_connection *ic) diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index ab92f30d..130f1c91 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -393,9 +393,11 @@ int msn_ns_message(struct msn_data *md, char *msg, int msglen, char **cmd, int n char *folders = get_rfc822_header(body, "Folders-Unread:", blen); if (inbox && folders) { - imcb_log(ic, - "INBOX contains %s new messages, plus %s messages in other folders.", inbox, - folders); + char *msg = g_strdup_printf( + "INBOX contains %s new messages, plus %s messages in other folders.", inbox, + folders); + imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); + g_free(msg); } g_free(inbox); @@ -407,8 +409,10 @@ int msn_ns_message(struct msn_data *md, char *msg, int msglen, char **cmd, int n char *fromname = get_rfc822_header(body, "From:", blen); if (from && fromname) { - imcb_log(ic, "Received an e-mail message from %s <%s>.", fromname, - from); + char *msg = g_strdup_printf("Received an e-mail message from %s <%s>.", + fromname, from); + imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); + g_free(msg); } g_free(from); diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index 6d8cff56..42a5448c 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -237,6 +237,9 @@ static void purple_init(account_t *acc) if (pi->options & OPT_PROTO_MAIL_CHECK) { s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); s->flags |= ACC_SET_OFFLINE_ONLY; + + s = set_add(&acc->set, "notify_handle", NULL, NULL, acc); + s->flags |= ACC_SET_OFFLINE_ONLY | SET_NULL_OK; } if (strcmp(prpl->info->name, "Gadu-Gadu") == 0) { @@ -331,6 +334,10 @@ static void purple_login(account_t *acc) purple_sync_settings(acc, pd->account); purple_account_set_enabled(pd->account, "BitlBee", TRUE); + + if (set_getbool(&acc->set, "mail_notifications") && set_getstr(&acc->set, "notify_handle")) { + imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + } } static void purple_logout(struct im_connection *ic) @@ -1253,8 +1260,10 @@ static void *prplcb_notify_email(PurpleConnection *gc, const char *subject, cons const char *to, const char *url) { struct im_connection *ic = purple_ic_by_gc(gc); + char *msg = g_strdup_printf("Received e-mail from %s for %s: %s <%s>", from, to, subject, url); - imcb_log(ic, "Received e-mail from %s for %s: %s <%s>", from, to, subject, url); + imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); + g_free(msg); return NULL; } diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 728803fb..2e7c4831 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, "notify_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, "notify_handle")) { + imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + } } static void byahoo_logout(struct im_connection *ic) @@ -948,13 +958,17 @@ void ext_yahoo_game_notify(int id, const char *me, const char *who, int stat, co 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); + char *msg; + + if (set_getbool(&ic->acc->set, "mail_notifications")) { + if (from && subj) { + msg = g_strdup_printf("Received e-mail message from %s with subject `%s'", from, subj); + } else if (cnt > 0) { + msg = g_strdup_printf("Received %d new e-mails", cnt); + } - 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); - } else if (cnt > 0) { - imcb_log(ic, "Received %d new e-mails", cnt); + imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); + g_free(msg); } } -- cgit v1.2.3 From faeb521e66d825e68eb7f9eef8f32ddabbfd9c49 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 8 May 2015 00:26:19 -0300 Subject: Simplify display of gmail notifications - Add gmail_notifications_limit hidden setting, set to 5 by default. - Don't show "snippets" in email notifications. Not very useful and they make the whole thing seem too spammy - Show sender name instead of your own email - Default values for empty subject / sender --- protocols/jabber/iq.c | 30 ++++++++++++------------------ protocols/jabber/jabber.c | 4 ++++ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 4eef6925..3e1a5dfd 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -792,6 +792,7 @@ xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, char *xmlns, *from; guint64 l_time = 0; char *tid = NULL; + int max = 0; if (!(c = xt_find_node(node->children, "mailbox")) || !(from = xt_find_attr(node, "from")) || @@ -801,12 +802,13 @@ xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, return XT_HANDLED; } + max = set_getint(&ic->acc->set, "gmail_notifications_limit"); c = c->children; - while ((c = xt_find_node(c, "mail-thread-info"))) { - struct xt_node *thread, *s; - char *subject = NULL; - char *snippet = NULL; + while ((max-- > 0) && (c = xt_find_node(c, "mail-thread-info"))) { + struct xt_node *s; + char *subject = ""; + char *sender = ""; char *msg = NULL; guint64 t_time; @@ -816,27 +818,19 @@ xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, tid = xt_find_attr(c, "tid"); } - thread = c->children; + if ((s = xt_find_node(c->children, "senders")) && + (s = xt_find_node_by_attr(s->children, "sender", "unread", "1"))) { + sender = xt_find_attr(s, "name"); + } - if ((s = xt_find_node(thread, "subject"))) { + if ((s = xt_find_node(c->children, "subject")) && s->text) { subject = s->text; } - if ((s = xt_find_node(thread, "snippet"))) { - snippet = s->text; - } + msg = g_strdup_printf("New mail from %s: %s", sender, subject); - if (subject) { - msg = g_strdup_printf("New mail for %s. Subj: %s", from, subject); - } else { - msg = g_strdup_printf("New mail for %s.", from); - } imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); - if (snippet) { - imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), snippet, 0, 0); - } - c = c->next; g_free(msg); } diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 184021dd..08da6e26 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -103,6 +103,10 @@ static void jabber_init(account_t *acc) s = set_add(&acc->set, "gmail_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, "gmail_notifications_limit", "5", set_eval_int, acc); + s->flags |= SET_HIDDEN_DEFAULT; + s = set_add(&acc->set, "notify_handle", NULL, NULL, acc); s->flags |= ACC_SET_OFFLINE_ONLY | SET_NULL_OK; -- cgit v1.2.3 From 0864a524c9fd1184874d550216beb49f6a0bef55 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 8 May 2015 01:16:37 -0300 Subject: imcb_notify_email: change parameters to take a format string Saves some messing with g_strdup_printf for the callers, and flags/sent_at weren't used anyway. Also check if the mail_notifications setting is enabled --- protocols/bee.h | 3 +-- protocols/bee_user.c | 21 +++++++++++++++++++-- protocols/jabber/iq.c | 6 +----- protocols/msn/ns.c | 9 ++------- protocols/purple/purple.c | 4 +--- protocols/yahoo/yahoo.c | 14 ++++---------- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/protocols/bee.h b/protocols/bee.h index 1d87f743..afe22c95 100644 --- a/protocols/bee.h +++ b/protocols/bee.h @@ -155,8 +155,7 @@ G_MODULE_EXPORT void imcb_buddy_times(struct im_connection *ic, const char *hand /* Call when a handle says something. 'flags' and 'sent_at may be just 0. */ G_MODULE_EXPORT void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *msg, guint32 flags, time_t sent_at); -G_MODULE_EXPORT void imcb_notify_email(struct im_connection *ic, const char *handle, char *msg, guint32 flags, - time_t sent_at); +G_MODULE_EXPORT void imcb_notify_email(struct im_connection *ic, char *format, ...) G_GNUC_PRINTF(2, 3); /* bee_chat.c */ /* These two functions are to create a group chat. 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) diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 3e1a5dfd..1a915e4a 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -809,7 +809,6 @@ xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, struct xt_node *s; char *subject = ""; char *sender = ""; - char *msg = NULL; guint64 t_time; t_time = g_ascii_strtoull(xt_find_attr(c, "date"), NULL, 10); @@ -827,12 +826,9 @@ xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, subject = s->text; } - msg = g_strdup_printf("New mail from %s: %s", sender, subject); - - imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); + imcb_notify_email(ic, "New mail from %s: %s", sender, subject); c = c->next; - g_free(msg); } if (l_time && (!jd->gmail_time || l_time > jd->gmail_time)) { diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index 130f1c91..766c31e1 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -393,11 +393,9 @@ int msn_ns_message(struct msn_data *md, char *msg, int msglen, char **cmd, int n char *folders = get_rfc822_header(body, "Folders-Unread:", blen); if (inbox && folders) { - char *msg = g_strdup_printf( + imcb_notify_email(ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders); - imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); - g_free(msg); } g_free(inbox); @@ -409,10 +407,7 @@ int msn_ns_message(struct msn_data *md, char *msg, int msglen, char **cmd, int n char *fromname = get_rfc822_header(body, "From:", blen); if (from && fromname) { - char *msg = g_strdup_printf("Received an e-mail message from %s <%s>.", - fromname, from); - imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); - g_free(msg); + imcb_notify_email(ic, "Received an e-mail message from %s <%s>.", fromname, from); } g_free(from); diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index 42a5448c..ab958891 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -1260,10 +1260,8 @@ static void *prplcb_notify_email(PurpleConnection *gc, const char *subject, cons const char *to, const char *url) { struct im_connection *ic = purple_ic_by_gc(gc); - char *msg = g_strdup_printf("Received e-mail from %s for %s: %s <%s>", from, to, subject, url); - imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); - g_free(msg); + imcb_notify_email(ic, "Received e-mail from %s for %s: %s <%s>", from, to, subject, url); return NULL; } diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 2e7c4831..2df454f3 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -958,17 +958,11 @@ void ext_yahoo_game_notify(int id, const char *me, const char *who, int stat, co 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); - char *msg; - if (set_getbool(&ic->acc->set, "mail_notifications")) { - if (from && subj) { - msg = g_strdup_printf("Received e-mail message from %s with subject `%s'", from, subj); - } else if (cnt > 0) { - msg = g_strdup_printf("Received %d new e-mails", cnt); - } - - imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); - g_free(msg); + if (from && subj) { + imcb_notify_email(ic, "Received e-mail message from %s with subject `%s'", from, subj); + } else if (cnt > 0) { + imcb_notify_email(ic, "Received %d new e-mails", cnt); } } -- cgit v1.2.3 From b38f6555bd32356ac6befe329fea1764912ede96 Mon Sep 17 00:00:00 2001 From: dequis Date: Thu, 28 May 2015 00:41:37 -0300 Subject: Rename mail notification related settings for consistency - GMail notifications stuff is now just 'mail_notifications' - sed -i s/notify_handle/mail_notifications_handle/ --- doc/user-guide/commands.xml | 15 ++------------- protocols/bee_user.c | 2 +- protocols/jabber/iq.c | 2 +- protocols/jabber/jabber.c | 14 ++++++++------ protocols/msn/msn.c | 6 +++--- protocols/purple/purple.c | 6 +++--- protocols/yahoo/yahoo.c | 6 +++--- 7 files changed, 21 insertions(+), 30 deletions(-) diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index 40387585..0de4dfcf 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -1016,13 +1016,13 @@ - Some protocols (MSN, Yahoo!) can notify via IM about new e-mail. Since most people use their Hotmail/Yahoo! addresses as a spam-box, this is disabled default. If you want these notifications, you can enable this setting. + Some protocols (MSN, Yahoo!, GTalk) can notify via IM about new e-mail. Since most people use their Hotmail/Yahoo! addresses as a spam-box, this is disabled default. If you want these notifications, you can enable this setting. - + empty @@ -1033,17 +1033,6 @@ - - false - - - - Same as "mail_notifications" but GMail specific. - - - - - 140 diff --git a/protocols/bee_user.c b/protocols/bee_user.c index 3088de5c..2d63bfb4 100644 --- a/protocols/bee_user.c +++ b/protocols/bee_user.c @@ -285,7 +285,7 @@ void imcb_notify_email(struct im_connection *ic, char *format, ...) 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"); + handle = set_getstr(&ic->acc->set, "mail_notifications_handle"); if (handle != NULL) { imcb_buddy_msg(ic, handle, msg, 0, 0); diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 1a915e4a..327cc859 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -802,7 +802,7 @@ xt_status jabber_iq_parse_gmail(struct im_connection *ic, struct xt_node *node, return XT_HANDLED; } - max = set_getint(&ic->acc->set, "gmail_notifications_limit"); + max = set_getint(&ic->acc->set, "mail_notifications_limit"); c = c->children; while ((max-- > 0) && (c = xt_find_node(c, "mail-thread-info"))) { diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 08da6e26..431b3e54 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -100,14 +100,14 @@ static void jabber_init(account_t *acc) s = set_add(&acc->set, "xmlconsole", "false", set_eval_bool, acc); - s = set_add(&acc->set, "gmail_notifications", "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, "gmail_notifications_limit", "5", set_eval_int, acc); + s = set_add(&acc->set, "mail_notifications_limit", "5", set_eval_int, acc); s->flags |= SET_HIDDEN_DEFAULT; - s = set_add(&acc->set, "notify_handle", NULL, NULL, acc); + 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 | @@ -267,10 +267,12 @@ void jabber_connect(struct im_connection *ic) I think this shouldn't break anything. */ imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL); } - if (set_getbool(&acc->set, "gmail_notifications")) { + + 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, "notify_handle")) { - imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + if (set_getstr(&acc->set, "mail_notifications_handle")) { + imcb_add_buddy(ic, set_getstr(&acc->set, "mail_notifications_handle"), NULL); } } diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index c5567a14..8d3e7787 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -48,7 +48,7 @@ static void msn_init(account_t *acc) s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); s->flags |= ACC_SET_OFFLINE_ONLY; - s = set_add(&acc->set, "notify_handle", NULL, NULL, acc); + 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 | @@ -86,8 +86,8 @@ static void msn_login(account_t *acc) msn_ns_connect(ic, server, set_getint(&ic->acc->set, "port")); - if (set_getbool(&acc->set, "mail_notifications") && set_getstr(&acc->set, "notify_handle")) { - imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + 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); } } diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index ab958891..b00d3078 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -238,7 +238,7 @@ static void purple_init(account_t *acc) s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); s->flags |= ACC_SET_OFFLINE_ONLY; - s = set_add(&acc->set, "notify_handle", NULL, NULL, acc); + s = set_add(&acc->set, "mail_notifications_handle", NULL, NULL, acc); s->flags |= ACC_SET_OFFLINE_ONLY | SET_NULL_OK; } @@ -335,8 +335,8 @@ static void purple_login(account_t *acc) purple_account_set_enabled(pd->account, "BitlBee", TRUE); - if (set_getbool(&acc->set, "mail_notifications") && set_getstr(&acc->set, "notify_handle")) { - imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + 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); } } diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 2df454f3..9da12949 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -127,7 +127,7 @@ static void byahoo_init(account_t *acc) s = set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc); s->flags |= ACC_SET_OFFLINE_ONLY; - s = set_add(&acc->set, "notify_handle", NULL, NULL, acc); + 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; @@ -151,8 +151,8 @@ static void byahoo_login(account_t *acc) 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, "notify_handle")) { - imcb_add_buddy(ic, set_getstr(&acc->set, "notify_handle"), NULL); + 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); } } -- cgit v1.2.3 From 6191263b71f7060e7d0d754db519599bbb71a802 Mon Sep 17 00:00:00 2001 From: zer0def Date: Thu, 28 May 2015 09:34:21 +0200 Subject: Fixes 'Provides' in debian control file --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4feedb5f..49251a5f 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Description: An IRC to other chat networks gateway (default version) Package: bitlbee-libpurple Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, debianutils (>= 1.16), bitlbee-common (= ${source:Version}) -Provides: bitlbee +Provides: bitlbee (= ${source:Version}) Conflicts: bitlbee Replaces: bitlbee Description: An IRC to other chat networks gateway (using libpurple) -- cgit v1.2.3