aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-11 18:29:15 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-14 17:03:18 +0800
commit1432ec6d6943ed7d8a5b6d2176924fef7cd517b5 (patch)
treef777336505096ff97635b723c46e2dbe88adc2ce
parentafe6426f268f5ba7b20f989bbd19f41ccb19b182 (diff)
downloadgsoc2013-empathy-1432ec6d6943ed7d8a5b6d2176924fef7cd517b5.tar
gsoc2013-empathy-1432ec6d6943ed7d8a5b6d2176924fef7cd517b5.tar.gz
gsoc2013-empathy-1432ec6d6943ed7d8a5b6d2176924fef7cd517b5.tar.bz2
gsoc2013-empathy-1432ec6d6943ed7d8a5b6d2176924fef7cd517b5.tar.lz
gsoc2013-empathy-1432ec6d6943ed7d8a5b6d2176924fef7cd517b5.tar.xz
gsoc2013-empathy-1432ec6d6943ed7d8a5b6d2176924fef7cd517b5.tar.zst
gsoc2013-empathy-1432ec6d6943ed7d8a5b6d2176924fef7cd517b5.zip
irc-network-chooser: recreate the default IRC network if needed (#641861)
-rw-r--r--libempathy-gtk/empathy-irc-network-chooser.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-irc-network-chooser.c b/libempathy-gtk/empathy-irc-network-chooser.c
index cc6b1cd95..0fbd7b5fd 100644
--- a/libempathy-gtk/empathy-irc-network-chooser.c
+++ b/libempathy-gtk/empathy-irc-network-chooser.c
@@ -41,6 +41,8 @@
#include "empathy-irc-network-chooser.h"
#define DEFAULT_IRC_NETWORK "irc.gimp.org"
+#define DEFAULT_IRC_PORT 6667
+#define DEFAULT_IRC_SSL FALSE
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcNetworkChooser)
@@ -222,7 +224,22 @@ set_label_from_settings (EmpathyIrcNetworkChooser *self)
/* Set default network */
priv->network = empathy_irc_network_manager_find_network_by_address (
priv->network_manager, DEFAULT_IRC_NETWORK);
- g_assert (priv->network != NULL);
+
+ if (priv->network == NULL)
+ {
+ /* Default network is not known, recreate it */
+ EmpathyIrcServer *srv;
+
+ priv->network = empathy_irc_network_new (DEFAULT_IRC_NETWORK);
+
+ srv = empathy_irc_server_new (DEFAULT_IRC_NETWORK, DEFAULT_IRC_PORT,
+ DEFAULT_IRC_SSL);
+
+ empathy_irc_network_append_server (priv->network, srv);
+ empathy_irc_network_manager_add (priv->network_manager, priv->network);
+
+ g_object_unref (srv);
+ }
set_label (self);
update_server_params (self);