Changeset faeb521 for protocols/jabber
- Timestamp:
- 2015-05-28T05:26:30Z (10 years ago)
- Branches:
- master
- Children:
- 0864a52
- Parents:
- dd43c62
- git-author:
- dequis <dx@…> (08-05-15 03:26:19)
- git-committer:
- dequis <dx@…> (28-05-15 05:26:30)
- Location:
- protocols/jabber
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
rdd43c62 rfaeb521 793 793 guint64 l_time = 0; 794 794 char *tid = NULL; 795 int max = 0; 795 796 796 797 if (!(c = xt_find_node(node->children, "mailbox")) || … … 802 803 } 803 804 805 max = set_getint(&ic->acc->set, "gmail_notifications_limit"); 804 806 c = c->children; 805 807 806 while (( c = xt_find_node(c, "mail-thread-info"))) {807 struct xt_node * thread, *s;808 char *subject = NULL;809 char *s nippet = NULL;808 while ((max-- > 0) && (c = xt_find_node(c, "mail-thread-info"))) { 809 struct xt_node *s; 810 char *subject = "<no subject>"; 811 char *sender = "<no sender>"; 810 812 char *msg = NULL; 811 813 guint64 t_time; … … 817 819 } 818 820 819 thread = c->children; 820 821 if ((s = xt_find_node(thread, "subject"))) { 821 if ((s = xt_find_node(c->children, "senders")) && 822 (s = xt_find_node_by_attr(s->children, "sender", "unread", "1"))) { 823 sender = xt_find_attr(s, "name"); 824 } 825 826 if ((s = xt_find_node(c->children, "subject")) && s->text) { 822 827 subject = s->text; 823 828 } 824 829 825 if ((s = xt_find_node(thread, "snippet"))) { 826 snippet = s->text; 827 } 828 829 if (subject) { 830 msg = g_strdup_printf("New mail for %s. Subj: %s", from, subject); 831 } else { 832 msg = g_strdup_printf("New mail for %s.", from); 833 } 830 msg = g_strdup_printf("New mail from %s: %s", sender, subject); 831 834 832 imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), msg, 0, 0); 835 836 if (snippet) {837 imcb_notify_email(ic, set_getstr(&ic->acc->set, "notify_handle"), snippet, 0, 0);838 }839 833 840 834 c = c->next; -
protocols/jabber/jabber.c
rdd43c62 rfaeb521 103 103 s = set_add(&acc->set, "gmail_notifications", "false", set_eval_bool, acc); 104 104 s->flags |= ACC_SET_OFFLINE_ONLY; 105 106 /* changing this is rarely needed so keeping it secret */ 107 s = set_add(&acc->set, "gmail_notifications_limit", "5", set_eval_int, acc); 108 s->flags |= SET_HIDDEN_DEFAULT; 105 109 106 110 s = set_add(&acc->set, "notify_handle", NULL, NULL, acc);
Note: See TracChangeset
for help on using the changeset viewer.