diff -ur pidgin-2.1.1-orig/libpurple/conversation.h pidgin-2.1.1/libpurple/conversation.h --- pidgin-2.1.1-orig/libpurple/conversation.h Mon Aug 20 14:12:48 2007 +++ pidgin-2.1.1/libpurple/conversation.h Wed Aug 29 16:46:17 2007 @@ -133,6 +133,7 @@ PURPLE_CBFLAGS_OP = 0x0004, /**< Channel Op or Moderator */ PURPLE_CBFLAGS_FOUNDER = 0x0008, /**< Channel Founder */ PURPLE_CBFLAGS_TYPING = 0x0010, /**< Currently typing */ + PURPLE_CBFLAGS_AWAY = 0x0020, /**< Currently typing */ } PurpleConvChatBuddyFlags; diff -ur pidgin-2.1.1-orig/libpurple/protocols/irc/irc.h pidgin-2.1.1/libpurple/protocols/irc/irc.h --- pidgin-2.1.1-orig/libpurple/protocols/irc/irc.h Mon Aug 20 14:12:48 2007 +++ pidgin-2.1.1/libpurple/protocols/irc/irc.h Wed Aug 29 16:45:17 2007 @@ -149,6 +149,7 @@ void irc_msg_unavailable(struct irc_conn *irc, const char *name, const char *from, char **args); void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args); void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, char **args); +void irc_msg_who(struct irc_conn *irc, const char *name, const char *from, char **args); void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args); void irc_msg_ignore(struct irc_conn *irc, const char *name, const char *from, char **args); diff -ur pidgin-2.1.1-orig/libpurple/protocols/irc/msgs.c pidgin-2.1.1/libpurple/protocols/irc/msgs.c --- pidgin-2.1.1-orig/libpurple/protocols/irc/msgs.c Mon Aug 20 14:12:48 2007 +++ pidgin-2.1.1/libpurple/protocols/irc/msgs.c Wed Aug 29 17:23:19 2007 @@ -242,6 +242,56 @@ return; } +void irc_msg_who(struct irc_conn *irc, const char *name, const char *from, char **args) +{ + PurpleConversation *convo; + PurpleConvChat *chat; + PurpleConvChatBuddy *cbuddy; + PurpleConvChatBuddyFlags flags; + + /* :kubrick.freenode.net 352 dossy- #aolserver i=dossy mail.panoptic.com irc.freenode.net dossy- H :0 dossy */ + /* :kubrick.freenode.net 352 dossy- #aolserver i=dossy mail.panoptic.com irc.freenode.net dossy- G :0 dossy */ + + if (!args || !args[0] || !args[1] || !args[2] || !args[3] + || !args[4] || !args[5] || !args[6] || !args[7]) + return; + + convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, args[1], irc->account); + if (!convo) { + purple_debug(PURPLE_DEBUG_ERROR, "irc", "Got a WHO list for %s, which doesn't exist\n", args[1]); + return; + } + + chat = PURPLE_CONV_CHAT(convo); + +#if 0 + { + char *buf; + buf = g_strdup_printf("%s %s -- %s %s %s %s %s %s %s %s", + name, from, args[0], args[1], args[2], args[3], + args[4], args[5], args[6], args[7]); + purple_conv_chat_write(PURPLE_CONV_CHAT(convo), "", buf, PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(buf); + } +#endif + + if (!purple_conv_chat_find_user(chat, args[5])) { + purple_debug(PURPLE_DEBUG_ERROR, "irc", "Got a WHO list for %s, nick %s, which doesn't exist\n", args[1], args[5]); + return; + } + + cbuddy = purple_conv_chat_cb_find(chat, args[5]); + if (cbuddy) { + flags = purple_conv_chat_user_get_flags(chat, args[5]); + if (args[6][0] == 'H') { + flags &= ~PURPLE_CBFLAGS_AWAY; + } else { + flags |= PURPLE_CBFLAGS_AWAY; + } + purple_conv_chat_user_set_flags(chat, args[5], flags); + } +} + void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args) { if (!irc->whois.nick) { diff -ur pidgin-2.1.1-orig/libpurple/protocols/irc/parse.c pidgin-2.1.1/libpurple/protocols/irc/parse.c --- pidgin-2.1.1-orig/libpurple/protocols/irc/parse.c Mon Aug 20 14:12:48 2007 +++ pidgin-2.1.1/libpurple/protocols/irc/parse.c Wed Aug 29 17:23:10 2007 @@ -73,6 +73,7 @@ { "331", "nc:", irc_msg_topic }, /* No channel topic */ { "332", "nc:", irc_msg_topic }, /* Channel topic */ { "333", "*", irc_msg_ignore }, /* Topic setter stuff */ + { "352", "ncvvvvv:", irc_msg_who }, /* Who list */ { "353", "nvc:", irc_msg_names }, /* Names list */ { "366", "nc:", irc_msg_names }, /* End of names */ { "372", "n:", irc_msg_motd }, /* MOTD */ diff -ur pidgin-2.1.1-orig/pidgin/gtkconv.c pidgin-2.1.1/pidgin/gtkconv.c --- pidgin-2.1.1-orig/pidgin/gtkconv.c Mon Aug 20 14:12:54 2007 +++ pidgin-2.1.1/pidgin/gtkconv.c Wed Aug 29 17:20:46 2007 @@ -3667,6 +3667,8 @@ image = PIDGIN_STOCK_STATUS_HALFOP; } else if (flags & PURPLE_CBFLAGS_VOICE) { image = PIDGIN_STOCK_STATUS_VOICE; + } else if (flags & PURPLE_CBFLAGS_AWAY) { + image = PIDGIN_STOCK_STATUS_AWAY; } else if ((!flags) && purple_conv_chat_is_user_ignored(chat, name)) { image = PIDGIN_STOCK_STATUS_IGNORED; } else {