changeset 692:f4026275bc9f

[gaim-migrate @ 702] chat mods committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 16 Aug 2000 01:00:27 +0000
parents 104a2659b358
children 30a8e386849d
files src/buddy_chat.c src/oscar.c src/server.c
diffstat 3 files changed, 57 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy_chat.c	Wed Aug 16 00:52:11 2000 +0000
+++ b/src/buddy_chat.c	Wed Aug 16 01:00:27 2000 +0000
@@ -42,6 +42,7 @@
 static GtkWidget *invite;
 static GtkWidget *inviteentry;
 static GtkWidget *invitemess;
+static int community;
 extern int state_lock;
 
 static void destroy_join_chat()
@@ -68,7 +69,7 @@
 	group = gtk_entry_get_text(GTK_ENTRY(entry));
 
         if (joinchat) {
-                serv_join_chat(4, group);
+                serv_join_chat(community + 4, group);
 		gtk_widget_destroy(joinchat);
 	}
 	joinchat=NULL;
@@ -84,11 +85,9 @@
 	GtkWidget *bbox;
 	GtkWidget *vbox;
 	GtkWidget *topbox;
-	GtkWidget *button_box;
-	GtkWidget *icon_i;
-	GdkBitmap *mask;
-	GdkPixmap *icon;
 	GtkWidget *frame;
+	GtkWidget *opt;
+	GtkWidget *hbox;
 
 	if (!joinchat) {
 		joinchat = gtk_window_new(GTK_WINDOW_DIALOG);
@@ -99,71 +98,37 @@
 		topbox = gtk_hbox_new(FALSE, 5);
 		vbox = gtk_vbox_new(FALSE, 5);
 		entry = gtk_entry_new();
+		hbox = gtk_hbox_new(TRUE, 10);
 
 		frame = gtk_frame_new(_("Buddy Chat"));
-       /* Build Join Button */
-
-        join = gtk_button_new();
-
-        button_box = gtk_hbox_new(FALSE, 5);
-        icon = gdk_pixmap_create_from_xpm_d (joinchat->window, &mask, NULL, join_xpm);
-        icon_i = gtk_pixmap_new(icon, mask);
-
-        label = gtk_label_new(_("Join"));
-
-        gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
-        gtk_box_pack_end(GTK_BOX(button_box), label, FALSE, FALSE, 2);
-
-        gtk_widget_show(label);
-        gtk_widget_show(icon_i);
-
-        gtk_widget_show(button_box);
-
-        gtk_container_add(GTK_CONTAINER(join), button_box);
-	gtk_widget_set_usize(join, 75, 30);
-
-        /* End of OK Button */
-
-        /* Build Cancel Button */
-
-        cancel = gtk_button_new();
 
-        button_box = gtk_hbox_new(FALSE, 5);
-        icon = gdk_pixmap_create_from_xpm_d ( joinchat->window, &mask, NULL, cancel_xpm);
-        icon_i = gtk_pixmap_new(icon, mask);
-
-        label = gtk_label_new(_("Cancel"));
-
-        gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
-        gtk_box_pack_end(GTK_BOX(button_box), label, FALSE, FALSE, 2);
-
-        gtk_widget_show(label);
-        gtk_widget_show(icon_i);
-
-        gtk_widget_show(button_box);
+		join = picture_button(joinchat, _("Join"), join_xpm);
+		cancel = picture_button(joinchat, _("Cancel"), cancel_xpm);
 
-        gtk_container_add(GTK_CONTAINER(cancel), button_box);
-
-	gtk_widget_set_usize(cancel, 75, 30);
-
-        /* End of Cancel Button */
-        
-	if (display_options & OPT_DISP_COOL_LOOK)
-	{
-		gtk_button_set_relief(GTK_BUTTON(join), GTK_RELIEF_NONE);
-		gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE);
-	}
-
-	gtk_box_pack_start(GTK_BOX(bbox), join, FALSE, FALSE, 5);
-	gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
+		gtk_box_pack_start(GTK_BOX(bbox), join, FALSE, FALSE, 5);
+		gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
 
 		label = gtk_label_new(_("Join what group:"));
 		gtk_widget_show(label);
 		gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
 		gtk_box_pack_start(GTK_BOX(topbox), entry, FALSE, FALSE, 5);
