Changeset aef4828 for protocols/jabber
- Timestamp:
- 2007-04-06T05:20:31Z (18 years ago)
- Branches:
- master
- Children:
- 552e641
- Parents:
- 0da65d5
- Location:
- protocols/jabber
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
r0da65d5 raef4828 117 117 jd->fd = -1; 118 118 119 hide_login_progress_error( ic, "Short write() to server" );120 signoff( ic );119 imc_error( ic, "Short write() to server" ); 120 imc_logout( ic ); 121 121 return FALSE; 122 122 } … … 160 160 if( xt_feed( jd->xt, buf, st ) < 0 ) 161 161 { 162 hide_login_progress_error( ic, "XML stream error" );163 signoff( ic );162 imc_error( ic, "XML stream error" ); 163 imc_logout( ic ); 164 164 return FALSE; 165 165 } … … 203 203 if( set_getbool( &ic->acc->set, "tls" ) ) 204 204 { 205 hide_login_progress( ic, "TLS is turned on for this "205 imc_error( ic, "TLS is turned on for this " 206 206 "account, but is not supported by this server" ); 207 signoff( ic );207 imc_logout( ic ); 208 208 return FALSE; 209 209 } … … 216 216 else 217 217 { 218 hide_login_progress( ic, "XML stream error" );219 signoff( ic );218 imc_error( ic, "XML stream error" ); 219 imc_logout( ic ); 220 220 return FALSE; 221 221 } … … 227 227 jd->fd = -1; 228 228 229 hide_login_progress_error( ic, "Error while reading from server" );230 signoff( ic );229 imc_error( ic, "Error while reading from server" ); 230 imc_logout( ic ); 231 231 return FALSE; 232 232 } … … 242 242 if( source == -1 ) 243 243 { 244 hide_login_progress( ic, "Could not connect to server" );245 signoff( ic );244 imc_error( ic, "Could not connect to server" ); 245 imc_logout( ic ); 246 246 return FALSE; 247 247 } 248 248 249 set_login_progress( ic, 1, "Connected to server, logging in" );249 imc_log( ic, "Connected to server, logging in" ); 250 250 251 251 return jabber_start_stream( ic ); … … 263 263 jd->ssl = NULL; 264 264 265 hide_login_progress( ic, "Could not connect to server" );266 signoff( ic );265 imc_error( ic, "Could not connect to server" ); 266 imc_logout( ic ); 267 267 return FALSE; 268 268 } 269 269 270 set_login_progress( ic, 1, "Connected to server, logging in" );270 imc_log( ic, "Connected to server, logging in" ); 271 271 272 272 return jabber_start_stream( ic ); … … 275 275 static xt_status jabber_end_of_stream( struct xt_node *node, gpointer data ) 276 276 { 277 signoff( data );277 imc_logout( data ); 278 278 return XT_ABORT; 279 279 } … … 297 297 if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) ) 298 298 { 299 hide_login_progress( ic, "Server requires TLS connections, but TLS is turned off for this account" );300 signoff( ic );299 imc_error( ic, "Server requires TLS connections, but TLS is turned off for this account" ); 300 imc_logout( ic ); 301 301 302 302 return XT_ABORT; … … 327 327 if( !trytls && set_getbool( &ic->acc->set, "tls" ) ) 328 328 { 329 hide_login_progress( ic, "TLS is turned on for this account, but is not supported by this server" );330 signoff( ic );329 imc_error( ic, "TLS is turned on for this account, but is not supported by this server" ); 330 imc_logout( ic ); 331 331 332 332 return XT_ABORT; … … 417 417 jd->w_inpa = jd->r_inpa = 0; 418 418 419 set_login_progress( ic, 1, "Converting stream to TLS" );419 imc_log( ic, "Converting stream to TLS" ); 420 420 421 421 jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); … … 452 452 if( type == NULL ) 453 453 { 454 hide_login_progress_error( ic, "Unknown stream error reported by server" );455 signoff( ic );454 imc_error( ic, "Unknown stream error reported by server" ); 455 imc_logout( ic ); 456 456 return XT_ABORT; 457 457 } … … 462 462 if( strcmp( type, "conflict" ) == 0 ) 463 463 { 464 hide_login_progress( ic, "Account and resource used from a different location" );464 imc_error( ic, "Account and resource used from a different location" ); 465 465 ic->wants_to_die = TRUE; 466 466 } … … 468 468 { 469 469 s = g_strdup_printf( "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" ); 470 hide_login_progress_error( ic, s );470 imc_error( ic, s ); 471 471 g_free( s ); 472 472 } 473 473 474 signoff( ic );474 imc_logout( ic ); 475 475 476 476 return XT_ABORT; -
protocols/jabber/iq.c
r0da65d5 raef4828 39 39 if( !type ) 40 40 { 41 hide_login_progress_error( ic, "Received IQ packet without type." );42 signoff( ic );41 imc_error( ic, "Received IQ packet without type." ); 42 imc_logout( ic ); 43 43 return XT_ABORT; 44 44 } … … 60 60 61 61 if( entry == NULL ) 62 serv_got_crap( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );62 imc_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 serv_got_crap( ic, "WARNING: Received incomplete IQ-%s packet", type );71 imc_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 serv_got_crap( ic, "WARNING: Received incomplete IQ-%s packet", type );134 imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type ); 135 135 return XT_HANDLED; 136 136 } … … 154 154 else 155 155 { 156 serv_got_crap( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );156 imc_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 serv_got_crap( ic, "WARNING: Received incomplete IQ packet while authenticating" );222 signoff( ic );221 imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" ); 222 imc_logout( ic ); 223 223 return XT_HANDLED; 224 224 } … … 258 258 xt_free_node( reply ); 259 259 260 hide_login_progress( ic, "Can't find suitable authentication method" );261 signoff( ic );260 imc_error( ic, "Can't find suitable authentication method" ); 261 imc_logout( ic ); 262 262 return XT_ABORT; 263 263 } … … 277 277 if( !( type = xt_find_attr( node, "type" ) ) ) 278 278 { 279 serv_got_crap( ic, "WARNING: Received incomplete IQ packet while authenticating" );280 signoff( ic );279 imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" ); 280 imc_logout( ic ); 281 281 return XT_HANDLED; 282 282 } … … 284 284 if( strcmp( type, "error" ) == 0 ) 285 285 { 286 hide_login_progress( ic, "Authentication failure" );287 signoff( ic );286 imc_error( ic, "Authentication failure" ); 287 imc_logout( ic ); 288 288 return XT_ABORT; 289 289 } … … 311 311 if( c && c->text_len && ( s = strchr( c->text, '/' ) ) && 312 312 strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 ) 313 serv_got_crap( ic, "Server changed session resource string to `%s'", s + 1 );313 imc_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 set_login_progress( ic, 1, "Authenticated, requesting buddy list" );336 imc_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 serv_got_crap( ic, "WARNING: Received NULL roster packet" );355 imc_log( ic, "WARNING: Received NULL roster packet" ); 356 356 return XT_HANDLED; 357 357 } … … 397 397 398 398 if( initial ) 399 account_online( ic );399 imc_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 serv_got_crap( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );430 imc_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" ); 431 431 return XT_HANDLED; 432 432 } … … 536 536 /* *sigh* */ 537 537 538 serv_got_crap( ic, reply->str );538 imc_log( ic, reply->str ); 539 539 g_string_free( reply, TRUE ); 540 540 -
protocols/jabber/jabber.c
r0da65d5 raef4828 59 59 static void jabber_login( account_t *acc ) 60 60 { 61 struct im_connection *ic = new_gaim_conn( acc );61 struct im_connection *ic = imc_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 hide_login_progress( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );75 signoff( ic );74 imc_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" ); 75 imc_logout( ic ); 76 76 return; 77 77 } … … 159 159 connect_to = jd->server; 160 160 161 set_login_progress( ic, 0, "Connecting" );161 imc_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 serv_got_crap( ic, "Incorrect port number, must be in the %d-%d range",166 imc_log( ic, "Incorrect port number, must be in the %d-%d range", 167 167 JABBER_PORT_MIN, JABBER_PORT_MAX ); 168 signoff( ic );168 imc_logout( ic ); 169 169 return; 170 170 } … … 186 186 if( jd->fd == -1 ) 187 187 { 188 hide_login_progress( ic, "Could not connect to server" );189 signoff( ic );188 imc_error( ic, "Could not connect to server" ); 189 imc_logout( ic ); 190 190 } 191 191 } … … 285 285 while( bud ) 286 286 { 287 serv_got_crap( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",287 imc_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/presence.c
r0da65d5 raef4828 41 41 { 42 42 if( set_getbool( &ic->irc->set, "debug" ) ) 43 serv_got_crap( ic, "WARNING: Could not handle presence information from JID: %s", from );43 imc_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 serv_got_crap( ic, "WARNING: Received presence information from unknown JID: %s", from );76 imc_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 serv_got_crap( ic, "%s just accepted your authorization request", from );105 imc_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
r0da65d5 raef4828 38 38 IQ authentication. Strange things happen when you try 39 39 to do both... */ 40 serv_got_crap( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );40 imc_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 signoff( ic );47 imc_logout( ic ); 48 48 return XT_ABORT; 49 49 } … … 62 62 if( !sup_plain && !sup_digest ) 63 63 { 64 hide_login_progress( ic, "No known SASL authentication schemes supported" );65 signoff( ic );64 imc_error( ic, "No known SASL authentication schemes supported" ); 65 imc_logout( ic ); 66 66 return XT_ABORT; 67 67 } … … 279 279 280 280 error: 281 hide_login_progress( ic, "Incorrect SASL challenge received" );282 signoff( ic );281 imc_error( ic, "Incorrect SASL challenge received" ); 282 imc_logout( ic ); 283 283 284 284 silent_error: … … 303 303 if( !s || strcmp( s, XMLNS_SASL ) != 0 ) 304 304 { 305 signoff( ic );305 imc_logout( ic ); 306 306 return XT_ABORT; 307 307 } … … 309 309 if( strcmp( node->name, "success" ) == 0 ) 310 310 { 311 set_login_progress( ic, 1, "Authentication finished" );311 imc_log( ic, "Authentication finished" ); 312 312 jd->flags |= JFLAG_AUTHENTICATED | JFLAG_STREAM_RESTART; 313 313 } 314 314 else if( strcmp( node->name, "failure" ) == 0 ) 315 315 { 316 hide_login_progress( ic, "Authentication failure" );317 signoff( ic );316 imc_error( ic, "Authentication failure" ); 317 imc_logout( ic ); 318 318 return XT_ABORT; 319 319 }
Note: See TracChangeset
for help on using the changeset viewer.