Changeset bb2d198
- Timestamp:
- 2012-02-10T15:14:38Z (13 years ago)
- Branches:
- master
- Children:
- fc0640e
- Parents:
- e0a0a42
- Location:
- protocols/jabber
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
re0a0a42 rbb2d198 27 27 static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); 28 28 static xt_status jabber_iq_display_vcard( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); 29 static int jabber_iq_disco_server( struct im_connection *ic ); 29 30 30 31 xt_status jabber_pkt_iq( struct xt_node *node, gpointer data ) … … 330 331 if( !jabber_get_roster( ic ) ) 331 332 return XT_ABORT; 333 if( !jabber_iq_disco_server( ic ) ) 334 return XT_ABORT; 332 335 } 333 336 … … 390 393 { 391 394 if( !jabber_get_roster( ic ) ) 395 return XT_ABORT; 396 if( !jabber_iq_disco_server( ic ) ) 392 397 return XT_ABORT; 393 398 } … … 887 892 return XT_HANDLED; 888 893 } 894 895 static xt_status jabber_iq_disco_server_response( struct im_connection *ic, 896 struct xt_node *node, struct xt_node *orig ); 897 898 static int jabber_iq_disco_server( struct im_connection *ic ) 899 { 900 struct xt_node *node, *iq; 901 struct jabber_data *jd = ic->proto_data; 902 903 node = xt_new_node( "query", NULL, NULL ); 904 xt_add_attr( node, "xmlns", XMLNS_DISCO_INFO ); 905 iq = jabber_make_packet( "iq", "get", jd->server, node ); 906 907 jabber_cache_add( ic, iq, jabber_iq_disco_server_response ); 908 return jabber_write_packet( ic, iq ); 909 } 910 911 static xt_status jabber_iq_disco_server_response( struct im_connection *ic, 912 struct xt_node *node, struct xt_node *orig ) 913 { 914 struct jabber_data *jd = ic->proto_data; 915 struct xt_node *id; 916 917 if( ( id = xt_find_path( node, "query/identity" ) ) ) 918 { 919 char *cat, *type, *name; 920 921 if( !( cat = xt_find_attr( id, "category" ) ) || 922 !( type = xt_find_attr( id, "type" ) ) || 923 !( name = xt_find_attr( id, "name" ) ) ) 924 return XT_HANDLED; 925 926 if( strcmp( cat, "server" ) == 0 && strcmp( type, "im" ) == 0 && 927 strstr( name, "Google" ) != NULL ) 928 jd->flags |= JFLAG_GTALK; 929 } 930 931 return XT_HANDLED; 932 } -
protocols/jabber/jabber.h
re0a0a42 rbb2d198 47 47 JFLAG_XMLCONSOLE = 64, /* If the user added an xmlconsole buddy. */ 48 48 JFLAG_STARTTLS_DONE = 128, /* If a plaintext session was converted to TLS. */ 49 49 50 JFLAG_GTALK = 0x100000, /* Is Google Talk, as confirmed by iq discovery */ 51 50 52 JFLAG_SASL_FB = 0x10000, /* Trying Facebook authentication. */ 51 53 } jabber_flags_t;
Note: See TracChangeset
for help on using the changeset viewer.