Mercurial > pidgin.yaz
changeset 1380:638af9a58e39
[gaim-migrate @ 1390]
change chat window title, and prompt before allowing direct IM connect
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 05 Jan 2001 00:47:42 +0000 |
parents | 11d21829ea3b |
children | 1bbdebd66afd |
files | src/buddy_chat.c src/gaim.h src/oscar.c src/prpl.c |
diffstat | 4 files changed, 32 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy_chat.c Fri Jan 05 00:32:19 2001 +0000 +++ b/src/buddy_chat.c Fri Jan 05 00:47:42 2001 +0000 @@ -601,6 +601,7 @@ GtkWidget *vpaned; GtkWidget *hpaned; GtkWidget *toolbar; + char buf[BUF_LONG]; int dispstyle = set_dispstyle(1); @@ -610,7 +611,8 @@ gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim"); gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); gtk_container_border_width(GTK_CONTAINER(win), 10); - gtk_window_set_title(GTK_WINDOW(win), b->name); + g_snprintf(buf, sizeof(buf), "Gaim - %s (chat)", b->name); + gtk_window_set_title(GTK_WINDOW(win), buf); gtk_signal_connect(GTK_OBJECT(win), "destroy", GTK_SIGNAL_FUNC(close_callback), b); gtk_widget_realize(win); aol_icon(win->window);
--- a/src/gaim.h Fri Jan 05 00:32:19 2001 +0000 +++ b/src/gaim.h Fri Jan 05 00:47:42 2001 +0000 @@ -361,8 +361,8 @@ struct gaim_connection *gc; }; -#define CONVERSATION_TITLE "Gaim - Conversation with %s" -#define LOG_CONVERSATION_TITLE "Gaim - Conversation with %s (logged)" +#define CONVERSATION_TITLE "Gaim - %s" +#define LOG_CONVERSATION_TITLE "Gaim - %s (logged)" #define VOICE_UID "09461341-4C7F-11D1-8222-444553540000" #define FILE_SEND_UID "09461343-4C7F-11D1-8222-444553540000"
--- a/src/oscar.c Fri Jan 05 00:32:19 2001 +0000 +++ b/src/oscar.c Fri Jan 05 00:47:42 2001 +0000 @@ -2005,21 +2005,30 @@ return 1; } -static void oscar_direct_im(GtkObject *obj, char *who) { - struct gaim_connection *gc = (struct gaim_connection *)gtk_object_get_user_data(obj); +struct ask_do_dir_im { + char *who; + struct gaim_connection *gc; +}; + +static void oscar_cancel_direct_im(GtkObject *obj, struct ask_do_dir_im *data) { + g_free(data); +} + +static void oscar_direct_im(GtkObject *obj, struct ask_do_dir_im *data) { + struct gaim_connection *gc = data->gc; struct oscar_data *od = (struct oscar_data *)gc->proto_data; struct direct_im *dim; - dim = find_direct_im(od, who); + dim = find_direct_im(od, data->who); if (dim) { do_error_dialog("Direct IM request already pending.", "Unable"); return; } dim = g_new0(struct direct_im, 1); dim->gc = gc; - g_snprintf(dim->name, sizeof dim->name, "%s", who); + g_snprintf(dim->name, sizeof dim->name, "%s", data->who); - dim->conn = aim_directim_initiate(od->sess, od->conn, NULL, who); + dim->conn = aim_directim_initiate(od->sess, od->conn, NULL, data->who); if (dim->conn != NULL) { od->direct_ims = g_slist_append(od->direct_ims, dim); dim->watcher = gdk_input_add(dim->conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, @@ -2032,6 +2041,17 @@ } } +static void oscar_ask_direct_im(GtkObject *m, gchar *who) { + char buf[BUF_LONG]; + struct ask_do_dir_im *data = g_new0(struct ask_do_dir_im, 1); + data->who = who; + data->gc = gtk_object_get_user_data(m); + g_snprintf(buf, sizeof(buf), _("You have selected to open a Direct IM connection with %s." + " Doing this will let them see your IP address, and may be" + " a security risk. Do you wish to continue?"), who); + do_ask_dialog(buf, data, oscar_direct_im, oscar_cancel_direct_im); +} + static void oscar_action_menu(GtkWidget *menu, struct gaim_connection *gc, char *who) { GtkWidget *button; char *n = g_strdup(normalize(gc->username)); @@ -2053,7 +2073,7 @@ if (strcmp(n, normalize(who))) { button = gtk_menu_item_new_with_label(_("Direct IM")); gtk_signal_connect(GTK_OBJECT(button), "activate", - GTK_SIGNAL_FUNC(oscar_direct_im), who); + GTK_SIGNAL_FUNC(oscar_ask_direct_im), who); gtk_object_set_user_data(GTK_OBJECT(button), gc); gtk_menu_append(GTK_MENU(menu), button); gtk_widget_show(button);
--- a/src/prpl.c Fri Jan 05 00:32:19 2001 +0000 +++ b/src/prpl.c Fri Jan 05 00:47:42 2001 +0000 @@ -130,6 +130,7 @@ gtk_container_add(GTK_CONTAINER(window), vbox); label = gtk_label_new(text); + gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); hbox = gtk_hbox_new(FALSE, 5);