changeset 5626:6275ac113622

[gaim-migrate @ 6033] The first prpl-specific prefs. No, there's no prefs page :) committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 01 Jun 2003 03:43:19 +0000
parents 73c9dc20e41a
children 19a848d76372
files src/protocols/msn/msn.c src/protocols/msn/switchboard.c
diffstat 2 files changed, 24 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Sun Jun 01 03:21:55 2003 +0000
+++ b/src/protocols/msn/msn.c	Sun Jun 01 03:43:19 2003 +0000
@@ -22,6 +22,7 @@
 #include "msn.h"
 #include "msg.h"
 #include "page.h"
+#include "prefs.h"
 #include "session.h"
 #include "state.h"
 #include "utils.h"
@@ -1223,6 +1224,10 @@
 	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
 
 	my_protocol = plugin;
+
+	gaim_prefs_add_none("/plugins/prpl/msn");
+	gaim_prefs_add_bool("/plugins/prpl/msn/conv_close_notice",   TRUE);
+	gaim_prefs_add_bool("/plugins/prpl/msn/conv_timeout_notice", TRUE);
 }
 
 GAIM_INIT_PLUGIN(msn, __init_plugin, info);
--- a/src/protocols/msn/switchboard.c	Sun Jun 01 03:21:55 2003 +0000
+++ b/src/protocols/msn/switchboard.c	Sun Jun 01 03:43:19 2003 +0000
@@ -20,6 +20,7 @@
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "msn.h"
+#include "prefs.h"
 #include "switchboard.h"
 #include "utils.h"
 
@@ -117,17 +118,27 @@
 		else
 			username = user;
 
-		if (param_count == 2 && atoi(params[1]) == 1)
-			g_snprintf(buf, sizeof(buf),
-					   _("The conversation has become inactive "
-						 "and timed out."));
-		else
-			g_snprintf(buf, sizeof(buf),
-					   _("%s has closed the conversation window."), username);
+		*buf = '\0';
 
-		if ((conv = gaim_find_conversation(user)) != NULL)
+		if (param_count == 2 && atoi(params[1]) == 1) {
+			if (gaim_prefs_get_bool("/plugins/prpl/msn/conv_timeout_notice")) {
+				g_snprintf(buf, sizeof(buf),
+						   _("The conversation has become inactive "
+							 "and timed out."));
+			}
+		}
+		else {
+			if (gaim_prefs_get_bool("/plugins/prpl/msn/conv_close_notice")) {
+				g_snprintf(buf, sizeof(buf),
+						   _("%s has closed the conversation window."),
+						   username);
+			}
+		}
+
+		if (*buf != '\0' && (conv = gaim_find_conversation(user)) != NULL) {
 			gaim_conversation_write(conv, NULL, buf, -1, WFLAG_SYSTEM,
 									time(NULL));
+		}
 
 		msn_switchboard_destroy(swboard);