Changeset b79308b for protocols/jabber
- Timestamp:
- 2008-04-14T13:10:53Z (17 years ago)
- Branches:
- master
- Children:
- 0cab388
- Parents:
- 6cac643 (diff), aa31117 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols/jabber
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/Makefile
r6cac643 rb79308b 10 10 11 11 # [SH] Program variables 12 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o xmltree.osi.o s5bytestream.o12 objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o si.o s5bytestream.o 13 13 14 14 CFLAGS += -Wall … … 18 18 all: jabber_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/jabber/io.c
r6cac643 rb79308b 241 241 } 242 242 243 /* EAGAIN/etc or a successful read. */ 244 return TRUE; 243 if( ssl_pending( jd->ssl ) ) 244 /* OpenSSL empties the TCP buffers completely but may keep some 245 data in its internap buffers. select() won't see that, but 246 ssl_pending() does. */ 247 return jabber_read_callback( data, fd, cond ); 248 else 249 return TRUE; 245 250 } 246 251 … … 521 526 from the server too. */ 522 527 xt_free( jd->xt ); /* In case we're RE-starting. */ 523 jd->xt = xt_new( ic ); 524 jd->xt->handlers = (struct xt_handler_entry*) jabber_handlers; 528 jd->xt = xt_new( jabber_handlers, ic ); 525 529 526 530 if( jd->r_inpa <= 0 ) -
protocols/jabber/iq.c
r6cac643 rb79308b 534 534 } 535 535 536 static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); 537 536 538 int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name ) 537 539 { … … 549 551 xt_add_attr( node, "xmlns", XMLNS_ROSTER ); 550 552 node = jabber_make_packet( "iq", "set", NULL, node ); 553 jabber_cache_add( ic, node, jabber_add_to_roster_callback ); 551 554 552 555 st = jabber_write_packet( ic, node ); 553 556 554 xt_free_node( node );555 557 return st; 558 } 559 560 static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ) 561 { 562 char *s, *jid = NULL; 563 struct xt_node *c; 564 565 if( ( c = xt_find_node( orig->children, "query" ) ) && 566 ( c = xt_find_node( c->children, "item" ) ) && 567 ( jid = xt_find_attr( c, "jid" ) ) && 568 ( s = xt_find_attr( node, "type" ) ) && 569 strcmp( s, "result" ) == 0 ) 570 { 571 if( imcb_find_buddy( ic, jid ) == NULL ) 572 imcb_add_buddy( ic, jid, NULL ); 573 } 574 else 575 { 576 imcb_log( ic, "Error while adding `%s' to your contact list.", 577 jid ? jid : "(unknown handle)" ); 578 } 579 580 return XT_HANDLED; 556 581 } 557 582 -
protocols/jabber/jabber.c
r6cac643 rb79308b 267 267 xt_free( jd->xt ); 268 268 269 g_free( jd->cached_id_prefix ); 269 270 g_free( jd->away_message ); 270 271 g_free( jd->username ); -
protocols/jabber/jabber_util.c
r6cac643 rb79308b 250 250 }; 251 251 252 static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla ) 253 { 252 static void jabber_buddy_ask_yes( void *data ) 253 { 254 struct jabber_buddy_ask_data *bla = data; 255 254 256 presence_send_request( bla->ic, bla->handle, "subscribed" ); 255 257 … … 261 263 } 262 264 263 static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla ) 264 { 265 static void jabber_buddy_ask_no( void *data ) 266 { 267 struct jabber_buddy_ask_data *bla = data; 268 265 269 presence_send_request( bla->ic, bla->handle, "subscribed" ); 266 270 -
protocols/jabber/sasl.c
r6cac643 rb79308b 21 21 * * 22 22 \***************************************************************************/ 23 24 #include <ctype.h> 23 25 24 26 #include "jabber.h" … … 107 109 } 108 110 109 static char *sasl_get_part( char *data, char *field ) 111 /* Non-static function, but not mentioned in jabber.h because it's for internal 112 use, just that the unittest should be able to reach it... */ 113 char *sasl_get_part( char *data, char *field ) 110 114 { 111 115 int i, len; 112 116 113 117 len = strlen( field ); 118 119 while( isspace( *data ) || *data == ',' ) 120 data ++; 114 121 115 122 if( g_strncasecmp( data, field, len ) == 0 && data[len] == '=' ) … … 129 136 } 130 137 131 /* If we got a comma, we got a new field. Check it. */ 132 if( data[i] == ',' && 133 g_strncasecmp( data + i + 1, field, len ) == 0 && 134 data[i+len+1] == '=' ) 138 /* If we got a comma, we got a new field. Check it, 139 find the next key after it. */ 140 if( data[i] == ',' ) 135 141 { 136 i += len + 2; 137 break; 142 while( isspace( data[i] ) || data[i] == ',' ) 143 i ++; 144 145 if( g_strncasecmp( data + i, field, len ) == 0 && 146 data[i+len] == '=' ) 147 { 148 i += len + 1; 149 break; 150 } 138 151 } 139 152 }
Note: See TracChangeset
for help on using the changeset viewer.