changeset 4436:83260179de90

[gaim-migrate @ 4711] This will let you specify a different server to actually connect to for jabber. Screenname should still take the form user@server/resource like it always has. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 27 Jan 2003 21:11:55 +0000
parents d4bc1f817566
children f5c6e33b1013
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Mon Jan 27 16:51:31 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Jan 27 21:11:55 2003 +0000
@@ -94,6 +94,7 @@
 #define DEFAULT_PORT 5222
 
 #define USEROPT_PORT 0
+#define USEROPT_CONN_SERVER 1
 
 #define JABBER_TYPING_NOTIFY_INT 15	/* Delay (in seconds) between sending typing notifications */
 
@@ -798,19 +799,22 @@
 {
 	struct aim_user *user;
 	int port, rc;
+	char *server;
 
 	if (!gjc || gjc->state != JCONN_STATE_OFF)
 		return;
 
 	user = GJ_GC(gjc)->user;
 	port = user->proto_opt[USEROPT_PORT][0] ? atoi(user->proto_opt[USEROPT_PORT]) : DEFAULT_PORT;
+	server = user->proto_opt[USEROPT_CONN_SERVER][0] ? user->proto_opt[USEROPT_CONN_SERVER] : gjc->user->server;
+
 
 	gjc->parser = XML_ParserCreate(NULL);
 	XML_SetUserData(gjc->parser, (void *)gjc);
 	XML_SetElementHandler(gjc->parser, startElement, endElement);
 	XML_SetCharacterDataHandler(gjc->parser, charData);
 
-	rc = proxy_connect(gjc->user->server, port, gjab_connected, GJ_GC(gjc));
+	rc = proxy_connect(server, port, gjab_connected, GJ_GC(gjc));
 	if (!user->gc || (rc < 0)) {
 		STATE_EVT(JCONN_STATE_OFF)
 		return;
@@ -4235,6 +4239,12 @@
 	puo->pos = USEROPT_PORT;
 	ret->user_opts = g_list_append(ret->user_opts, puo);
 
+	puo = g_new0(struct proto_user_opt, 1);
+	puo->label = g_strdup("Connect Server:");
+	puo->def = g_strdup("");
+	puo->pos = USEROPT_CONN_SERVER;
+	ret->user_opts = g_list_append(ret->user_opts, puo);
+
 	my_protocol = ret;
 }