-	
+
+		opt = gtk_radio_button_new_with_label(NULL,
+							_("AIM Private Chats"));
+		gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0);
+		community = 0;
+		gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
+		gtk_signal_connect(GTK_OBJECT(opt), "clicked", set_option, &community);
+		gtk_widget_show(opt);
+
+		opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(opt)),
+							_("AOL Community Chats"));
+		gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0);
+		gtk_widget_show(opt);
+
 		/* And the boxes in the box */
 		gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5);
+		gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5);
 		gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5);
 		
 		/* Handle closes right */
@@ -181,6 +146,7 @@
 		gtk_widget_show(cancel);
 		gtk_widget_show(entry);
 		gtk_widget_show(topbox);
+		gtk_widget_show(hbox);
 		gtk_widget_show(bbox);
 		gtk_widget_show(vbox);
 		gtk_widget_show(frame);
--- a/src/oscar.c	Wed Aug 16 00:52:11 2000 +0000
+++ b/src/oscar.c	Wed Aug 16 01:00:27 2000 +0000
@@ -125,6 +125,8 @@
 					if (cnv) {
 						make_direct(cnv, FALSE, NULL, 0);
 					}
+				} else if (conn->type = AIM_CONN_TYPE_CHAT) {
+					/* FIXME! we got kicked out of chat */
 				}
 				aim_conn_kill(gaim_sess, &conn);
 				if (!aim_getconn_type(gaim_sess, AIM_CONN_TYPE_BOS)) {
--- a/src/server.c	Wed Aug 16 00:52:11 2000 +0000
+++ b/src/server.c	Wed Aug 16 01:00:27 2000 +0000
@@ -533,7 +533,7 @@
 	} else {
 		sprintf(debug_buff, "Attempting to join chat room %s.\n", name);
 		debug_print(debug_buff);
-		aim_chat_join(gaim_sess, gaim_conn, 0x0004, name);
+		aim_chat_join(gaim_sess, gaim_conn, exchange, name);
 	}
 }
 
@@ -570,37 +570,38 @@
 	        sflap_send(buf, -1, TYPE_DATA);
 	        g_free(buf);
 	} else {
-	GList *bcs = buddy_chats;
-	struct conversation *b = NULL;
-	struct chat_connection *c = NULL;
-	int count = 0;
+		GList *bcs = buddy_chats;
+		struct conversation *b = NULL;
+		struct chat_connection *c = NULL;
+		int count = 0;
 
-	while (bcs) {
-		count++;
-		b = (struct conversation *)bcs->data;
-		if (id == b->id)
-			break;
-		bcs = bcs->next;
-		b = NULL;
-	}
+		while (bcs) {
+			count++;
+			b = (struct conversation *)bcs->data;
+			if (id == b->id)
+				break;
+			bcs = bcs->next;
+			b = NULL;
+		}
 
-	if (!b)
-		return;
+		if (!b)
+			return;
 
-	sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n",
-				b->name, count);
-	debug_print(debug_buff);
+		sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n",
+					b->name, count);
+		debug_print(debug_buff);
 
-	aim_chat_leaveroom(gaim_sess, b->name);
-	c = find_oscar_chat(b->name);
-	if (c != NULL) {
-		oscar_chats = g_list_remove(oscar_chats, c);
-		gdk_input_remove(c->inpa);
-		g_free(c->name);
-		g_free(c);
-	}
-	/* we do this because with Oscar it doesn't tell us we left */
-	serv_got_chat_left(b->id);
+		aim_chat_leaveroom(gaim_sess, b->name);
+		c = find_oscar_chat(b->name);
+		if (c != NULL) {
+			aim_conn_kill(gaim_sess, &c->conn);
+			oscar_chats = g_list_remove(oscar_chats, c);
+			gdk_input_remove(c->inpa);
+			g_free(c->name);
+			g_free(c);
+		}
+		/* we do this because with Oscar it doesn't tell us we left */
+		serv_got_chat_left(b->id);
 	}
 }
 
@@ -904,7 +905,7 @@
 		gtk_widget_destroy(w2);
 	} else {
 		char *i = (char *)gtk_object_get_user_data(GTK_OBJECT(w2));
-		serv_join_chat(0, i); /* for oscar, it doesn't use the id anyway */
+		serv_join_chat(4, i);
 		g_free(i);
 		gtk_widget_destroy(w2);
 	}