comparison src/protocols/msn/notification.c @ 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 bf2a7a7b739d
children 187c740f2a4e
comparison
equal deleted inserted replaced
5519:42a20beb80a7 5520:11be8ae32937
1222 if (strcmp(servconn->msg_passport, "Hotmail")) { 1222 if (strcmp(servconn->msg_passport, "Hotmail")) {
1223 /* This isn't an official message. */ 1223 /* This isn't an official message. */
1224 return TRUE; 1224 return TRUE;
1225 } 1225 }
1226 1226
1227 if (!GAIM_ACCOUNT_CHECK_MAIL(session->account))
1228 return TRUE;
1229
1227 if (session->passport_info.file == NULL) { 1230 if (session->passport_info.file == NULL) {
1228 msn_servconn_send_command(servconn, "URL", "INBOX"); 1231 msn_servconn_send_command(servconn, "URL", "INBOX");
1229 1232
1230 msn_servconn_queue_message(servconn, "URL", msg); 1233 msn_servconn_queue_message(servconn, "URL", msg);
1231 1234
1234 1237
1235 table = msn_message_get_hashtable_from_body(msg); 1238 table = msn_message_get_hashtable_from_body(msg);
1236 1239
1237 unread = g_hash_table_lookup(table, "Inbox-Unread"); 1240 unread = g_hash_table_lookup(table, "Inbox-Unread");
1238 1241
1239 if (unread != NULL) 1242 if (unread != NULL) {
1240 connection_has_mail(gc, atoi(unread), NULL, NULL, 1243 const char *passport = msn_user_get_passport(session->user);
1241 session->passport_info.file); 1244 const char *url = session->passport_info.file;
1245
1246 gaim_notify_emails(gc, atoi(unread), FALSE, NULL, NULL,
1247 &passport, &url, NULL, NULL);
1248 }
1242 1249
1243 g_hash_table_destroy(table); 1250 g_hash_table_destroy(table);
1244 1251
1245 return TRUE; 1252 return TRUE;
1246 } 1253 }
1256 if (strcmp(servconn->msg_passport, "Hotmail")) { 1263 if (strcmp(servconn->msg_passport, "Hotmail")) {
1257 /* This isn't an official message. */ 1264 /* This isn't an official message. */
1258 return TRUE; 1265 return TRUE;
1259 } 1266 }
1260 1267
1268 if (!GAIM_ACCOUNT_CHECK_MAIL(session->account))
1269 return TRUE;
1270
1261 if (session->passport_info.file == NULL) { 1271 if (session->passport_info.file == NULL) {
1262 msn_servconn_send_command(servconn, "URL", "INBOX"); 1272 msn_servconn_send_command(servconn, "URL", "INBOX");
1263 1273
1264 msn_servconn_queue_message(servconn, "URL", msg); 1274 msn_servconn_queue_message(servconn, "URL", msg);
1265 1275
1269 table = msn_message_get_hashtable_from_body(msg); 1279 table = msn_message_get_hashtable_from_body(msg);
1270 1280
1271 from = g_hash_table_lookup(table, "From"); 1281 from = g_hash_table_lookup(table, "From");
1272 subject = g_hash_table_lookup(table, "Subject"); 1282 subject = g_hash_table_lookup(table, "Subject");
1273 1283
1274 if (from == NULL || subject == NULL) { 1284 gaim_notify_email(gc, subject, from, msn_user_get_passport(session->user),
1275 connection_has_mail(gc, 1, NULL, NULL, session->passport_info.file); 1285 session->passport_info.file, NULL, NULL);
1276 }
1277 else {
1278 connection_has_mail(gc, -1, from, subject,
1279 session->passport_info.file);
1280 }
1281 1286
1282 g_hash_table_destroy(table); 1287 g_hash_table_destroy(table);
1283 1288
1284 return TRUE; 1289 return TRUE;
1285 } 1290 }