| 1687 |
1687 |
| 1688 oscar_free_name_data(data); |
1688 oscar_free_name_data(data); |
| 1689 } |
1689 } |
| 1690 |
1690 |
| 1691 static int |
1691 static int |
| 1692 incomingim_chan4(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args, time_t t) |
1692 incomingim_chan4(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, |
| |
1693 struct aim_incomingim_ch4_args *args) |
| 1693 { |
1694 { |
| 1694 PurpleConnection *gc = od->gc; |
1695 PurpleConnection *gc = od->gc; |
| 1695 PurpleAccount *account = purple_connection_get_account(gc); |
1696 PurpleAccount *account = purple_connection_get_account(gc); |
| 1696 gchar **msg1, **msg2; |
1697 gchar **msg1, **msg2; |
| 1697 int i, numtoks; |
1698 int i, numtoks; |
| 1732 gchar *tmp; |
1733 gchar *tmp; |
| 1733 |
1734 |
| 1734 /* If the message came from an ICQ user then escape any HTML */ |
1735 /* If the message came from an ICQ user then escape any HTML */ |
| 1735 tmp = g_markup_escape_text(msg2[0], -1); |
1736 tmp = g_markup_escape_text(msg2[0], -1); |
| 1736 |
1737 |
| 1737 if (t) { /* This is an offline message */ |
1738 purple_serv_got_im(gc, uin, tmp, 0, time(NULL)); |
| 1738 /* The timestamp is UTC-ish, so we need to get the offset */ |
1739 |
| 1739 #ifdef HAVE_TM_GMTOFF |
|
| 1740 time_t now; |
|
| 1741 struct tm *tm; |
|
| 1742 now = time(NULL); |
|
| 1743 tm = localtime(&now); |
|
| 1744 t += tm->tm_gmtoff; |
|
| 1745 #else |
|
| 1746 # ifdef HAVE_TIMEZONE |
|
| 1747 tzset(); |
|
| 1748 t -= timezone; |
|
| 1749 # endif |
|
| 1750 #endif |
|
| 1751 purple_serv_got_im(gc, uin, tmp, 0, t); |
|
| 1752 } else { /* This is a message from MacICQ/Miranda */ |
|
| 1753 purple_serv_got_im(gc, uin, tmp, 0, time(NULL)); |
|
| 1754 } |
|
| 1755 g_free(uin); |
1740 g_free(uin); |
| 1756 g_free(tmp); |
1741 g_free(tmp); |
| 1757 } |
1742 } |
| 1758 } break; |
1743 } break; |
| 1759 |
1744 |
| 1980 } break; |
1965 } break; |
| 1981 |
1966 |
| 1982 case 4: { /* ICQ */ |
1967 case 4: { /* ICQ */ |
| 1983 struct aim_incomingim_ch4_args *args; |
1968 struct aim_incomingim_ch4_args *args; |
| 1984 args = va_arg(ap, struct aim_incomingim_ch4_args *); |
1969 args = va_arg(ap, struct aim_incomingim_ch4_args *); |
| 1985 ret = incomingim_chan4(od, conn, userinfo, args, 0); |
1970 ret = incomingim_chan4(od, conn, userinfo, args); |
| 1986 } break; |
1971 } break; |
| 1987 |
1972 |
| 1988 default: { |
1973 default: { |
| 1989 purple_debug_warning("oscar", |
1974 purple_debug_warning("oscar", |
| 1990 "ICBM received on unsupported channel (channel " |
1975 "ICBM received on unsupported channel (channel " |