pidgin.vv: ce87350c: Added purple_media_manager_get_media_by_...
maiku at soc.pidgin.im
maiku at soc.pidgin.im
Wed Feb 25 00:25:29 EST 2009
-----------------------------------------------------------------
Revision: ce87350cff994c5663e5836d5cdac8d2bb13af48
Ancestor: 1861747ecccdbea47628d876a4faf6ca727065cb
Author: maiku at soc.pidgin.im
Date: 2009-02-25T03:28:27
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/ce87350cff994c5663e5836d5cdac8d2bb13af48
Modified files:
libpurple/mediamanager.c libpurple/mediamanager.h
ChangeLog:
Added purple_media_manager_get_media_by_connection.
-------------- next part --------------
============================================================
--- libpurple/mediamanager.c 0e52593880048b45eaf1aa1112a7f6b8551fe616
+++ libpurple/mediamanager.c 200d4f5c04ce0923fcb6e3ae22a238ea41151d68
@@ -273,6 +273,25 @@ purple_media_manager_get_media(PurpleMed
return manager->priv->medias;
}
+GList *
+purple_media_manager_get_media_by_connection(PurpleMediaManager *manager,
+ PurpleConnection *pc)
+{
+ GList *media = NULL;
+ GList *iter;
+
+ g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL);
+
+ iter = manager->priv->medias;
+ for (; iter; iter = g_list_next(iter)) {
+ if (purple_media_get_connection(iter->data) == pc) {
+ media = g_list_prepend(media, iter->data);
+ }
+ }
+
+ return media;
+}
+
void
purple_media_manager_remove_media(PurpleMediaManager *manager,
PurpleMedia *media)
============================================================
--- libpurple/mediamanager.h a97d2d3a8d8103b4c1ce5a3e21ebc363c9522456
+++ libpurple/mediamanager.h a436c4485740b10b87c076bd0d69a1d2b62cbc40
@@ -156,6 +156,17 @@ GList *purple_media_manager_get_media(Pu
GList *purple_media_manager_get_media(PurpleMediaManager *manager);
/**
+ * Gets all of the media sessions for a given connection.
+ *
+ * @param manager The media manager to get the sessions from.
+ * @param pc The connection the sessions are on.
+ *
+ * @return A list of the media sessions on the given connection.
+ */
+GList *purple_media_manager_get_media_by_connection(
+ PurpleMediaManager *manager, PurpleConnection *pc);
+
+/**
* Removes a media session from the media manager.
*
* @param manager The media manager to remove the media session from.
More information about the Commits
mailing list