changeset 5520:11be8ae32937

[gaim-migrate @ 5920] E-mail notification uses the new API. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 26 May 2003 00:52:24 +0000
parents 42a20beb80a7
children 76ec14ba51d7
files src/protocols/msn/notification.c
diffstat 1 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/notification.c	Mon May 26 00:51:23 2003 +0000
+++ b/src/protocols/msn/notification.c	Mon May 26 00:52:24 2003 +0000
@@ -1224,6 +1224,9 @@
 		return TRUE;
 	}
 
+	if (!GAIM_ACCOUNT_CHECK_MAIL(session->account))
+		return TRUE;
+
 	if (session->passport_info.file == NULL) {
 		msn_servconn_send_command(servconn, "URL", "INBOX");
 
@@ -1236,9 +1239,13 @@
 
 	unread = g_hash_table_lookup(table, "Inbox-Unread");
 
-	if (unread != NULL)
-		connection_has_mail(gc, atoi(unread), NULL, NULL,
-							session->passport_info.file);
+	if (unread != NULL) {
+		const char *passport = msn_user_get_passport(session->user);
+		const char *url = session->passport_info.file;
+
+		gaim_notify_emails(gc, atoi(unread), FALSE, NULL, NULL,
+						   &passport, &url, NULL, NULL);
+	}
 
 	g_hash_table_destroy(table);
 
@@ -1258,6 +1265,9 @@
 		return TRUE;
 	}
 
+	if (!GAIM_ACCOUNT_CHECK_MAIL(session->account))
+		return TRUE;
+
 	if (session->passport_info.file == NULL) {
 		msn_servconn_send_command(servconn, "URL", "INBOX");
 
@@ -1271,13 +1281,8 @@
 	from    = g_hash_table_lookup(table, "From");
 	subject = g_hash_table_lookup(table, "Subject");
 
-	if (from == NULL || subject == NULL) {
-		connection_has_mail(gc, 1, NULL, NULL, session->passport_info.file);
-	}
-	else {
-		connection_has_mail(gc, -1, from, subject,
-							session->passport_info.file);
-	}
+	gaim_notify_email(gc, subject, from, msn_user_get_passport(session->user),
+					  session->passport_info.file, NULL, NULL);
 
 	g_hash_table_destroy(table);