Changeset 57b4525 for protocols/jabber
- Timestamp:
- 2011-07-22T18:29:25Z (13 years ago)
- Branches:
- master
- Children:
- 59c9adb4
- Parents:
- a010498
- Location:
- protocols/jabber
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
ra010498 r57b4525 60 60 s = set_add( &acc->set, "activity_timeout", "600", set_eval_int, acc ); 61 61 62 s = set_add( &acc->set, "oauth", "false", set_eval_bool, acc ); 63 62 64 g_snprintf( str, sizeof( str ), "%d", jabber_port_list[0] ); 63 65 s = set_add( &acc->set, "port", str, set_eval_int, acc ); -
protocols/jabber/sasl.c
ra010498 r57b4525 26 26 #include "jabber.h" 27 27 #include "base64.h" 28 #include "oauth2.h" 28 29 29 30 xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data ) … … 33 34 struct xt_node *c, *reply; 34 35 char *s; 35 int sup_plain = 0, sup_digest = 0 ;36 int sup_plain = 0, sup_digest = 0, sup_oauth2 = 0; 36 37 37 38 if( !sasl_supported( ic ) ) … … 59 60 if( c->text && g_strcasecmp( c->text, "DIGEST-MD5" ) == 0 ) 60 61 sup_digest = 1; 62 if( c->text && g_strcasecmp( c->text, "X-OAUTH2" ) == 0 ) 63 sup_oauth2 = 1; 61 64 62 65 c = c->next; … … 73 76 xt_add_attr( reply, "xmlns", XMLNS_SASL ); 74 77 75 if( sup_digest ) 78 if( sup_oauth2 && set_getbool( &ic->acc->set, "oauth" ) ) 79 { 80 imcb_log( ic, "Open this URL in your browser to authenticate: %s", 81 oauth2_url( &oauth2_service_google, 82 "https://www.googleapis.com/auth/googletalk" ) ); 83 xt_free_node( reply ); 84 reply = NULL; 85 } 86 else if( sup_digest ) 76 87 { 77 88 xt_add_attr( reply, "mechanism", "DIGEST-MD5" ); … … 96 107 } 97 108 98 if( !jabber_write_packet( ic, reply ) )109 if( reply && !jabber_write_packet( ic, reply ) ) 99 110 { 100 111 xt_free_node( reply );
Note: See TracChangeset
for help on using the changeset viewer.