Mercurial > pidgin.yaz
diff src/conversation.c @ 6414:874a5c9f4eb8
[gaim-migrate @ 6921]
Added gaim_chat_clear_users().
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 08 Aug 2003 19:48:50 +0000 |
parents | ba0b99a72be2 |
children | 9c65a439d327 |
line wrap: on
line diff
--- a/src/conversation.c Fri Aug 08 02:34:13 2003 +0000 +++ b/src/conversation.c Fri Aug 08 19:48:50 2003 +0000 @@ -2119,6 +2119,40 @@ } } +void +gaim_chat_clear_users(GaimChat *chat) +{ + GaimConversation *conv; + GaimConversationUiOps *ops; + GList *users; + GList *l, *l_next; + + g_return_if_fail(chat != NULL); + + conv = gaim_chat_get_conversation(chat); + ops = gaim_conversation_get_ui_ops(conv); + users = gaim_chat_get_users(chat); + + if (ops != NULL && ops->chat_remove_users != NULL) + ops->chat_remove_users(conv, users); + + for (l = users; l != NULL; l = l_next) + { + char *user = (char *)l->data; + + l_next = l->next; + + gaim_event_broadcast(event_chat_buddy_leave, + gaim_conversation_get_gc(conv), + gaim_chat_get_id(chat), user); + + g_free(user); + } + + g_list_free(users); + gaim_chat_set_users(chat, NULL); +} + GaimConversation * gaim_find_chat(const GaimConnection *gc, int id) {