changeset 18624:81dcdd73dff0

merge of '53b8831e57f625eca0980aca94f04416b32bcd8f' and 'da2d50d87f1dd4125cace4dfe2a4b9765518ac59'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 23 Jul 2007 20:56:46 +0000
parents b9a6272f4039 (current diff) 4fda1fc6d7cf (diff)
children 672dd03f538a 5551e5ec1ce0
files
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntblist.c	Mon Jul 23 06:06:42 2007 +0000
+++ b/finch/gntblist.c	Mon Jul 23 20:56:46 2007 +0000
@@ -354,11 +354,13 @@
 	PurpleGroup *grp;
 	GHashTable *hash = NULL;
 	PurpleConnection *gc;
+	gboolean autojoin;
 
 	account = purple_request_fields_get_account(allfields, "account");
 	name = purple_request_fields_get_string(allfields, "name");
 	alias = purple_request_fields_get_string(allfields, "alias");
 	group = purple_request_fields_get_string(allfields, "group");
+	autojoin = purple_request_fields_get_bool(allfields, "autojoin");
 
 	if (!purple_account_is_connected(account) || !name || !*name)
 		return;
@@ -380,6 +382,9 @@
 		}
 		purple_blist_add_chat(chat, grp, NULL);
 		purple_blist_alias_chat(chat, alias);
+		purple_blist_node_set_bool((PurpleBlistNode*)chat, "gnt-autojoin", autojoin);
+		if (autojoin)
+			serv_join_chat(chat->account->gc, chat->components);
 	}
 }
 
@@ -407,6 +412,9 @@
 	field = purple_request_field_string_new("group", _("Group"), grp ? grp->name : NULL, FALSE);
 	purple_request_field_group_add_field(group, field);
 
+	field = purple_request_field_bool_new("autojoin", _("Auto-join"), FALSE);
+	purple_request_field_group_add_field(group, field);
+
 	purple_request_fields(NULL, _("Add Chat"), NULL,
 			_("You can edit more information from the context menu later."),
 			fields, _("Add"), G_CALLBACK(add_chat_cb), _("Cancel"), NULL,