changeset 18115:871d9aa8e51c

Re-apply a good change from 1411afd7660760db59966c3a9f18e2adab8eb27e: Clarify some code so it doesn't look like people should modify the lists returned by purple_conv_chat_get_ignored() or purple_conv_chat_get_users().
author Richard Laager <rlaager@wiktel.com>
date Sat, 16 Jun 2007 19:08:51 +0000
parents 873ee0038752
children ee0899360e8b
files libpurple/conversation.c
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/conversation.c	Sat Jun 16 19:00:52 2007 +0000
+++ b/libpurple/conversation.c	Sat Jun 16 19:08:51 2007 +0000
@@ -1269,7 +1269,7 @@
 		return;
 
 	purple_conv_chat_set_ignored(chat,
-		g_list_append(purple_conv_chat_get_ignored(chat), g_strdup(name)));
+		g_list_append(chat->ignored, g_strdup(name)));
 }
 
 void
@@ -1288,7 +1288,7 @@
 					   purple_conv_chat_get_ignored_user(chat, name));
 
 	purple_conv_chat_set_ignored(chat,
-		g_list_remove_link(purple_conv_chat_get_ignored(chat), item));
+		g_list_remove_link(chat->ignored, item));
 
 	g_free(item->data);
 	g_list_free_1(item);
@@ -1565,7 +1565,7 @@
 		cbuddy = purple_conv_chat_cb_new(user, alias, flag);
 		/* This seems dumb. Why should we set users thousands of times? */
 		purple_conv_chat_set_users(chat,
-				g_list_prepend(purple_conv_chat_get_users(chat), cbuddy));
+				g_list_prepend(chat->in_room, cbuddy));
 
 		cbuddies = g_list_prepend(cbuddies, cbuddy);
 
@@ -1634,7 +1634,7 @@
 	flags = purple_conv_chat_user_get_flags(chat, old_user);
 	cb = purple_conv_chat_cb_new(new_user, NULL, flags);
 	purple_conv_chat_set_users(chat,
-		g_list_prepend(purple_conv_chat_get_users(chat), cb));
+		g_list_prepend(chat->in_room, cb));
 
 	if (!strcmp(chat->nick, purple_normalize(conv->account, old_user))) {
 		const char *alias;
@@ -1666,7 +1666,7 @@
 
 	if (cb) {
 		purple_conv_chat_set_users(chat,
-				g_list_remove(purple_conv_chat_get_users(chat), cb));
+				g_list_remove(chat->in_room, cb));
 		purple_conv_chat_cb_destroy(cb);
 	}
 
@@ -1760,7 +1760,7 @@
 
 		if (cb) {
 			purple_conv_chat_set_users(chat,
-					g_list_remove(purple_conv_chat_get_users(chat), cb));
+					g_list_remove(chat->in_room, cb));
 			purple_conv_chat_cb_destroy(cb);
 		}
 
@@ -1809,14 +1809,15 @@
 {
 	PurpleConversation *conv;
 	PurpleConversationUiOps *ops;
-	GList *users, *names = NULL;
+	GList *users;
 	GList *l;
+	GList *names = NULL;
 
 	g_return_if_fail(chat != NULL);
 
 	conv  = purple_conv_chat_get_conversation(chat);
 	ops   = purple_conversation_get_ui_ops(conv);
-	users = purple_conv_chat_get_users(chat);
+	users = chat->in_room;
 
 	if (ops != NULL && ops->chat_remove_users != NULL) {
 		for (l = users; l; l = l->next) {