Changeset 84b045d for protocols/jabber
- Timestamp:
- 2007-04-16T01:03:08Z (18 years ago)
- Branches:
- master
- Children:
- 6bbb939
- Parents:
- c2fb3809
- Location:
- protocols/jabber
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
rc2fb3809 r84b045d 117 117 jd->fd = -1; 118 118 119 imc _error( ic, "Short write() to server" );119 imcb_error( ic, "Short write() to server" ); 120 120 imc_logout( ic, TRUE ); 121 121 return FALSE; … … 160 160 if( xt_feed( jd->xt, buf, st ) < 0 ) 161 161 { 162 imc _error( ic, "XML stream error" );162 imcb_error( ic, "XML stream error" ); 163 163 imc_logout( ic, TRUE ); 164 164 return FALSE; … … 203 203 if( set_getbool( &ic->acc->set, "tls" ) ) 204 204 { 205 imc _error( ic, "TLS is turned on for this "205 imcb_error( ic, "TLS is turned on for this " 206 206 "account, but is not supported by this server" ); 207 207 imc_logout( ic, FALSE ); … … 216 216 else 217 217 { 218 imc _error( ic, "XML stream error" );218 imcb_error( ic, "XML stream error" ); 219 219 imc_logout( ic, TRUE ); 220 220 return FALSE; … … 227 227 jd->fd = -1; 228 228 229 imc _error( ic, "Error while reading from server" );229 imcb_error( ic, "Error while reading from server" ); 230 230 imc_logout( ic, TRUE ); 231 231 return FALSE; … … 242 242 if( source == -1 ) 243 243 { 244 imc _error( ic, "Could not connect to server" );244 imcb_error( ic, "Could not connect to server" ); 245 245 imc_logout( ic, TRUE ); 246 246 return FALSE; 247 247 } 248 248 249 imc _log( ic, "Connected to server, logging in" );249 imcb_log( ic, "Connected to server, logging in" ); 250 250 251 251 return jabber_start_stream( ic ); … … 263 263 jd->ssl = NULL; 264 264 265 imc _error( ic, "Could not connect to server" );265 imcb_error( ic, "Could not connect to server" ); 266 266 imc_logout( ic, TRUE ); 267 267 return FALSE; 268 268 } 269 269 270 imc _log( ic, "Connected to server, logging in" );270 imcb_log( ic, "Connected to server, logging in" ); 271 271 272 272 return jabber_start_stream( ic ); … … 297 297 if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) ) 298 298 { 299 imc _error( ic, "Server requires TLS connections, but TLS is turned off for this account" );299 imcb_error( ic, "Server requires TLS connections, but TLS is turned off for this account" ); 300 300 imc_logout( ic, FALSE ); 301 301 … … 327 327 if( !trytls && set_getbool( &ic->acc->set, "tls" ) ) 328 328 { 329 imc _error( ic, "TLS is turned on for this account, but is not supported by this server" );329 imcb_error( ic, "TLS is turned on for this account, but is not supported by this server" ); 330 330 imc_logout( ic, FALSE ); 331 331 … … 417 417 jd->w_inpa = jd->r_inpa = 0; 418 418 419 imc _log( ic, "Converting stream to TLS" );419 imcb_log( ic, "Converting stream to TLS" ); 420 420 421 421 jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); … … 453 453 if( type == NULL ) 454 454 { 455 imc _error( ic, "Unknown stream error reported by server" );455 imcb_error( ic, "Unknown stream error reported by server" ); 456 456 imc_logout( ic, allow_reconnect ); 457 457 return XT_ABORT; … … 463 463 if( strcmp( type, "conflict" ) == 0 ) 464 464 { 465 imc _error( ic, "Account and resource used from a different location" );465 imcb_error( ic, "Account and resource used from a different location" ); 466 466 allow_reconnect = FALSE; 467 467 } 468 468 else 469 469 { 470 imc _error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );470 imcb_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" ); 471 471 } 472 472 -
protocols/jabber/iq.c
rc2fb3809 r84b045d 39 39 if( !type ) 40 40 { 41 imc _error( ic, "Received IQ packet without type." );41 imcb_error( ic, "Received IQ packet without type." ); 42 42 imc_logout( ic, TRUE ); 43 43 return XT_ABORT; … … 60 60 61 61 if( entry == NULL ) 62 imc _log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );62 imcb_log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s ); 63 63 else if( entry->func ) 64 64 return entry->func( ic, node, entry->node ); … … 69 69 !( s = xt_find_attr( c, "xmlns" ) ) ) 70 70 { 71 imc _log( ic, "WARNING: Received incomplete IQ-%s packet", type );71 imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type ); 72 72 return XT_HANDLED; 73 73 } … … 132 132 !( s = xt_find_attr( c, "xmlns" ) ) ) 133 133 { 134 imc _log( ic, "WARNING: Received incomplete IQ-%s packet", type );134 imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type ); 135 135 return XT_HANDLED; 136 136 } … … 154 154 else 155 155 { 156 imc _log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );156 imcb_log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" ); 157 157 158 158 xt_free_node( reply ); … … 219 219 if( !( query = xt_find_node( node->children, "query" ) ) ) 220 220 { 221 imc _log( ic, "WARNING: Received incomplete IQ packet while authenticating" );221 imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" ); 222 222 imc_logout( ic, FALSE ); 223 223 return XT_HANDLED; … … 258 258 xt_free_node( reply ); 259 259 260 imc _error( ic, "Can't find suitable authentication method" );260 imcb_error( ic, "Can't find suitable authentication method" ); 261 261 imc_logout( ic, FALSE ); 262 262 return XT_ABORT; … … 277 277 if( !( type = xt_find_attr( node, "type" ) ) ) 278 278 { 279 imc _log( ic, "WARNING: Received incomplete IQ packet while authenticating" );279 imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" ); 280 280 imc_logout( ic, FALSE ); 281 281 return XT_HANDLED; … … 284 284 if( strcmp( type, "error" ) == 0 ) 285 285 { 286 imc _error( ic, "Authentication failure" );286 imcb_error( ic, "Authentication failure" ); 287 287 imc_logout( ic, FALSE ); 288 288 return XT_ABORT; … … 311 311 if( c && c->text_len && ( s = strchr( c->text, '/' ) ) && 312 312 strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 ) 313 imc _log( ic, "Server changed session resource string to `%s'", s + 1 );313 imcb_log( ic, "Server changed session resource string to `%s'", s + 1 ); 314 314 315 315 jd->flags &= ~JFLAG_WAIT_BIND; … … 334 334 int st; 335 335 336 imc _log( ic, "Authenticated, requesting buddy list" );336 imcb_log( ic, "Authenticated, requesting buddy list" ); 337 337 338 338 node = xt_new_node( "query", NULL, NULL ); … … 353 353 if( !( query = xt_find_node( node->children, "query" ) ) ) 354 354 { 355 imc _log( ic, "WARNING: Received NULL roster packet" );355 imcb_log( ic, "WARNING: Received NULL roster packet" ); 356 356 return XT_HANDLED; 357 357 } … … 397 397 398 398 if( initial ) 399 imc _connected( ic );399 imcb_connected( ic ); 400 400 401 401 return XT_HANDLED; … … 428 428 { 429 429 s = xt_find_attr( orig, "to" ); /* If this returns NULL something's wrong.. */ 430 imc _log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );430 imcb_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" ); 431 431 return XT_HANDLED; 432 432 } … … 536 536 /* *sigh* */ 537 537 538 imc _log( ic, "%s", reply->str );538 imcb_log( ic, "%s", reply->str ); 539 539 g_string_free( reply, TRUE ); 540 540 -
protocols/jabber/jabber.c
rc2fb3809 r84b045d 59 59 static void jabber_login( account_t *acc ) 60 60 { 61 struct im_connection *ic = imc _new( acc );61 struct im_connection *ic = imcb_new( acc ); 62 62 struct jabber_data *jd = g_new0( struct jabber_data, 1 ); 63 63 struct ns_srv_reply *srv = NULL; … … 72 72 if( jd->server == NULL ) 73 73 { 74 imc _error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );74 imcb_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" ); 75 75 imc_logout( ic, FALSE ); 76 76 return; … … 159 159 connect_to = jd->server; 160 160 161 imc _log( ic, "Connecting" );161 imcb_log( ic, "Connecting" ); 162 162 163 163 if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN || 164 164 set_getint( &acc->set, "port" ) > JABBER_PORT_MAX ) 165 165 { 166 imc _log( ic, "Incorrect port number, must be in the %d-%d range",166 imcb_log( ic, "Incorrect port number, must be in the %d-%d range", 167 167 JABBER_PORT_MIN, JABBER_PORT_MAX ); 168 168 imc_logout( ic, FALSE ); … … 186 186 if( jd->fd == -1 ) 187 187 { 188 imc _error( ic, "Could not connect to server" );188 imcb_error( ic, "Could not connect to server" ); 189 189 imc_logout( ic, TRUE ); 190 190 } … … 285 285 while( bud ) 286 286 { 287 imc _log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",287 imcb_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s", 288 288 bud->full_jid, bud->priority, 289 289 bud->away_state ? bud->away_state->full_name : "(none)", -
protocols/jabber/jabber_util.c
rc2fb3809 r84b045d 224 224 225 225 if( find_buddy( bla->ic, bla->handle ) == NULL ) 226 show_got_added( bla->ic, bla->handle, NULL );226 imcb_ask_add( bla->ic, bla->handle, NULL ); 227 227 228 228 g_free( bla->handle ); … … 247 247 248 248 buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list.", handle ); 249 do_ask_dialog( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );249 imcb_ask( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no ); 250 250 g_free( buf ); 251 251 } -
protocols/jabber/presence.c
rc2fb3809 r84b045d 41 41 { 42 42 if( set_getbool( &ic->irc->set, "debug" ) ) 43 imc _log( ic, "WARNING: Could not handle presence information from JID: %s", from );43 imcb_log( ic, "WARNING: Could not handle presence information from JID: %s", from ); 44 44 return XT_HANDLED; 45 45 } … … 74 74 { 75 75 if( set_getbool( &ic->irc->set, "debug" ) ) 76 imc _log( ic, "WARNING: Received presence information from unknown JID: %s", from );76 imcb_log( ic, "WARNING: Received presence information from unknown JID: %s", from ); 77 77 return XT_HANDLED; 78 78 } … … 103 103 { 104 104 /* Not sure about this one, actually... */ 105 imc _log( ic, "%s just accepted your authorization request", from );105 imcb_log( ic, "%s just accepted your authorization request", from ); 106 106 } 107 107 else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 ) -
protocols/jabber/sasl.c
rc2fb3809 r84b045d 38 38 IQ authentication. Strange things happen when you try 39 39 to do both... */ 40 imc _log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );40 imcb_log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" ); 41 41 return XT_HANDLED; 42 42 } … … 45 45 if( !s || strcmp( s, XMLNS_SASL ) != 0 ) 46 46 { 47 imc _log( ic, "Stream error while authenticating" );47 imcb_log( ic, "Stream error while authenticating" ); 48 48 imc_logout( ic, FALSE ); 49 49 return XT_ABORT; … … 63 63 if( !sup_plain && !sup_digest ) 64 64 { 65 imc _error( ic, "No known SASL authentication schemes supported" );65 imcb_error( ic, "No known SASL authentication schemes supported" ); 66 66 imc_logout( ic, FALSE ); 67 67 return XT_ABORT; … … 280 280 281 281 error: 282 imc _error( ic, "Incorrect SASL challenge received" );282 imcb_error( ic, "Incorrect SASL challenge received" ); 283 283 imc_logout( ic, FALSE ); 284 284 … … 304 304 if( !s || strcmp( s, XMLNS_SASL ) != 0 ) 305 305 { 306 imc _log( ic, "Stream error while authenticating" );306 imcb_log( ic, "Stream error while authenticating" ); 307 307 imc_logout( ic, FALSE ); 308 308 return XT_ABORT; … … 311 311 if( strcmp( node->name, "success" ) == 0 ) 312 312 { 313 imc _log( ic, "Authentication finished" );313 imcb_log( ic, "Authentication finished" ); 314 314 jd->flags |= JFLAG_AUTHENTICATED | JFLAG_STREAM_RESTART; 315 315 } 316 316 else if( strcmp( node->name, "failure" ) == 0 ) 317 317 { 318 imc _error( ic, "Authentication failure" );318 imcb_error( ic, "Authentication failure" ); 319 319 imc_logout( ic, FALSE ); 320 320 return XT_ABORT;
Note: See TracChangeset
for help on using the changeset viewer.