Patch for Google IM (with patch this time)
Burt Holzman <[email protected]>
| Newsgroups | gmane.network.instant-messaging.ayttm.user |
|---|---|
| Message-ID | <[email protected]> |
google-im.patch
(text/plain, 5.2 KB)
Index: jabber/jabber.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/jabber/jabber.c,v
retrieving revision 1.45
diff -b -B -u -r1.45 jabber.c
--- jabber/jabber.c 13 Feb 2005 13:32:27 -0000 1.45
+++ jabber/jabber.c 26 Aug 2005 15:08:05 -0000
@@ -175,6 +175,7 @@
int use_ssl;
char server_port[MAX_PREF_LEN];
char ssl_server_port[MAX_PREF_LEN];
+ char connect_server[MAX_PREF_LEN];
LList *jabber_contacts;
} eb_jabber_local_account_data;
@@ -320,7 +321,7 @@
port = atoi(jlad->server_port);
jlad->connect_tag = JABBER_Login(account->handle, (char *)password,
- jabber_server, jlad->use_ssl, port);
+ jabber_server, jlad->connect_server, jlad->use_ssl, port);
}
static void eb_jabber_login( eb_local_account * account )
@@ -467,6 +468,13 @@
il->next = g_new0(input_list, 1);
il = il->next;
+ il->widget.entry.value = jlad->connect_server;
+ il->name = "CONNECT_SERVER";
+ il->label = _("Co_nnect Server:");
+ il->type = EB_INPUT_ENTRY;
+
+ il->next = g_new0(input_list, 1);
+ il = il->next;
il->widget.checkbox.value = &jlad->prompt_password;
il->name = "prompt_password";
il->label= _("_Ask for password at Login time");
Index: jabber/libEBjabber.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libEBjabber.c,v
retrieving revision 1.19
diff -b -B -u -r1.19 libEBjabber.c
--- jabber/libEBjabber.c 13 Dec 2003 10:26:55 -0000 1.19
+++ jabber/libEBjabber.c 26 Aug 2005 15:08:05 -0000
@@ -212,7 +212,7 @@
/* Functions called from the ayttm jabber.c file */
-int JABBER_Login(char *handle, char *passwd, char *host, int use_ssl, int port) {
+int JABBER_Login(char *handle, char *passwd, char *host, char *connect_server, int use_ssl, int port) {
/* At this point, we don't care about host and port */
char jid[256+1];
int tag;
@@ -251,7 +251,7 @@
strncpy(JConn->jid,jid, LINE_LENGTH);
/* We assume we have an account, and don't need to register one */
JConn->reg_flag = 0;
- JConn->conn=jab_new(jid, passwd);
+ JConn->conn=jab_new(jid, passwd, connect_server);
if(!JConn->conn) {
snprintf(buff, 4096, "Connection to server '%s' failed.", host);
JABBERError(buff, _("Jabber Error"));
Index: jabber/libEBjabber.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libEBjabber.h,v
retrieving revision 1.6
diff -b -B -u -r1.6 libEBjabber.h
--- jabber/libEBjabber.h 4 Oct 2003 13:06:57 -0000 1.6
+++ jabber/libEBjabber.h 26 Aug 2005 15:08:05 -0000
@@ -116,7 +116,7 @@
** Output: 0 on success, -1 on failure
*/
-int JABBER_Login(char *handle, char *passwd, char *host, int use_ssl, int port);
+int JABBER_Login(char *handle, char *passwd, char *host, char *connect_server, int use_ssl, int port);
/*
** Name: JABBER_SendMessage
** Purpose: This function encapuslates the sending of an instant message
Index: jabber/libjabber/jconn.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libjabber/jconn.c,v
retrieving revision 1.8
diff -b -B -u -r1.8 jconn.c
--- jabber/libjabber/jconn.c 18 Oct 2003 23:49:03 -0000 1.8
+++ jabber/libjabber/jconn.c 26 Aug 2005 15:08:05 -0000
@@ -39,12 +39,13 @@
* parameters
* user -- jabber id of the user
* pass -- password of the user
+ * serv -- connection server (overrides domain in JID)
*
* results
* a pointer to the connection structure
* or NULL if allocations failed
*/
-jconn jab_new(char *user, char *pass)
+jconn jab_new(char *user, char *pass, char *serv)
{
pool p;
jconn j;
@@ -59,6 +60,7 @@
j->user = jid_new(p, user);
j->pass = pstrdup(p, pass);
+ j->serv = pstrdup(p, serv);
j->state = JCONN_STATE_OFF;
j->id = 1;
@@ -134,7 +136,11 @@
#endif
j->user->port = port;
- if ((tag = proxy_connect_host(j->user->server, port,
+
+ if (!j->serv || !strlen(j->serv))
+ j->serv = j->user->server;
+
+ if ((tag = proxy_connect_host(j->serv, port,
(ay_socket_callback)jab_continue, j, NULL)) < 0) {
STATE_EVT(JCONN_STATE_OFF);
return 0;
Index: jabber/libjabber/include/jabber/jabber.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libjabber/include/jabber/jabber.h,v
retrieving revision 1.5
diff -b -B -u -r1.5 jabber.h
--- jabber/libjabber/include/jabber/jabber.h 18 Oct 2003 23:49:03 -0000 1.5
+++ jabber/libjabber/include/jabber/jabber.h 26 Aug 2005 15:08:05 -0000
@@ -302,6 +302,7 @@
int fd; /* Connection file descriptor */
jid user; /* User info */
char *pass; /* User passwd */
+ char *serv; /* Server to connect to (overrides one in JID) */
/* Stream stuff */
int id; /* id counter for jab_getid() function */
@@ -324,7 +325,7 @@
typedef void (*jconn_packet_h)(jconn j, jpacket p);
-jconn jab_new(char *user, char *pass);
+jconn jab_new(char *user, char *pass, char *serv);
void jab_delete(jconn j);
void jab_state_handler(jconn j, jconn_state_h h);
void jab_packet_handler(jconn j, jconn_packet_h h);