changeset 3188:49fb2b634a2a

[gaim-migrate @ 3205] The Robot101 commit. A toc fix (don't use toc) and the possibility to compile iconaway.c on an applet and use it on the standalone app. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 27 Apr 2002 19:41:07 +0000
parents 01279615a5fe
children dd03116e0f8d
files plugins/iconaway.c src/about.c src/buddy.c src/protocols/toc/toc.c src/ui.h
diffstat 5 files changed, 27 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/iconaway.c	Sat Apr 27 07:43:53 2002 +0000
+++ b/plugins/iconaway.c	Sat Apr 27 19:41:07 2002 +0000
@@ -20,14 +20,8 @@
 		return;
 	XIconifyWindow(GDK_DISPLAY(),
 			GDK_WINDOW_XWINDOW(imaway->window),
-			((_XPrivDisplay)GDK_DISPLAY())->default_screen);
-#ifdef USE_APPLET
-	applet_destroy_buddy();
-#else
-	XIconifyWindow(GDK_DISPLAY(),
-			GDK_WINDOW_XWINDOW(blist->window),
-			((_XPrivDisplay)GDK_DISPLAY())->default_screen);
-#endif
+		       ((_XPrivDisplay)GDK_DISPLAY())->default_screen);
+	hide_buddy_list();
 	if (all_convos)
 		XIconifyWindow(GDK_DISPLAY(),
 				GDK_WINDOW_XWINDOW(all_convos->window),
--- a/src/about.c	Sat Apr 27 07:43:53 2002 +0000
+++ b/src/about.c	Sat Apr 27 19:41:07 2002 +0000
@@ -69,6 +69,15 @@
 	return VERSION;
 }
 
+gboolean is_applet()
+{
+#ifdef USE_APPLET
+	return TRUE;
+#else
+	return FALSE;
+#endif
+}
+
 void show_about(GtkWidget *w, void *null)
 {
 	GtkWidget *vbox;
--- a/src/buddy.c	Sat Apr 27 07:43:53 2002 +0000
+++ b/src/buddy.c	Sat Apr 27 19:41:07 2002 +0000
@@ -1986,6 +1986,16 @@
 	return g;
 }
 
+void hide_buddy_list() {
+	#ifdef USE_APPLET
+	applet_destroy_buddy();
+#else
+	XIconifyWindow(GDK_DISPLAY(),
+			GDK_WINDOW_XWINDOW(blist->window),
+			((_XPrivDisplay)GDK_DISPLAY())->default_screen);
+#endif
+}
+
 static gint log_timeout(struct buddy_show *b)
 {
 	/* this part is really just a bad hack because of a bug I can't find */
--- a/src/protocols/toc/toc.c	Sat Apr 27 07:43:53 2002 +0000
+++ b/src/protocols/toc/toc.c	Sat Apr 27 19:41:07 2002 +0000
@@ -1003,9 +1003,12 @@
 		g_free (g->away);
 	g->away = NULL;
 	if (message) {
+		char *tmp = g_malloc(strlen(message) * 4 + 1);
+		strcpy(tmp, message);
 		g->away = g_strdup (message);
-		escape_text(message);
-		g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", message);
+		escape_text(tmp);
+		g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", tmp);
+		g_free(tmp);
 	} else
 		g_snprintf(buf, MSG_LEN, "toc_set_away \"\"");
 	sflap_send(g, buf, -1, TYPE_DATA);
--- a/src/ui.h	Sat Apr 27 07:43:53 2002 +0000
+++ b/src/ui.h	Sat Apr 27 19:41:07 2002 +0000
@@ -349,6 +349,7 @@
 extern void gaim_separator(GtkWidget *);
 extern void redo_buddy_list(); /* you really shouldn't call this function */
 extern void set_blist_tab();
+extern void hide_buddy_list();
 
 /* Functions in buddy_chat.c */
 extern void join_chat();