comparison src/protocols/irc/msgs.c @ 6357:1fa4410d2e13

[gaim-migrate @ 6856] Not much--I changed the code to show idle time for irc so it uses the core sec_to_text function or whatever it's called. THEN I fixed a compile error, AND THEN I fixed a compile warning, AND NOW I'm commiting. AND THEN the storm released its fury upon the soil ...they should have known because he told them so... committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 02 Aug 2003 15:27:00 +0000
parents ffb1b5003772
children ba0b99a72be2
comparison
equal deleted inserted replaced
6356:ee0044f3e377 6357:1fa4410d2e13
169 void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args) 169 void irc_msg_endwhois(struct irc_conn *irc, const char *name, const char *from, char **args)
170 { 170 {
171 GaimConnection *gc; 171 GaimConnection *gc;
172 GString *info; 172 GString *info;
173 char *str; 173 char *str;
174 int idle_days, idle_hours, idle_minutes, idle_seconds;
175 174
176 if (!irc->whois.nick) { 175 if (!irc->whois.nick) {
177 gaim_debug(GAIM_DEBUG_WARNING, "irc", "Unexpected End of WHOIS for %s\n", args[1]); 176 gaim_debug(GAIM_DEBUG_WARNING, "irc", "Unexpected End of WHOIS for %s\n", args[1]);
178 return; 177 return;
179 } 178 }
204 if (irc->whois.channels) { 203 if (irc->whois.channels) {
205 g_string_append_printf(info, "<b>%s:</b> %s<br>", _("Currently on"), irc->whois.channels); 204 g_string_append_printf(info, "<b>%s:</b> %s<br>", _("Currently on"), irc->whois.channels);
206 g_free(irc->whois.channels); 205 g_free(irc->whois.channels);
207 } 206 }
208 if (irc->whois.idle) { 207 if (irc->whois.idle) {
209 idle_days=irc->whois.idle / 86400; 208 gchar *timex = sec_to_text(irc->whois.idle);
210 idle_hours=(irc->whois.idle % 86400) / 3600; 209 g_string_append_printf(info, _("<b>Idle for:</b> %s<br>"), timex);
211 idle_minutes=(irc->whois.idle % 3600) / 60; 210 g_free(timex);
212 idle_seconds=irc->whois.idle % 60;
213 g_string_append_printf(info, ngettext(
214 "<b>Idle for:</b> %d day, %02d:%02d:%02d<br>",
215 "<b>Idle for:</b> %d days, %02d:%02d:%02d<br>",
216 idle_days),
217 idle_days, idle_hours, idle_minutes, idle_seconds);
218 g_string_append_printf(info, "<b>%s:</b> %s", _("Online since"), ctime(&irc->whois.signon)); 211 g_string_append_printf(info, "<b>%s:</b> %s", _("Online since"), ctime(&irc->whois.signon));
219 } 212 }
220 if (!strcmp(irc->whois.nick, "Paco-Paco")) { 213 if (!strcmp(irc->whois.nick, "Paco-Paco")) {
221 g_string_append_printf(info, _("<br><b>Defining adjective:</b> Glorious<br>")); 214 g_string_append_printf(info, _("<br><b>Defining adjective:</b> Glorious<br>"));
222 } 215 }