diff options
Diffstat (limited to 'protocols/jabber')
| -rw-r--r-- | protocols/jabber/jabber.c | 18 | ||||
| -rw-r--r-- | protocols/jabber/jabber.h | 1 | 
2 files changed, 17 insertions, 2 deletions
| diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 1ad5ecb6..2db026cd 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -60,8 +60,6 @@ static void jabber_init(account_t *acc)  	s = set_add(&acc->set, "activity_timeout", "600", set_eval_int, acc); -	s = set_add(&acc->set, "oauth", "false", set_eval_oauth, acc); -  	s = set_add(&acc->set, "display_name", NULL, NULL, acc);  	g_snprintf(str, sizeof(str), "%d", jabber_port_list[0]); @@ -83,6 +81,12 @@ static void jabber_init(account_t *acc)  	s = set_add(&acc->set, "server", NULL, set_eval_account, acc);  	s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK; +	if (strcmp(acc->prpl->name, "hipchat") == 0) { +		set_setstr(&acc->set, "server", "chat.hipchat.com"); +	} else { +		s = set_add(&acc->set, "oauth", "false", set_eval_oauth, acc); +	} +  	s = set_add(&acc->set, "ssl", "false", set_eval_bool, acc);  	s->flags |= ACC_SET_OFFLINE_ONLY; @@ -121,6 +125,10 @@ static void jabber_login(account_t *acc)  	jd->fd = jd->r_inpa = jd->w_inpa = -1; +	if (strcmp(acc->prpl->name, "hipchat") == 0) { +		jd->flags |= JFLAG_HIPCHAT; +	} +  	if (jd->server == NULL) {  		imcb_error(ic, "Incomplete account name (format it like <username@jabberserver.name>)");  		imc_logout(ic, FALSE); @@ -655,6 +663,7 @@ gboolean jabber_handle_is_self(struct im_connection *ic, const char *who)  void jabber_initmodule()  {  	struct prpl *ret = g_new0(struct prpl, 1); +	struct prpl *hipchat = NULL;  	ret->name = "jabber";  	ret->mms = 0;                        /* no limit */ @@ -685,4 +694,9 @@ void jabber_initmodule()  	ret->buddy_action = jabber_buddy_action;  	register_protocol(ret); + +	/* Another one for hipchat, which has completely different logins */ +	hipchat = g_memdup(ret, sizeof(struct prpl)); +	hipchat->name = "hipchat"; +	register_protocol(hipchat);  } diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h index f991465e..6a329a06 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -47,6 +47,7 @@ typedef enum {  	JFLAG_STARTTLS_DONE = 128,      /* If a plaintext session was converted to TLS. */  	JFLAG_GTALK =  0x100000,        /* Is Google Talk, as confirmed by iq discovery */ +	JFLAG_HIPCHAT = 0x200000,       /* Is hipchat, because prpl->name says so */  	JFLAG_SASL_FB = 0x10000,        /* Trying Facebook authentication. */  } jabber_flags_t; | 
