comparison src/gtkpounce.c @ 13104:e1e5462b7d81

[gaim-migrate @ 15466] Rework lots of date parsing. I either introduced a whole lot of bugs, or I've made sure all dates are localized properly now. Only time will tell which it is... ;) committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 02 Feb 2006 19:50:51 +0000
parents 0aa231ebbfd5
children fcde3faa1f57
comparison
equal deleted inserted replaced
13103:a6811e213977 13104:e1e5462b7d81
1429 conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, pouncee); 1429 conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, pouncee);
1430 } 1430 }
1431 1431
1432 if (gaim_pounce_action_is_enabled(pounce, "popup-notify")) 1432 if (gaim_pounce_action_is_enabled(pounce, "popup-notify"))
1433 { 1433 {
1434 time_t now = time(NULL);
1435 char date[64];
1436 char *tmp; 1434 char *tmp;
1437 const char *name_shown; 1435 const char *name_shown;
1438 const char *reason; 1436 const char *reason;
1439 reason = gaim_pounce_action_get_attribute(pounce, "popup-notify", 1437 reason = gaim_pounce_action_get_attribute(pounce, "popup-notify",
1440 "reason"); 1438 "reason");
1471 * name if that's all we have 1469 * name if that's all we have
1472 */ 1470 */
1473 if ((name_shown = gaim_account_get_alias(account)) == NULL) 1471 if ((name_shown = gaim_account_get_alias(account)) == NULL)
1474 name_shown = gaim_account_get_username(account); 1472 name_shown = gaim_account_get_username(account);
1475 1473
1476 strftime(date, sizeof(date), "%c", localtime(&now));
1477 if (reason == NULL) 1474 if (reason == NULL)
1478 gaim_notify_info(NULL, name_shown, tmp, date); 1475 gaim_notify_info(NULL, name_shown, tmp, gaim_date_format_full(time(NULL)));
1479 else 1476 else
1480 { 1477 {
1481 char *tmp2 = g_strdup_printf("%s\n\n%s", reason, date); 1478 char *tmp2 = g_strdup_printf("%s\n\n%s", reason, gaim_date_format_full(time(NULL)));
1482 gaim_notify_info(NULL, name_shown, tmp, tmp2); 1479 gaim_notify_info(NULL, name_shown, tmp, tmp2);
1483 g_free(tmp2); 1480 g_free(tmp2);
1484 } 1481 }
1485 g_free(tmp); 1482 g_free(tmp);
1486 } 1483 }