diff src/protocols/msn/switchboard.h @ 10345:2e01c503aa4f

[gaim-migrate @ 11556] Patch 1078151 from Felipe Contreras to fix some more MSN bugs: "User Dislpay messages, and other less used, did not set an slpcall, so the callback that should not be called, was called (in some very special cases)." ... "Here it goes the real real one, as far as I can tell. Cleaning + organizing + documentation + hard bug fix = big patch." -- Felipe Contreras I also fixed drag-and-drop to conversation window file transfers (which I had broken when I fixed some other dnd thing), made the debug output of the autoreconnect plugin more useful, and stopped the message notification plugin notifying you for messages sent by ignored users. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 11 Dec 2004 20:01:58 +0000
parents ecf3ce2e2ab1
children bbf738a0ce7b
line wrap: on
line diff
--- a/src/protocols/msn/switchboard.h	Sat Dec 11 00:06:06 2004 +0000
+++ b/src/protocols/msn/switchboard.h	Sat Dec 11 20:01:58 2004 +0000
@@ -33,17 +33,26 @@
 
 #include "servconn.h"
 
+#include "slplink.h"
+
+/*
+ * A switchboard error
+ */
 typedef enum
 {
-	MSN_SB_ERROR_NONE,
-	MSN_SB_ERROR_CAL, /* The user could not join (answer the call) */
-	MSN_SB_ERROR_OFFLINE, /* The account is offline */
-	MSN_SB_ERROR_USER_OFFLINE, /* The user to call is offline */
-	MSN_SB_ERROR_CONNECTION, /* There was a connection error */
-	MSN_SB_ERROR_UNKNOWN
+	MSN_SB_ERROR_NONE, /**< No error */
+	MSN_SB_ERROR_CAL, /**< The user could not join (answer the call) */
+	MSN_SB_ERROR_OFFLINE, /**< The account is offline */
+	MSN_SB_ERROR_USER_OFFLINE, /**< The user to call is offline */
+	MSN_SB_ERROR_CONNECTION, /**< There was a connection error */
+	MSN_SB_ERROR_UNKNOWN /**< An unknown error occured */
 
 } MsnSBErrorType;
 
+/*
+ * A switchboard  A place where a bunch of users send messages to the rest
+ * of the users.
+ */
 struct _MsnSwitchBoard
 {
 	MsnSession *session;
@@ -53,13 +62,18 @@
 	char *auth_key;
 	char *session_id;
 
-	gboolean invited;
-	gboolean destroying;
+	GaimConversation *conv; /**< The conversation that displays the
+							  messages of this switchboard, or @c NULL if
+							  this is a helper switchboard. */
 
-	GaimConversation *conv;
-
-	gboolean ready; /* When it's actually usable */
-	/* gboolean in_use; */
+	gboolean empty;      /**< A flag that states if the swithcboard has no
+						   users in it. */
+	gboolean invited;    /**< A flag that states if we were invited to the
+						   switchboard. */
+	gboolean destroying; /**< A flag that states if the switchboard is on
+						   the process of being destroyed. */
+	gboolean ready;      /**< A flag that states if his switchboard is
+						   ready to be used. */
 
 	int current_users;
 	int total_users;
@@ -67,12 +81,11 @@
 
 	int chat_id;
 
-	gboolean hidden;
-
-	gboolean user_joined;
 	GQueue *im_queue;
 
-	int error;
+	MsnSBErrorType error; /**< The error that occured in this switchboard
+							(if applicable). */
+	MsnSlpLink *slplink; /**< The slplink that is using this switchboard. */
 };
 
 /**
@@ -101,25 +114,6 @@
  */
 void msn_switchboard_destroy(MsnSwitchBoard *swboard);
 
-#if 0
-/**
- * Sets the user the switchboard is supposed to connect to.
- *
- * @param swboard The switchboard.
- * @param user    The user.
- */
-void msn_switchboard_set_user(MsnSwitchBoard *swboard, const char *user);
-
-/**
- * Returns the user the switchboard is supposed to connect to.
- *
- * @param swboard The switchboard.
- *
- * @return The user.
- */
-const char *msn_switchboard_get_user(MsnSwitchBoard *swboard);
-#endif
-
 /**
  * Sets the auth key the switchboard must use when connecting.
  *
@@ -155,7 +149,7 @@
 const char *msn_switchboard_get_session_id(MsnSwitchBoard *swboard);
 
 /**
- * Sets whether or not the user was invited to this switchboard.
+ * Sets whether or not we were invited to this switchboard.
  *
  * @param swboard The switchboard.
  * @param invite  @c TRUE if invited, @c FALSE otherwise.
@@ -163,7 +157,7 @@
 void msn_switchboard_set_invited(MsnSwitchBoard *swboard, gboolean invited);
 
 /**
- * Returns whether or not the user was invited to this switchboard.
+ * Returns whether or not we were invited to this switchboard.
  *
  * @param swboard The switchboard.
  *
@@ -182,16 +176,23 @@
  */
 gboolean msn_switchboard_connect(MsnSwitchBoard *swboard,
 								 const char *host, int port);
+
+/**
+ * Disconnects from a switchboard.
+ *
+ * @param swboard The switchboard to disconnect from.
+ */
 void msn_switchboard_disconnect(MsnSwitchBoard *swboard);
+
 void msn_switchboard_send_msg(MsnSwitchBoard *swboard, MsnMessage *msg);
+void msn_switchboard_queue_msg(MsnSwitchBoard *swboard, MsnMessage *msg);
+void msn_switchboard_process_queue(MsnSwitchBoard *swboard);
 
 gboolean msn_switchboard_chat_leave(MsnSwitchBoard *swboard);
 gboolean msn_switchboard_chat_invite(MsnSwitchBoard *swboard, const char *who);
 
 void msn_switchboard_request(MsnSwitchBoard *swboard);
 void msn_switchboard_request_add_user(MsnSwitchBoard *swboard, const char *user);
-void msn_switchboard_queue_msg(MsnSwitchBoard *swboard, MsnMessage *msg);
-void msn_switchboard_process_queue(MsnSwitchBoard *swboard);
 
 /**
  * Processes application/x-msnmsgrp2p messages.