Revision 3212 src/inc.c

View differences:

inc.c
207 207
	}
208 208

  
209 209
	if (new_messages > 0 && !block_notify) {
210
		gchar buf[1024];
211 210
		GString *str;
212 211
		gint c = 0;
213 212

  
......
233 232
		trayicon_set_tooltip(str->str);
234 233
		trayicon_set_notify(TRUE);
235 234

  
236
		g_snprintf(buf, sizeof(buf), _("Sylpheed: %d new messages"), new_messages);
237
		g_string_truncate(str, 0);
238
		if (result) {
239
			for (cur = result->msg_summaries; cur != NULL; cur = cur->next) {
240
				IncMsgSummary *summary = cur->data;
241
				gchar *markup;
235
		if (prefs_common.enable_newmsg_notify_window) {
236
			gchar buf[1024];
242 237

  
243
				if (str->len > 0)
244
					g_string_append_c(str, '\n');
245
				markup = g_markup_printf_escaped("<b>%s</b>  %s", summary->subject, summary->from);
246
				g_string_append(str, markup);
247
				g_free(markup);
238
			g_snprintf(buf, sizeof(buf), _("Sylpheed: %d new messages"), new_messages);
239
			g_string_truncate(str, 0);
240
			if (result) {
241
				for (cur = result->msg_summaries; cur != NULL; cur = cur->next) {
242
					IncMsgSummary *summary = cur->data;
243
					gchar *markup;
244

  
245
					if (str->len > 0)
246
						g_string_append_c(str, '\n');
247
					markup = g_markup_printf_escaped("<b>%s</b>  %s", summary->subject, summary->from);
248
					g_string_append(str, markup);
249
					g_free(markup);
250
				}
248 251
			}
252

  
253
			notification_window_create(buf, str->str, 5);
249 254
		}
250 255

  
251
		notification_window_create(buf, str->str, 5);
252

  
253 256
		g_string_free(str, TRUE);
254 257
	}
255 258

  
......
1591 1594
		    fltinfo->actions[FLT_ACTION_MARK_READ] == FALSE) {
1592 1595
			inc_session->new_msgs++;
1593 1596

  
1594
			if (inc_dialog->result && msginfo->subject && g_slist_length(inc_dialog->result->msg_summaries) < 5) {
1597
			if (inc_dialog->result &&
1598
			    msginfo->subject && msginfo->fromname &&
1599
			    g_slist_length(inc_dialog->result->msg_summaries) < 5) {
1595 1600
				IncMsgSummary *summary;
1596 1601
				summary = g_new(IncMsgSummary, 1);
1597 1602
				summary->subject = g_strdup(msginfo->subject);

Also available in: Unified diff