Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 7388:37384bd2f1b0
[gaim-migrate @ 7983]
How's this?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 30 Oct 2003 23:34:54 +0000 |
parents | 414c701ef1ff |
children | 22ed0a0c003d |
comparison
equal
deleted
inserted
replaced
7387:86933f4e7fb8 | 7388:37384bd2f1b0 |
---|---|
3888 { | 3888 { |
3889 aim_icq_ackofflinemsgs(sess); | 3889 aim_icq_ackofflinemsgs(sess); |
3890 return 1; | 3890 return 1; |
3891 } | 3891 } |
3892 | 3892 |
3893 /* This function was recommended by the STRFTIME(3) man page to remove the | 3893 #if 0 |
3894 /* | |
3895 * It may not be my place to do this, but... | |
3896 * I feel pretty strongly that the "last 2 digits" warning is ridiculously | |
3897 * stupid, and should not exist for % switches (%x in our case) that request | |
3898 * a year in the preferred representation for the current locale. For that | |
3899 * reason I've chosen to not use this workaround (n., see kluge). | |
3900 * | |
3901 * I have a date. I want to show it to the user in the "preferred" way. | |
3902 * Whether that displays a 2 digit year is perfectly fine--after all, it's | |
3903 * what the locale wanted. | |
3904 * | |
3905 * If I have a necessity for a full representation of the year in the current | |
3906 * locale, then I'll use a switch that returns a full representation of the | |
3907 * year. | |
3908 * | |
3909 * If you think the preferred locale should show 4 digits instead of 2 digits | |
3910 * (because you're anal, or whatever), then change the f***ing locale. | |
3911 * | |
3912 * I guess the bottom line is--I'm trying to show a date to the user how they | |
3913 * prefer to see it, why the hell does gcc want me to change that? | |
3914 */ | |
3915 | |
3916 /* | |
3917 * This function was recommended by the STRFTIME(3) man page to remove the | |
3894 * "last 2 digits" warning. | 3918 * "last 2 digits" warning. |
3895 */ | 3919 */ |
3896 static size_t my_strftime(char *s, size_t max, const char *fmt, | 3920 static size_t my_strftime(char *s, size_t max, const char *fmt, |
3897 const struct tm *tm) | 3921 const struct tm *tm) |
3898 { | 3922 { |
3899 return strftime(s, max, fmt, tm); | 3923 return strftime(s, max, fmt, tm); |
3900 } | 3924 } |
3925 #endif | |
3901 | 3926 |
3902 static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...) | 3927 static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...) |
3903 { | 3928 { |
3904 GaimConnection *gc = sess->aux_data; | 3929 GaimConnection *gc = sess->aux_data; |
3905 gchar *buf, *tmp, *utf8; | 3930 gchar *buf, *tmp, *utf8; |
3948 char date[30]; | 3973 char date[30]; |
3949 struct tm tm; | 3974 struct tm tm; |
3950 tm.tm_mday = (int)info->birthday; | 3975 tm.tm_mday = (int)info->birthday; |
3951 tm.tm_mon = (int)info->birthmonth-1; | 3976 tm.tm_mon = (int)info->birthmonth-1; |
3952 tm.tm_year = (int)info->birthyear-1900; | 3977 tm.tm_year = (int)info->birthyear-1900; |
3953 my_strftime(date, sizeof(date), "%x", &tm); | 3978 strftime(date, sizeof(date), "%x", &tm); |
3954 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Birthday"), ":</b> ", date, NULL); g_free(tmp); | 3979 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Birthday"), ":</b> ", date, NULL); g_free(tmp); |
3955 } | 3980 } |
3956 if (info->age) { | 3981 if (info->age) { |
3957 char age[5]; | 3982 char age[5]; |
3958 snprintf(age, sizeof(age), "%hhd", info->age); | 3983 snprintf(age, sizeof(age), "%hhd", info->age); |