aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <gdesmott@gnome.org>2008-01-07 02:17:15 +0800
committerGuillaume Desmottes <gdesmott@gnome.org>2008-01-07 02:17:15 +0800
commit325ef172206fa2618287729d5285d339448966b9 (patch)
treea3025b700bfb0441b330397463b87dafc9473968 /libempathy
parent81cf7d6a9f836d380d913de3de48ee9122af88f7 (diff)
downloadgsoc2013-empathy-325ef172206fa2618287729d5285d339448966b9.tar
gsoc2013-empathy-325ef172206fa2618287729d5285d339448966b9.tar.gz
gsoc2013-empathy-325ef172206fa2618287729d5285d339448966b9.tar.bz2
gsoc2013-empathy-325ef172206fa2618287729d5285d339448966b9.tar.lz
gsoc2013-empathy-325ef172206fa2618287729d5285d339448966b9.tar.xz
gsoc2013-empathy-325ef172206fa2618287729d5285d339448966b9.tar.zst
gsoc2013-empathy-325ef172206fa2618287729d5285d339448966b9.zip
empathy-irc-network: empathy_irc_network_get_servers returns a list of refed servers
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-irc-network.c10
-rw-r--r--libempathy/empathy-irc-network.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/libempathy/empathy-irc-network.c b/libempathy/empathy-irc-network.c
index 40d6b77f1..14bbe91f8 100644
--- a/libempathy/empathy-irc-network.c
+++ b/libempathy/empathy-irc-network.c
@@ -193,15 +193,21 @@ empathy_irc_network_new (const gchar *id,
NULL);
}
-const GSList *
+GSList *
empathy_irc_network_get_servers (EmpathyIrcNetwork *self)
{
EmpathyIrcNetworkPrivate *priv;
+ GSList *servers = NULL, *l;
g_return_val_if_fail (EMPATHY_IS_IRC_NETWORK (self), NULL);
priv = EMPATHY_IRC_NETWORK_GET_PRIVATE (self);
- return priv->servers;
+ for (l = priv->servers; l != NULL; l = g_slist_next (l))
+ {
+ servers = g_slist_prepend (servers, g_object_ref (l->data));
+ }
+
+ return g_slist_reverse (servers);
}
void
diff --git a/libempathy/empathy-irc-network.h b/libempathy/empathy-irc-network.h
index 2abaa8b21..c1412af1e 100644
--- a/libempathy/empathy-irc-network.h
+++ b/libempathy/empathy-irc-network.h
@@ -64,7 +64,7 @@ GType empathy_irc_network_get_type (void);
EmpathyIrcNetwork *
empathy_irc_network_new (const gchar *id, const gchar *name);
-const GSList *
+GSList *
empathy_irc_network_get_servers (EmpathyIrcNetwork *network);
void empathy_irc_network_add_server (EmpathyIrcNetwork *network,