]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-irc-network.c
Merge remote-tracking branch 'origin/gnome-3-8'
[empathy.git] / libempathy / empathy-irc-network.c
index 2f433e4efcf58a8a50ddc1a8beb25487936b49a3..e01116e960174bdda55d7849efa212202a0b3c1f 100644 (file)
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
  *
  * Authors: Guillaume Desmottes <gdesmott@gnome.org>
  */
 
-#include <config.h>
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-
-#include <telepathy-glib/util.h>
-
-#include "empathy-marshal.h"
+#include "config.h"
 #include "empathy-irc-network.h"
+
 #include "empathy-utils.h"
 
 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcNetwork)
@@ -206,7 +199,8 @@ empathy_irc_network_class_init (EmpathyIrcNetworkClass *klass)
    * EmpathyIrcNetwork::modified:
    * @network: the object that received the signal
    *
-   * Emitted when either a property or a server of the network is modified.
+   * Emitted when either a property or a server of the network is modified or
+   * when a network is activated.
    *
    */
   signals[MODIFIED] = g_signal_new (
@@ -215,10 +209,28 @@ empathy_irc_network_class_init (EmpathyIrcNetworkClass *klass)
       G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
       0,
       NULL, NULL,
-      g_cclosure_marshal_VOID__VOID,
+      g_cclosure_marshal_generic,
       G_TYPE_NONE, 0);
 }
 
+/**
+ * empathy_irc_network_activate:
+ * @self: the name of the network
+ *
+ * Activates a #EmpathyIrcNetwork.
+ *
+ */
+void
+empathy_irc_network_activate (EmpathyIrcNetwork *self)
+{
+  g_return_if_fail (EMPATHY_IS_IRC_NETWORK (self));
+  g_return_if_fail (self->dropped);
+
+  self->dropped = FALSE;
+
+  g_signal_emit (self, signals[MODIFIED], 0);
+}
+
 /**
  * empathy_irc_network_new:
  * @name: the name of the network
@@ -359,3 +371,19 @@ empathy_irc_network_set_server_position (EmpathyIrcNetwork *self,
 
   g_signal_emit (self, signals[MODIFIED], 0);
 }
+
+const gchar *
+empathy_irc_network_get_name (EmpathyIrcNetwork *self)
+{
+  EmpathyIrcNetworkPriv *priv = GET_PRIV (self);
+
+  return priv->name;
+}
+
+const gchar *
+empathy_irc_network_get_charset (EmpathyIrcNetwork *self)
+{
+  EmpathyIrcNetworkPriv *priv = GET_PRIV (self);
+
+  return priv->charset;
+}