cpw.maiku.media_refactor: 7cb8ef8a: Keep track of participants better in pur...
maiku at pidgin.im
maiku at pidgin.im
Wed Oct 28 16:12:24 EDT 2009
-----------------------------------------------------------------
Revision: 7cb8ef8a9c5ff7bc90ee9eef93540c25bc5a4ab0
Ancestor: 917b1904577a5f9eef32a98c97aa5cef4514e010
Author: maiku at pidgin.im
Date: 2009-10-28T18:24:10
Branch: im.pidgin.cpw.maiku.media_refactor
URL: http://d.pidgin.im/viewmtn/revision/info/7cb8ef8a9c5ff7bc90ee9eef93540c25bc5a4ab0
Modified files:
libpurple/media/media.c
ChangeLog:
Keep track of participants better in purple_media_stream_info.
-------------- next part --------------
============================================================
--- libpurple/media/media.c b204c8c793a4a57a222f53fbdc9d65551c3668cc
+++ libpurple/media/media.c c9e4c5a2c15be6c485355c450677401dabadd94e
@@ -809,7 +809,7 @@ purple_media_stream_info(PurpleMedia *me
return;
} else if (type == PURPLE_MEDIA_INFO_HANGUP ||
type == PURPLE_MEDIA_INFO_REJECT) {
- GList *streams, *participants = NULL;
+ GList *streams;
g_return_if_fail(PURPLE_IS_MEDIA(media));
@@ -825,12 +825,6 @@ purple_media_stream_info(PurpleMedia *me
purple_media_signals[STREAM_INFO],
0, type, stream->session->id,
stream->participant, local);
-
- if (g_list_find_custom(participants,
- stream->participant,
- (GCompareFunc)strcmp) == NULL)
- participants = g_list_prepend(participants,
- g_strdup(stream->participant));
}
if (session_id != NULL && participant != NULL) {
@@ -839,6 +833,7 @@ purple_media_stream_info(PurpleMedia *me
/* Emit for everything in the conference */
GList *sessions = g_hash_table_get_values(
media->priv->sessions);
+ GList *participants = media->priv->participants;
/* Emit for sessions */
for (; sessions; sessions = g_list_delete_link(
@@ -852,15 +847,12 @@ purple_media_stream_info(PurpleMedia *me
/* Emit for participants */
for (; participants; participants =
- g_list_delete_link(
- participants, participants)) {
+ g_list_next(participants)) {
gchar *participant = participants->data;
g_signal_emit(media, purple_media_signals[
STREAM_INFO], 0, type,
NULL, participant, local);
-
- g_free(participant);
}
/* Emit for conference */
@@ -884,7 +876,7 @@ purple_media_stream_info(PurpleMedia *me
}
} else if (participant != NULL) {
/* Emit just the specific participant */
- if (!g_list_find_custom(participants,
+ if (!g_list_find_custom(media->priv->participants,
participant, (GCompareFunc)strcmp)) {
purple_debug_warning("media",
"Couldn't find participant"
@@ -896,12 +888,6 @@ purple_media_stream_info(PurpleMedia *me
}
}
- /* Clear participants if any remain */
- for (; participants; participants = g_list_delete_link(
- participants, participants)) {
- g_free(participants->data);
- }
-
purple_media_end(media, session_id, participant);
return;
}
More information about the Commits
mailing list