Changeset 84b045d for protocols/oscar/oscar.c
- Timestamp:
- 2007-04-16T01:03:08Z (17 years ago)
- Branches:
- master
- Children:
- 6bbb939
- Parents:
- c2fb3809
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/oscar.c
rc2fb3809 r84b045d 267 267 if ((conn->type == AIM_CONN_TYPE_BOS) || 268 268 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) { 269 imc _error(ic, _("Disconnected."));269 imcb_error(ic, _("Disconnected.")); 270 270 imc_logout(ic, TRUE); 271 271 } else if (conn->type == AIM_CONN_TYPE_CHAT) { … … 277 277 c->fd = -1; 278 278 aim_conn_kill(odata->sess, &conn); 279 imc _error(sess->aux_data, _("You have been disconnected from chat room %s."), c->name);279 imcb_error(sess->aux_data, _("You have been disconnected from chat room %s."), c->name); 280 280 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { 281 281 if (odata->cnpa > 0) … … 288 288 g_slist_remove(odata->create_rooms, cr); 289 289 g_free(cr); 290 imc _error(sess->aux_data, _("Chat is currently unavailable"));290 imcb_error(sess->aux_data, _("Chat is currently unavailable")); 291 291 } 292 292 aim_conn_kill(odata->sess, &conn); … … 325 325 326 326 if (source < 0) { 327 imc _error(ic, _("Couldn't connect to host"));327 imcb_error(ic, _("Couldn't connect to host")); 328 328 imc_logout(ic, TRUE); 329 329 return FALSE; … … 353 353 aim_session_t *sess; 354 354 aim_conn_t *conn; 355 struct im_connection *ic = imc _new(acc);355 struct im_connection *ic = imcb_new(acc); 356 356 struct oscar_data *odata = ic->proto_data = g_new0(struct oscar_data, 1); 357 357 … … 380 380 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL); 381 381 if (conn == NULL) { 382 imc _error(ic, _("Unable to login to AIM"));382 imcb_error(ic, _("Unable to login to AIM")); 383 383 imc_logout(ic, TRUE); 384 384 return; … … 386 386 387 387 if (acc->server == NULL) { 388 imc _error(ic, "No servername specified");388 imcb_error(ic, "No servername specified"); 389 389 imc_logout(ic, FALSE); 390 390 return; … … 393 393 if (g_strcasecmp(acc->server, "login.icq.com") != 0 && 394 394 g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) { 395 imc _log(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);396 } 397 398 imc _log(ic, _("Signon: %s"), ic->acc->user);395 imcb_log(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server); 396 } 397 398 imcb_log(ic, _("Signon: %s"), ic->acc->user); 399 399 400 400 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); … … 404 404 conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, ic); 405 405 if (conn->fd < 0) { 406 imc _error(ic, _("Couldn't connect to host"));406 imcb_error(ic, _("Couldn't connect to host")); 407 407 imc_logout(ic, TRUE); 408 408 return; … … 464 464 465 465 if (source < 0) { 466 imc _error(ic, _("Could Not Connect"));466 imcb_error(ic, _("Could Not Connect")); 467 467 imc_logout(ic, TRUE); 468 468 return FALSE; … … 472 472 ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ, 473 473 oscar_callback, bosconn); 474 imc _log(ic, _("Connection established, cookie sent"));474 imcb_log(ic, _("Connection established, cookie sent")); 475 475 476 476 return FALSE; … … 495 495 case 0x05: 496 496 /* Incorrect nick/password */ 497 imc _error(ic, _("Incorrect nickname or password."));497 imcb_error(ic, _("Incorrect nickname or password.")); 498 498 // plugin_event(event_error, (void *)980, 0, 0, 0); 499 499 break; 500 500 case 0x11: 501 501 /* Suspended account */ 502 imc _error(ic, _("Your account is currently suspended."));502 imcb_error(ic, _("Your account is currently suspended.")); 503 503 break; 504 504 case 0x18: 505 505 /* connecting too frequently */ 506 imc _error(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));506 imcb_error(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); 507 507 break; 508 508 case 0x1c: 509 509 /* client too old */ 510 imc _error(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE));510 imcb_error(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE)); 511 511 break; 512 512 default: 513 imc _error(ic, _("Authentication Failed"));513 imcb_error(ic, _("Authentication Failed")); 514 514 break; 515 515 } … … 523 523 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, NULL); 524 524 if (bosconn == NULL) { 525 imc _error(ic, _("Internal Error"));525 imcb_error(ic, _("Internal Error")); 526 526 od->killme = TRUE; 527 527 return 0; … … 569 569 g_free(host); 570 570 if (bosconn->fd < 0) { 571 imc _error(ic, _("Could Not Connect"));571 imcb_error(ic, _("Could Not Connect")); 572 572 od->killme = TRUE; 573 573 return 0; … … 607 607 } 608 608 if (in != '\n') { 609 imc _error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."609 imcb_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM." 610 610 " You may be disconnected shortly."); 611 611 b_event_remove(pos->inpa); … … 630 630 631 631 if (source < 0) { 632 imc _error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."632 imcb_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM." 633 633 " You may be disconnected shortly."); 634 634 if (pos->modname) … … 708 708 g_free(pos->modname); 709 709 g_free(pos); 710 imc _error(sess->aux_data, "Gaim was unable to get a valid hash for logging into AIM."710 imcb_error(sess->aux_data, "Gaim was unable to get a valid hash for logging into AIM." 711 711 " You may be disconnected shortly."); 712 712 } … … 1112 1112 inv->name = g_strdup(name); 1113 1113 1114 do_ask_dialog( ic, txt, inv, oscar_accept_chat, oscar_reject_chat);1114 imcb_ask( ic, txt, inv, oscar_accept_chat, oscar_reject_chat); 1115 1115 1116 1116 if (name) … … 1130 1130 // aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message); 1131 1131 if(find_buddy(data->ic, uin) == NULL) 1132 show_got_added(data->ic, uin, NULL);1132 imcb_ask_add(data->ic, uin, NULL); 1133 1133 1134 1134 g_free(uin); … … 1164 1164 data->ic = ic; 1165 1165 data->uin = uin; 1166 do_ask_dialog(ic, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny);1166 imcb_ask(ic, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny); 1167 1167 g_free(dialog_msg); 1168 1168 } … … 1207 1207 1208 1208 case 0x0007: { /* Someone has denied you authorization */ 1209 imc _log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );1209 imcb_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") ); 1210 1210 } break; 1211 1211 1212 1212 case 0x0008: { /* Someone has granted you authorization */ 1213 imc _log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );1213 imcb_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") ); 1214 1214 } break; 1215 1215 … … 1277 1277 case 0: 1278 1278 /* Invalid (0) */ 1279 imc _error(sess->aux_data,1279 imcb_error(sess->aux_data, 1280 1280 nummissed == 1 ? 1281 1281 _("You missed %d message from %s because it was invalid.") : … … 1286 1286 case 1: 1287 1287 /* Message too large */ 1288 imc _error(sess->aux_data,1288 imcb_error(sess->aux_data, 1289 1289 nummissed == 1 ? 1290 1290 _("You missed %d message from %s because it was too large.") : … … 1295 1295 case 2: 1296 1296 /* Rate exceeded */ 1297 imc _error(sess->aux_data,1297 imcb_error(sess->aux_data, 1298 1298 nummissed == 1 ? 1299 1299 _("You missed %d message from %s because the rate limit has been exceeded.") : … … 1304 1304 case 3: 1305 1305 /* Evil Sender */ 1306 imc _error(sess->aux_data,1306 imcb_error(sess->aux_data, 1307 1307 nummissed == 1 ? 1308 1308 _("You missed %d message from %s because it was too evil.") : … … 1313 1313 case 4: 1314 1314 /* Evil Receiver */ 1315 imc _error(sess->aux_data,1315 imcb_error(sess->aux_data, 1316 1316 nummissed == 1 ? 1317 1317 _("You missed %d message from %s because you are too evil.") : … … 1321 1321 break; 1322 1322 default: 1323 imc _error(sess->aux_data,1323 imcb_error(sess->aux_data, 1324 1324 nummissed == 1 ? 1325 1325 _("You missed %d message from %s for unknown reasons.") : … … 1341 1341 va_end(ap); 1342 1342 1343 imc _error(sess->aux_data, _("SNAC threw error: %s"),1343 imcb_error(sess->aux_data, _("SNAC threw error: %s"), 1344 1344 reason < msgerrreasonlen ? msgerrreason[reason] : "Unknown error"); 1345 1345 … … 1357 1357 va_end(ap); 1358 1358 1359 imc _error(sess->aux_data, _("Your message to %s did not get sent: %s"), destn,1359 imcb_error(sess->aux_data, _("Your message to %s did not get sent: %s"), destn, 1360 1360 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); 1361 1361 … … 1373 1373 va_end(ap); 1374 1374 1375 imc _error(sess->aux_data, _("User information for %s unavailable: %s"), destn,1375 imcb_error(sess->aux_data, _("User information for %s unavailable: %s"), destn, 1376 1376 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); 1377 1377 … … 1390 1390 1391 1391 if (id < 4) 1392 imc _error(sess->aux_data, _("Your connection may be lost."));1392 imcb_error(sess->aux_data, _("Your connection may be lost.")); 1393 1393 1394 1394 return 1; … … 1584 1584 aim_conn_setlatency(fr->conn, windowsize/4); 1585 1585 } else if (code == AIM_RATE_CODE_LIMIT) { 1586 imc _error(sess->aux_data, _("The last message was not sent because you are over the rate limit. "1586 imcb_error(sess->aux_data, _("The last message was not sent because you are over the rate limit. " 1587 1587 "Please wait 10 seconds and try again.")); 1588 1588 aim_conn_setlatency(fr->conn, windowsize/2); … … 1789 1789 1790 1790 case 0x0007: { /* Someone has denied you authorization */ 1791 imc _log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );1791 imcb_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") ); 1792 1792 } break; 1793 1793 1794 1794 case 0x0008: { /* Someone has granted you authorization */ 1795 imc _log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );1795 imcb_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") ); 1796 1796 } break; 1797 1797 … … 1906 1906 1907 1907 if (od->rights.maxawaymsglen == 0) 1908 imc _error(ic, "oscar_set_away_aim called before locate rights received");1908 imcb_error(ic, "oscar_set_away_aim called before locate rights received"); 1909 1909 1910 1910 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); … … 1920 1920 1921 1921 if (strlen(message) > od->rights.maxawaymsglen) { 1922 imc _error(ic, "Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen);1922 imcb_error(ic, "Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen); 1923 1923 } 1924 1924 … … 2084 2084 2085 2085 /* Now that we have a buddy list, we can tell BitlBee that we're online. */ 2086 imc _connected(ic);2086 imcb_connected(ic); 2087 2087 2088 2088 return 1; … … 2106 2106 { 2107 2107 /* Hmm, the length should be even... */ 2108 imc _error( sess->aux_data, "Received SSI ACK package with non-even length");2108 imcb_error( sess->aux_data, "Received SSI ACK package with non-even length"); 2109 2109 return( 0 ); 2110 2110 } … … 2117 2117 if( st == 0x0E ) 2118 2118 { 2119 imc _log( sess->aux_data, "Buddy %s can't be added without authorization, requesting authorization", list );2119 imcb_log( sess->aux_data, "Buddy %s can't be added without authorization, requesting authorization", list ); 2120 2120 2121 2121 aim_ssi_auth_request( sess, fr->conn, list, "" ); … … 2303 2303 } 2304 2304 2305 imc _log(ic, "%s\n%s", _("User Info"), str->str);2305 imcb_log(ic, "%s\n%s", _("User Info"), str->str); 2306 2306 g_string_free(str, TRUE); 2307 2307 … … 2397 2397 idletime.tm_sec = 0; 2398 2398 strftime(buff, 256, _("%d days %H hours %M minutes"), &idletime); 2399 imc _log(ic, "%s: %s", _("Idle Time"), buff);2399 imcb_log(ic, "%s: %s", _("Idle Time"), buff); 2400 2400 } 2401 2401 2402 2402 if(text) { 2403 2403 utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length); 2404 imc _log(ic, "%s\n%s", _("User Info"), utf8);2404 imcb_log(ic, "%s\n%s", _("User Info"), utf8); 2405 2405 } else { 2406 imc _log(ic, _("No user info available."));2406 imcb_log(ic, _("No user info available.")); 2407 2407 } 2408 2408 } else if(infotype == AIM_GETINFO_AWAYMESSAGE && userinfo->flags & AIM_FLAG_AWAY) { 2409 2409 utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length); 2410 imc _log(ic, "%s\n%s", _("Away Message"), utf8);2410 imcb_log(ic, "%s\n%s", _("Away Message"), utf8); 2411 2411 } 2412 2412
Note: See TracChangeset
for help on using the changeset viewer.