comparison libpurple/protocols/irc/msgs.c @ 16422:6447865b2d08

/whowas for IRC. Thanks, achris.
author Ethan Blanton <elb@pidgin.im>
date Wed, 25 Apr 2007 16:03:24 +0000
parents 1980273186a4
children a82444e61ece
comparison
equal deleted inserted replaced
16421:ac2c14628790 16422:6447865b2d08
234 } 234 }
235 235
236 void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args) 236 void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args)
237 { 237 {
238 if (!irc->whois.nick) { 238 if (!irc->whois.nick) {
239 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unexpected WHOIS reply for %s\n", args[1]); 239 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unexpected %s reply for %s\n", !strcmp(name, "314") ? "WHOWAS" : "WHOIS"
240 , args[1]);
240 return; 241 return;
241 } 242 }
242 243
243 if (purple_utf8_strcasecmp(irc->whois.nick, args[1])) { 244 if (purple_utf8_strcasecmp(irc->whois.nick, args[1])) {
244 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Got WHOIS reply for %s while waiting for %s\n", args[1], irc->whois.nick); 245 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Got %s reply for %s while waiting for %s\n", !strcmp(name, "314") ? "WHOWAS" : "WHOIS"
246 , args[1], irc->whois.nick);
245 return; 247 return;
246 } 248 }
247 249
248 if (!strcmp(name, "301")) { 250 if (!strcmp(name, "301")) {
249 irc->whois.away = g_strdup(args[2]); 251 irc->whois.away = g_strdup(args[2]);
250 } else if (!strcmp(name, "311")) { 252 } else if (!strcmp(name, "311") || !strcmp(name, "314")) {
251 irc->whois.userhost = g_strdup_printf("%s@%s", args[2], args[3]); 253 irc->whois.userhost = g_strdup_printf("%s@%s", args[2], args[3]);
252 irc->whois.name = g_strdup(args[5]); 254 irc->whois.name = g_strdup(args[5]);
253 } else if (!strcmp(name, "312")) { 255 } else if (!strcmp(name, "312")) {
254 irc->whois.server = g_strdup(args[2]); 256 irc->whois.server = g_strdup(args[2]);
255 irc->whois.serverinfo = g_strdup(args[3]); 257 irc->whois.serverinfo = g_strdup(args[3]);
271 PurpleConnection *gc; 273 PurpleConnection *gc;
272 char *tmp, *tmp2; 274 char *tmp, *tmp2;
273 PurpleNotifyUserInfo *user_info; 275 PurpleNotifyUserInfo *user_info;
274 276
275 if (!irc->whois.nick) { 277 if (!irc->whois.nick) {
276 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unexpected End of WHOIS for %s\n", args[1]); 278 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unexpected End of %s for %s\n", !strcmp(name, "369") ? "WHOWAS" : "WHOIS"
279 , args[1]);
277 return; 280 return;
278 } 281 }
279 if (purple_utf8_strcasecmp(irc->whois.nick, args[1])) { 282 if (purple_utf8_strcasecmp(irc->whois.nick, args[1])) {
280 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Received end of WHOIS for %s, expecting %s\n", args[1], irc->whois.nick); 283 purple_debug(PURPLE_DEBUG_WARNING, "irc", "Received end of %s for %s, expecting %s\n", !strcmp(name, "369") ? "WHOWAS" : "WHOIS"
284 , args[1], irc->whois.nick);
281 return; 285 return;
282 } 286 }
283 287
284 user_info = purple_notify_user_info_new(); 288 user_info = purple_notify_user_info_new();
285 289