diff src/protocols/irc/msgs.c @ 8114:7a6e30eb7aad

[gaim-migrate @ 8818] Thanks to Tim Ringenbach for this IRC chat list. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Thu, 15 Jan 2004 22:53:07 +0000
parents 828856b7fe30
children da57fb60680a
line wrap: on
line diff
--- a/src/protocols/irc/msgs.c	Thu Jan 15 22:20:29 2004 +0000
+++ b/src/protocols/irc/msgs.c	Thu Jan 15 22:53:07 2004 +0000
@@ -223,6 +223,36 @@
 	memset(&irc->whois, 0, sizeof(irc->whois));
 }
 
+void irc_msg_list(struct irc_conn *irc, const char *name, const char *from, char **args)
+{
+	if (!irc->roomlist)
+		return;
+
+	if (!strcmp(name, "321")) {
+		gaim_roomlist_set_in_progress(irc->roomlist, TRUE);
+		return;
+	}
+
+	if (!strcmp(name, "323")) {
+		gaim_roomlist_set_in_progress(irc->roomlist, FALSE);
+		gaim_roomlist_unref(irc->roomlist);
+		irc->roomlist = NULL;
+	}
+
+	if (!strcmp(name, "322")) {
+		GaimRoomlistRoom *room;
+
+		if (!args[0] || !args[1] || !args[2] || !args[3])
+			return;
+
+		room = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_ROOM, args[1], NULL);
+		gaim_roomlist_room_add_field(irc->roomlist, room, args[1]);
+		gaim_roomlist_room_add_field(irc->roomlist, room, GINT_TO_POINTER(strtol(args[2], NULL, 10)));
+		gaim_roomlist_room_add_field(irc->roomlist, room, args[3]);
+		gaim_roomlist_room_add(irc->roomlist, room);
+	}
+}
+
 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	char *chan, *topic, *msg, *nick;