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:04:14 +0800
commit7a649b8764d0db04a57e0c1b004fb691a08113ab (patch)
tree858412d96ed16fe23d999d096c0bdee77c6ad60a
parent17e69195176edfa854e1d62cc3e6bd322128ce37 (diff)
downloadgsoc2013-empathy-7a649b8764d0db04a57e0c1b004fb691a08113ab.tar
gsoc2013-empathy-7a649b8764d0db04a57e0c1b004fb691a08113ab.tar.gz
gsoc2013-empathy-7a649b8764d0db04a57e0c1b004fb691a08113ab.tar.bz2
gsoc2013-empathy-7a649b8764d0db04a57e0c1b004fb691a08113ab.tar.lz
gsoc2013-empathy-7a649b8764d0db04a57e0c1b004fb691a08113ab.tar.xz
gsoc2013-empathy-7a649b8764d0db04a57e0c1b004fb691a08113ab.tar.zst
gsoc2013-empathy-7a649b8764d0db04a57e0c1b004fb691a08113ab.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);