Changeset 0da65d5 for protocols/oscar
- Timestamp:
- 2007-03-31T05:40:45Z (18 years ago)
- Branches:
- master
- Children:
- aef4828
- Parents:
- fa29d093
- Location:
- protocols/oscar
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/aim.h
rfa29d093 r0da65d5 574 574 575 575 struct aim_chat_invitation { 576 struct gaim_connection * gc;576 struct im_connection * ic; 577 577 char * name; 578 578 guint8 exchange; -
protocols/oscar/im.c
rfa29d093 r0da65d5 1417 1417 guint8 *plugin; 1418 1418 int i = 0, tmp = 0; 1419 struct gaim_connection *gc = sess->aux_data;1419 struct im_connection *ic = sess->aux_data; 1420 1420 1421 1421 /* at the moment we just can deal with requests, not with cancel or accept */ … … 1469 1469 case 0x9c: /* ICQ 5 seems to send this */ 1470 1470 aim_send_im_ch2_statusmessage(sess, userinfo->sn, args->cookie, 1471 gc->away ? gc->away : "", sess->aim_icq_state, dc);1471 ic->away ? ic->away : "", sess->aim_icq_state, dc); 1472 1472 break; 1473 1473 -
protocols/oscar/oscar.c
rfa29d093 r0da65d5 116 116 int inpa; 117 117 int id; 118 struct gaim_connection *gc; /* i hate this. */119 struct conversation*cnv; /* bah. */118 struct im_connection *ic; /* i hate this. */ 119 struct groupchat *cnv; /* bah. */ 120 120 int maxlen; 121 121 int maxvis; … … 123 123 124 124 struct ask_direct { 125 struct gaim_connection *gc;125 struct im_connection *ic; 126 126 char *sn; 127 127 char ip[64]; … … 130 130 131 131 struct icq_auth { 132 struct gaim_connection *gc;132 struct im_connection *ic; 133 133 guint32 uin; 134 134 }; … … 158 158 } 159 159 160 static struct chat_connection *find_oscar_chat_by_conn(struct gaim_connection *gc,160 static struct chat_connection *find_oscar_chat_by_conn(struct im_connection *ic, 161 161 aim_conn_t *conn) { 162 GSList *g = ((struct oscar_data *) gc->proto_data)->oscar_chats;162 GSList *g = ((struct oscar_data *)ic->proto_data)->oscar_chats; 163 163 struct chat_connection *c = NULL; 164 164 … … 243 243 aim_conn_t *conn = (aim_conn_t *)data; 244 244 aim_session_t *sess = aim_conn_getsess(conn); 245 struct gaim_connection *gc = sess ? sess->aux_data : NULL;245 struct im_connection *ic = sess ? sess->aux_data : NULL; 246 246 struct oscar_data *odata; 247 247 248 if (! gc) {249 /* gc is null. we return, else we seg SIGSEG on next line. */248 if (!ic) { 249 /* ic is null. we return, else we seg SIGSEG on next line. */ 250 250 return FALSE; 251 251 } 252 252 253 if (!g_slist_find(get_connections(), gc)) {253 if (!g_slist_find(get_connections(), ic)) { 254 254 /* oh boy. this is probably bad. i guess the only thing we 255 255 * can really do is return? */ … … 257 257 } 258 258 259 odata = (struct oscar_data *) gc->proto_data;259 odata = (struct oscar_data *)ic->proto_data; 260 260 261 261 if (condition & GAIM_INPUT_READ) { … … 263 263 aim_rxdispatch(odata->sess); 264 264 if (odata->killme) 265 signoff( gc);265 signoff(ic); 266 266 } else { 267 267 if ((conn->type == AIM_CONN_TYPE_BOS) || 268 268 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) { 269 hide_login_progress_error( gc, _("Disconnected."));270 signoff( gc);269 hide_login_progress_error(ic, _("Disconnected.")); 270 signoff(ic); 271 271 } else if (conn->type == AIM_CONN_TYPE_CHAT) { 272 struct chat_connection *c = find_oscar_chat_by_conn( gc, conn);272 struct chat_connection *c = find_oscar_chat_by_conn(ic, conn); 273 273 char buf[BUF_LONG]; 274 274 c->conn = NULL; … … 313 313 static gboolean oscar_login_connect(gpointer data, gint source, b_input_condition cond) 314 314 { 315 struct gaim_connection *gc = data;315 struct im_connection *ic = data; 316 316 struct oscar_data *odata; 317 317 aim_session_t *sess; 318 318 aim_conn_t *conn; 319 319 320 if (!g_slist_find(get_connections(), gc)) {320 if (!g_slist_find(get_connections(), ic)) { 321 321 closesocket(source); 322 322 return FALSE; 323 323 } 324 324 325 odata = gc->proto_data;325 odata = ic->proto_data; 326 326 sess = odata->sess; 327 327 conn = aim_getconn_type_all(sess, AIM_CONN_TYPE_AUTH); 328 328 329 329 if (source < 0) { 330 hide_login_progress( gc, _("Couldn't connect to host"));331 signoff( gc);330 hide_login_progress(ic, _("Couldn't connect to host")); 331 signoff(ic); 332 332 return FALSE; 333 333 } 334 334 335 335 aim_conn_completeconnect(sess, conn); 336 gc->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,336 ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ, 337 337 oscar_callback, conn); 338 338 … … 340 340 } 341 341 342 static void oscar_ acc_init(account_t *acc)342 static void oscar_init(account_t *acc) 343 343 { 344 344 set_t *s; … … 357 357 aim_conn_t *conn; 358 358 char buf[256]; 359 struct gaim_connection *gc = new_gaim_conn(acc);360 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1);359 struct im_connection *ic = new_gaim_conn(acc); 360 struct oscar_data *odata = ic->proto_data = g_new0(struct oscar_data, 1); 361 361 362 362 if (isdigit(acc->user[0])) { … … 365 365 We don't do those anymore, but let's stick with it, just in case 366 366 it accidentally fixes something else too... </bitlbee> */ 367 gc->password[8] = 0;367 ic->password[8] = 0; 368 368 } else { 369 gc->flags |= OPT_CONN_HTML;369 ic->flags |= OPT_CONN_HTML; 370 370 } 371 371 … … 378 378 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL); 379 379 odata->sess = sess; 380 sess->aux_data = gc;380 sess->aux_data = ic; 381 381 382 382 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL); 383 383 if (conn == NULL) { 384 hide_login_progress( gc, _("Unable to login to AIM"));385 signoff( gc);384 hide_login_progress(ic, _("Unable to login to AIM")); 385 signoff(ic); 386 386 return; 387 387 } 388 388 389 389 if (acc->server == NULL) { 390 hide_login_progress( gc, "No servername specified");391 signoff( gc);390 hide_login_progress(ic, "No servername specified"); 391 signoff(ic); 392 392 return; 393 393 } … … 395 395 if (g_strcasecmp(acc->server, "login.icq.com") != 0 && 396 396 g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) { 397 serv_got_crap( gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);398 } 399 400 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username);401 set_login_progress( gc, 2, buf);397 serv_got_crap(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server); 398 } 399 400 g_snprintf(buf, sizeof(buf), _("Signon: %s"), ic->username); 401 set_login_progress(ic, 2, buf); 402 402 403 403 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); … … 405 405 406 406 conn->status |= AIM_CONN_STATUS_INPROGRESS; 407 conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, gc);407 conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, ic); 408 408 if (conn->fd < 0) { 409 hide_login_progress( gc, _("Couldn't connect to host"));410 signoff( gc);409 hide_login_progress(ic, _("Couldn't connect to host")); 410 signoff(ic); 411 411 return; 412 412 } 413 aim_request_login(sess, conn, gc->username);414 } 415 416 static void oscar_ close(struct gaim_connection *gc) {417 struct oscar_data *odata = (struct oscar_data *) gc->proto_data;413 aim_request_login(sess, conn, ic->username); 414 } 415 416 static void oscar_logout(struct im_connection *ic) { 417 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 418 418 419 419 while (odata->oscar_chats) { … … 438 438 if (odata->oldp) 439 439 g_free(odata->oldp); 440 if ( gc->inpa > 0)441 b_event_remove( gc->inpa);440 if (ic->inpa > 0) 441 b_event_remove(ic->inpa); 442 442 if (odata->cnpa > 0) 443 443 b_event_remove(odata->cnpa); … … 447 447 g_free(odata->sess); 448 448 odata->sess = NULL; 449 g_free( gc->proto_data);450 gc->proto_data = NULL;449 g_free(ic->proto_data); 450 ic->proto_data = NULL; 451 451 } 452 452 453 453 static gboolean oscar_bos_connect(gpointer data, gint source, b_input_condition cond) { 454 struct gaim_connection *gc = data;454 struct im_connection *ic = data; 455 455 struct oscar_data *odata; 456 456 aim_session_t *sess; 457 457 aim_conn_t *bosconn; 458 458 459 if (!g_slist_find(get_connections(), gc)) {459 if (!g_slist_find(get_connections(), ic)) { 460 460 closesocket(source); 461 461 return FALSE; 462 462 } 463 463 464 odata = gc->proto_data;464 odata = ic->proto_data; 465 465 sess = odata->sess; 466 466 bosconn = odata->conn; 467 467 468 468 if (source < 0) { 469 hide_login_progress( gc, _("Could Not Connect"));470 signoff( gc);469 hide_login_progress(ic, _("Could Not Connect")); 470 signoff(ic); 471 471 return FALSE; 472 472 } 473 473 474 474 aim_conn_completeconnect(sess, bosconn); 475 gc->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,475 ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ, 476 476 oscar_callback, bosconn); 477 set_login_progress( gc, 4, _("Connection established, cookie sent"));477 set_login_progress(ic, 4, _("Connection established, cookie sent")); 478 478 479 479 return FALSE; … … 486 486 aim_conn_t *bosconn; 487 487 488 struct gaim_connection *gc = sess->aux_data;489 struct oscar_data *od = gc->proto_data;488 struct im_connection *ic = sess->aux_data; 489 struct oscar_data *od = ic->proto_data; 490 490 port = AIM_LOGIN_PORT; 491 491 … … 498 498 case 0x05: 499 499 /* Incorrect nick/password */ 500 hide_login_progress( gc, _("Incorrect nickname or password."));500 hide_login_progress(ic, _("Incorrect nickname or password.")); 501 501 // plugin_event(event_error, (void *)980, 0, 0, 0); 502 502 break; 503 503 case 0x11: 504 504 /* Suspended account */ 505 hide_login_progress( gc, _("Your account is currently suspended."));505 hide_login_progress(ic, _("Your account is currently suspended.")); 506 506 break; 507 507 case 0x18: 508 508 /* connecting too frequently */ 509 hide_login_progress( gc, _("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."));509 hide_login_progress(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.")); 510 510 break; 511 511 case 0x1c: 512 512 /* client too old */ 513 hide_login_progress( gc, _("The client version you are using is too old. Please upgrade at " WEBSITE));513 hide_login_progress(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE)); 514 514 break; 515 515 default: 516 hide_login_progress( gc, _("Authentication Failed"));516 hide_login_progress(ic, _("Authentication Failed")); 517 517 break; 518 518 } … … 526 526 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, NULL); 527 527 if (bosconn == NULL) { 528 hide_login_progress( gc, _("Internal Error"));528 hide_login_progress(ic, _("Internal Error")); 529 529 od->killme = TRUE; 530 530 return 0; … … 560 560 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MTN, gaim_parsemtn, 0); 561 561 562 ((struct oscar_data *) gc->proto_data)->conn = bosconn;562 ((struct oscar_data *)ic->proto_data)->conn = bosconn; 563 563 for (i = 0; i < (int)strlen(info->bosip); i++) { 564 564 if (info->bosip[i] == ':') { … … 569 569 host = g_strndup(info->bosip, i); 570 570 bosconn->status |= AIM_CONN_STATUS_INPROGRESS; 571 bosconn->fd = proxy_connect(host, port, oscar_bos_connect, gc);571 bosconn->fd = proxy_connect(host, port, oscar_bos_connect, ic); 572 572 g_free(host); 573 573 if (bosconn->fd < 0) { 574 hide_login_progress( gc, _("Could Not Connect"));574 hide_login_progress(ic, _("Could Not Connect")); 575 575 od->killme = TRUE; 576 576 return 0; 577 577 } 578 578 aim_sendcookie(sess, bosconn, info->cookie); 579 b_event_remove( gc->inpa);579 b_event_remove(ic->inpa); 580 580 581 581 return 1; … … 583 583 584 584 struct pieceofcrap { 585 struct gaim_connection *gc;585 struct im_connection *ic; 586 586 unsigned long offset; 587 587 unsigned long len; … … 595 595 { 596 596 struct pieceofcrap *pos = data; 597 struct oscar_data *od = pos-> gc->proto_data;597 struct oscar_data *od = pos->ic->proto_data; 598 598 char in = '\0'; 599 599 int x = 0; … … 610 610 } 611 611 if (in != '\n') { 612 do_error_dialog(pos-> gc, "Gaim was unable to get a valid hash for logging into AIM."612 do_error_dialog(pos->ic, "Gaim was unable to get a valid hash for logging into AIM." 613 613 " You may be disconnected shortly.", "Login Error"); 614 614 b_event_remove(pos->inpa); … … 633 633 634 634 if (source < 0) { 635 do_error_dialog(pos-> gc, "Gaim was unable to get a valid hash for logging into AIM."635 do_error_dialog(pos->ic, "Gaim was unable to get a valid hash for logging into AIM." 636 636 " You may be disconnected shortly.", "Login Error"); 637 637 if (pos->modname) … … 699 699 700 700 pos = g_new0(struct pieceofcrap, 1); 701 pos-> gc = sess->aux_data;701 pos->ic = sess->aux_data; 702 702 pos->conn = fr->conn; 703 703 … … 727 727 char *key; 728 728 va_list ap; 729 struct gaim_connection *gc = sess->aux_data;729 struct im_connection *ic = sess->aux_data; 730 730 731 731 va_start(ap, fr); … … 733 733 va_end(ap); 734 734 735 aim_send_login(sess, fr->conn, gc->username, gc->password, &info, key);735 aim_send_login(sess, fr->conn, ic->username, ic->password, &info, key); 736 736 737 737 return 1; … … 739 739 740 740 static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...) { 741 struct gaim_connection *gc = sess->aux_data;741 struct im_connection *ic = sess->aux_data; 742 742 struct chat_connection *chatcon; 743 743 static int id = 1; … … 751 751 aim_clientready(sess, fr->conn); 752 752 753 chatcon = find_oscar_chat_by_conn( gc, fr->conn);753 chatcon = find_oscar_chat_by_conn(ic, fr->conn); 754 754 chatcon->id = id; 755 chatcon->cnv = serv_got_joined_chat( gc, chatcon->show);755 chatcon->cnv = serv_got_joined_chat(ic, chatcon->show); 756 756 chatcon->cnv->data = chatcon; 757 757 … … 772 772 773 773 static gboolean oscar_chatnav_connect(gpointer data, gint source, b_input_condition cond) { 774 struct gaim_connection *gc = data;774 struct im_connection *ic = data; 775 775 struct oscar_data *odata; 776 776 aim_session_t *sess; 777 777 aim_conn_t *tstconn; 778 778 779 if (!g_slist_find(get_connections(), gc)) {779 if (!g_slist_find(get_connections(), ic)) { 780 780 closesocket(source); 781 781 return FALSE; 782 782 } 783 783 784 odata = gc->proto_data;784 odata = ic->proto_data; 785 785 sess = odata->sess; 786 786 tstconn = aim_getconn_type_all(sess, AIM_CONN_TYPE_CHATNAV); … … 800 800 static gboolean oscar_auth_connect(gpointer data, gint source, b_input_condition cond) 801 801 { 802 struct gaim_connection *gc = data;802 struct im_connection *ic = data; 803 803 struct oscar_data *odata; 804 804 aim_session_t *sess; 805 805 aim_conn_t *tstconn; 806 806 807 if (!g_slist_find(get_connections(), gc)) {807 if (!g_slist_find(get_connections(), ic)) { 808 808 closesocket(source); 809 809 return FALSE; 810 810 } 811 811 812 odata = gc->proto_data;812 odata = ic->proto_data; 813 813 sess = odata->sess; 814 814 tstconn = aim_getconn_type_all(sess, AIM_CONN_TYPE_AUTH); … … 829 829 { 830 830 struct chat_connection *ccon = data; 831 struct gaim_connection *gc = ccon->gc;831 struct im_connection *ic = ccon->ic; 832 832 struct oscar_data *odata; 833 833 aim_session_t *sess; 834 834 aim_conn_t *tstconn; 835 835 836 if (!g_slist_find(get_connections(), gc)) {836 if (!g_slist_find(get_connections(), ic)) { 837 837 closesocket(source); 838 838 g_free(ccon->show); … … 842 842 } 843 843 844 odata = gc->proto_data;844 odata = ic->proto_data; 845 845 sess = odata->sess; 846 846 tstconn = ccon->conn; … … 867 867 va_list ap; 868 868 struct aim_redirect_data *redir; 869 struct gaim_connection *gc = sess->aux_data;869 struct im_connection *ic = sess->aux_data; 870 870 aim_conn_t *tstconn; 871 871 int i; … … 899 899 900 900 tstconn->status |= AIM_CONN_STATUS_INPROGRESS; 901 tstconn->fd = proxy_connect(host, port, oscar_auth_connect, gc);901 tstconn->fd = proxy_connect(host, port, oscar_auth_connect, ic); 902 902 if (tstconn->fd < 0) { 903 903 aim_conn_kill(sess, &tstconn); … … 916 916 917 917 tstconn->status |= AIM_CONN_STATUS_INPROGRESS; 918 tstconn->fd = proxy_connect(host, port, oscar_chatnav_connect, gc);918 tstconn->fd = proxy_connect(host, port, oscar_chatnav_connect, ic); 919 919 if (tstconn->fd < 0) { 920 920 aim_conn_kill(sess, &tstconn); … … 938 938 ccon = g_new0(struct chat_connection, 1); 939 939 ccon->conn = tstconn; 940 ccon-> gc = gc;940 ccon->ic = ic; 941 941 ccon->fd = -1; 942 942 ccon->name = g_strdup(redir->chat.room); … … 967 967 968 968 static int gaim_parse_oncoming(aim_session_t *sess, aim_frame_t *fr, ...) { 969 struct gaim_connection *gc = sess->aux_data;970 struct oscar_data *od = gc->proto_data;969 struct im_connection *ic = sess->aux_data; 970 struct oscar_data *od = ic->proto_data; 971 971 aim_userinfo_t *info; 972 972 time_t time_idle = 0, signon = 0; … … 1018 1018 signon = time(NULL) - info->sessionlen; 1019 1019 1020 tmp = g_strdup(normalize( gc->username));1020 tmp = g_strdup(normalize(ic->username)); 1021 1021 if (!strcmp(tmp, normalize(info->sn))) 1022 g_snprintf( gc->displayname, sizeof(gc->displayname), "%s", info->sn);1022 g_snprintf(ic->displayname, sizeof(ic->displayname), "%s", info->sn); 1023 1023 g_free(tmp); 1024 1024 1025 serv_got_update( gc, info->sn, 1, info->warnlevel/10, signon,1025 serv_got_update(ic, info->sn, 1, info->warnlevel/10, signon, 1026 1026 time_idle, type, caps); 1027 1027 … … 1032 1032 aim_userinfo_t *info; 1033 1033 va_list ap; 1034 struct gaim_connection *gc = sess->aux_data;1034 struct im_connection *ic = sess->aux_data; 1035 1035 1036 1036 va_start(ap, fr); … … 1038 1038 va_end(ap); 1039 1039 1040 serv_got_update( gc, info->sn, 0, 0, 0, 0, 0, 0);1040 serv_got_update(ic, info->sn, 0, 0, 0, 0, 0, 0); 1041 1041 1042 1042 return 1; … … 1045 1045 static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { 1046 1046 char *tmp = g_malloc(BUF_LONG + 1); 1047 struct gaim_connection *gc = sess->aux_data;1047 struct im_connection *ic = sess->aux_data; 1048 1048 int flags = 0; 1049 1049 … … 1083 1083 1084 1084 strip_linefeed(tmp); 1085 serv_got_im( gc, userinfo->sn, tmp, flags, time(NULL), -1);1085 serv_got_im(ic, userinfo->sn, tmp, flags, time(NULL), -1); 1086 1086 g_free(tmp); 1087 1087 … … 1093 1093 1094 1094 static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) { 1095 struct gaim_connection *gc = sess->aux_data;1095 struct im_connection *ic = sess->aux_data; 1096 1096 1097 1097 if (args->status != AIM_RENDEZVOUS_PROPOSE) … … 1111 1111 g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", name, userinfo->sn, args->msg ); 1112 1112 1113 inv-> gc = gc;1113 inv->ic = ic; 1114 1114 inv->exchange = *exch; 1115 1115 inv->name = g_strdup(name); 1116 1116 1117 do_ask_dialog( gc, txt, inv, oscar_accept_chat, oscar_reject_chat);1117 do_ask_dialog( ic, txt, inv, oscar_accept_chat, oscar_reject_chat); 1118 1118 1119 1119 if (name) … … 1126 1126 static void gaim_icq_authgrant(gpointer w, struct icq_auth *data) { 1127 1127 char *uin, message; 1128 struct oscar_data *od = (struct oscar_data *)data-> gc->proto_data;1128 struct oscar_data *od = (struct oscar_data *)data->ic->proto_data; 1129 1129 1130 1130 uin = g_strdup_printf("%u", data->uin); … … 1132 1132 aim_ssi_auth_reply(od->sess, od->conn, uin, 1, ""); 1133 1133 // aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message); 1134 if(find_buddy(data-> gc, uin) == NULL)1135 show_got_added(data-> gc, uin, NULL);1134 if(find_buddy(data->ic, uin) == NULL) 1135 show_got_added(data->ic, uin, NULL); 1136 1136 1137 1137 g_free(uin); … … 1141 1141 static void gaim_icq_authdeny(gpointer w, struct icq_auth *data) { 1142 1142 char *uin, *message; 1143 struct oscar_data *od = (struct oscar_data *)data-> gc->proto_data;1143 struct oscar_data *od = (struct oscar_data *)data->ic->proto_data; 1144 1144 1145 1145 uin = g_strdup_printf("%u", data->uin); … … 1156 1156 * For when other people ask you for authorization 1157 1157 */ 1158 static void gaim_icq_authask(struct gaim_connection *gc, guint32 uin, char *msg) {1158 static void gaim_icq_authask(struct im_connection *ic, guint32 uin, char *msg) { 1159 1159 struct icq_auth *data = g_new(struct icq_auth, 1); 1160 1160 char *reason = NULL; … … 1165 1165 1166 1166 dialog_msg = g_strdup_printf("The user %u wants to add you to their buddy list for the following reason: %s", uin, reason ? reason : "No reason given."); 1167 data-> gc = gc;1167 data->ic = ic; 1168 1168 data->uin = uin; 1169 do_ask_dialog( gc, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny);1169 do_ask_dialog(ic, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny); 1170 1170 g_free(dialog_msg); 1171 1171 } 1172 1172 1173 1173 static int incomingim_chan4(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args) { 1174 struct gaim_connection *gc = sess->aux_data;1174 struct im_connection *ic = sess->aux_data; 1175 1175 1176 1176 switch (args->type) { … … 1180 1180 message = g_strdup(args->msg); 1181 1181 strip_linefeed(message); 1182 serv_got_im( gc, uin, message, 0, time(NULL), -1);1182 serv_got_im(ic, uin, message, 0, time(NULL), -1); 1183 1183 g_free(uin); 1184 1184 g_free(message); … … 1199 1199 1200 1200 strip_linefeed(message); 1201 serv_got_im( gc, uin, message, 0, time(NULL), -1);1201 serv_got_im(ic, uin, message, 0, time(NULL), -1); 1202 1202 g_free(uin); 1203 1203 g_free(m); … … 1206 1206 1207 1207 case 0x0006: { /* Someone requested authorization */ 1208 gaim_icq_authask( gc, args->uin, args->msg);1208 gaim_icq_authask(ic, args->uin, args->msg); 1209 1209 } break; 1210 1210 … … 1418 1418 va_list ap; 1419 1419 guint16 type; 1420 struct gaim_connection *gc = sess->aux_data;1421 struct oscar_data *odata = (struct oscar_data *) gc->proto_data;1420 struct im_connection *ic = sess->aux_data; 1421 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 1422 1422 1423 1423 va_start(ap, fr); … … 1477 1477 int count, i; 1478 1478 aim_userinfo_t *info; 1479 struct gaim_connection *g = sess->aux_data;1479 struct im_connection *g = sess->aux_data; 1480 1480 1481 1481 struct chat_connection *c = NULL; … … 1500 1500 int count, i; 1501 1501 aim_userinfo_t *info; 1502 struct gaim_connection *g = sess->aux_data;1502 struct im_connection *g = sess->aux_data; 1503 1503 1504 1504 struct chat_connection *c = NULL; … … 1528 1528 guint16 unknown_c9, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen; 1529 1529 guint32 creationtime; 1530 struct gaim_connection *gc = sess->aux_data;1531 struct chat_connection *ccon = find_oscar_chat_by_conn( gc, fr->conn);1530 struct im_connection *ic = sess->aux_data; 1531 struct chat_connection *ccon = find_oscar_chat_by_conn(ic, fr->conn); 1532 1532 1533 1533 va_start(ap, fr); … … 1555 1555 aim_userinfo_t *info; 1556 1556 char *msg; 1557 struct gaim_connection *gc = sess->aux_data;1558 struct chat_connection *ccon = find_oscar_chat_by_conn( gc, fr->conn);1557 struct im_connection *ic = sess->aux_data; 1558 struct chat_connection *ccon = find_oscar_chat_by_conn(ic, fr->conn); 1559 1559 char *tmp; 1560 1560 … … 1617 1617 va_list ap; 1618 1618 aim_userinfo_t *info; 1619 struct gaim_connection *gc = sess->aux_data;1619 struct im_connection *ic = sess->aux_data; 1620 1620 1621 1621 va_start(ap, fr); … … 1623 1623 va_end(ap); 1624 1624 1625 gc->evil = info->warnlevel/10;1626 /* gc->correction_time = (info->onlinesince - gc->login_time); */1625 ic->evil = info->warnlevel/10; 1626 /* ic->correction_time = (info->onlinesince - ic->login_time); */ 1627 1627 1628 1628 return 1; … … 1646 1646 1647 1647 static int conninitdone_admin(aim_session_t *sess, aim_frame_t *fr, ...) { 1648 struct gaim_connection *gc = sess->aux_data;1649 struct oscar_data *od = gc->proto_data;1648 struct im_connection *ic = sess->aux_data; 1649 struct oscar_data *od = ic->proto_data; 1650 1650 1651 1651 aim_clientready(sess, fr->conn); … … 1704 1704 va_list ap; 1705 1705 guint16 maxsiglen; 1706 struct gaim_connection *gc = sess->aux_data;1707 struct oscar_data *odata = (struct oscar_data *) gc->proto_data;1706 struct im_connection *ic = sess->aux_data; 1707 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 1708 1708 1709 1709 va_start(ap, fr); … … 1715 1715 /* FIXME: It seems we're not really using this, and it broke now that 1716 1716 struct aim_user is dead. 1717 aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps);1717 aim_bos_setprofile(sess, fr->conn, ic->user->user_info, NULL, gaim_caps); 1718 1718 */ 1719 1719 … … 1724 1724 va_list ap; 1725 1725 guint16 maxbuddies, maxwatchers; 1726 struct gaim_connection *gc = sess->aux_data;1727 struct oscar_data *odata = (struct oscar_data *) gc->proto_data;1726 struct im_connection *ic = sess->aux_data; 1727 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 1728 1728 1729 1729 va_start(ap, fr); … … 1741 1741 guint16 maxpermits, maxdenies; 1742 1742 va_list ap; 1743 struct gaim_connection *gc = sess->aux_data;1744 struct oscar_data *odata = (struct oscar_data *) gc->proto_data;1743 struct im_connection *ic = sess->aux_data; 1744 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 1745 1745 1746 1746 va_start(ap, fr); … … 1765 1765 va_list ap; 1766 1766 struct aim_icq_offlinemsg *msg; 1767 struct gaim_connection *gc = sess->aux_data;1767 struct im_connection *ic = sess->aux_data; 1768 1768 1769 1769 va_start(ap, fr); … … 1778 1778 g_snprintf(sender, sizeof(sender), "%u", msg->sender); 1779 1779 strip_linefeed(dialog_msg); 1780 serv_got_im( gc, sender, dialog_msg, 0, t, -1);1780 serv_got_im(ic, sender, dialog_msg, 0, t, -1); 1781 1781 g_free(dialog_msg); 1782 1782 } break; … … 1799 1799 1800 1800 strip_linefeed(dialog_msg); 1801 serv_got_im( gc, sender, dialog_msg, 0, t, -1);1801 serv_got_im(ic, sender, dialog_msg, 0, t, -1); 1802 1802 g_free(dialog_msg); 1803 1803 g_free(m); … … 1805 1805 1806 1806 case 0x0006: { /* Authorization request */ 1807 gaim_icq_authask( gc, msg->sender, msg->msg);1807 gaim_icq_authask(ic, msg->sender, msg->msg); 1808 1808 } break; 1809 1809 … … 1833 1833 } 1834 1834 1835 static void oscar_keepalive(struct gaim_connection *gc) {1836 struct oscar_data *odata = (struct oscar_data *) gc->proto_data;1835 static void oscar_keepalive(struct im_connection *ic) { 1836 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 1837 1837 aim_flap_nop(odata->sess, odata->conn); 1838 1838 } 1839 1839 1840 static int oscar_send_im(struct gaim_connection *gc, char *name, char *message, int len, int imflags) {1841 struct oscar_data *odata = (struct oscar_data *) gc->proto_data;1842 int ret = 0 ;1840 static int oscar_send_im(struct im_connection *ic, char *name, char *message, int imflags) { 1841 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 1842 int ret = 0, len = strlen(message); 1843 1843 if (imflags & IM_FLAG_AWAY) { 1844 1844 ret = aim_send_im(odata->sess, name, AIM_IMFLAGS_AWAY, message); … … 1892 1892 } 1893 1893 1894 static void oscar_get_info(struct gaim_connection *g, char *name) {1894 static void oscar_get_info(struct im_connection *g, char *name) { 1895 1895 struct oscar_data *odata = (struct oscar_data *)g->proto_data; 1896 1896 if (odata->icq) … … 1902 1902 } 1903 1903 1904 static void oscar_get_away(struct gaim_connection *g, char *who) {1904 static void oscar_get_away(struct im_connection *g, char *who) { 1905 1905 struct oscar_data *odata = (struct oscar_data *)g->proto_data; 1906 1906 if (odata->icq) { … … 1914 1914 } 1915 1915 1916 static void oscar_set_away_aim(struct gaim_connection *gc, struct oscar_data *od, const char *state, const char *message)1916 static void oscar_set_away_aim(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message) 1917 1917 { 1918 1918 … … 1926 1926 1927 1927 if (od->rights.maxawaymsglen == 0) 1928 do_error_dialog( gc, "oscar_set_away_aim called before locate rights received", "Protocol Error");1928 do_error_dialog(ic, "oscar_set_away_aim called before locate rights received", "Protocol Error"); 1929 1929 1930 1930 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); 1931 1931 1932 if ( gc->away)1933 g_free( gc->away);1934 gc->away = NULL;1932 if (ic->away) 1933 g_free(ic->away); 1934 ic->away = NULL; 1935 1935 1936 1936 if (!message) { … … 1944 1944 errstr = g_strdup_printf("Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen); 1945 1945 1946 do_error_dialog( gc, errstr, "Away Message Too Long");1946 do_error_dialog(ic, errstr, "Away Message Too Long"); 1947 1947 1948 1948 g_free(errstr); 1949 1949 } 1950 1950 1951 gc->away = g_strndup(message, od->rights.maxawaymsglen);1952 aim_bos_setprofile(od->sess, od->conn, NULL, gc->away, gaim_caps);1951 ic->away = g_strndup(message, od->rights.maxawaymsglen); 1952 aim_bos_setprofile(od->sess, od->conn, NULL, ic->away, gaim_caps); 1953 1953 1954 1954 return; 1955 1955 } 1956 1956 1957 static void oscar_set_away_icq(struct gaim_connection *gc, struct oscar_data *od, const char *state, const char *message)1957 static void oscar_set_away_icq(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message) 1958 1958 { 1959 1959 const char *msg = NULL; … … 1961 1961 1962 1962 /* clean old states */ 1963 if ( gc->away) {1964 g_free( gc->away);1965 gc->away = NULL;1963 if (ic->away) { 1964 g_free(ic->away); 1965 ic->away = NULL; 1966 1966 } 1967 1967 od->sess->aim_icq_state = 0; … … 1979 1979 } else if (!g_strcasecmp(state, "Away")) { 1980 1980 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); 1981 gc->away = g_strdup(msg);1981 ic->away = g_strdup(msg); 1982 1982 od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY; 1983 1983 } else if (!g_strcasecmp(state, "Do Not Disturb")) { 1984 1984 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY); 1985 gc->away = g_strdup(msg);1985 ic->away = g_strdup(msg); 1986 1986 od->sess->aim_icq_state = AIM_MTYPE_AUTODND; 1987 1987 } else if (!g_strcasecmp(state, "Not Available")) { 1988 1988 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY); 1989 gc->away = g_strdup(msg);1989 ic->away = g_strdup(msg); 1990 1990 od->sess->aim_icq_state = AIM_MTYPE_AUTONA; 1991 1991 } else if (!g_strcasecmp(state, "Occupied")) { 1992 1992 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY); 1993 gc->away = g_strdup(msg);1993 ic->away = g_strdup(msg); 1994 1994 od->sess->aim_icq_state = AIM_MTYPE_AUTOBUSY; 1995 1995 } else if (!g_strcasecmp(state, "Free For Chat")) { 1996 1996 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT); 1997 gc->away = g_strdup(msg);1997 ic->away = g_strdup(msg); 1998 1998 od->sess->aim_icq_state = AIM_MTYPE_AUTOFFC; 1999 1999 } else if (!g_strcasecmp(state, "Invisible")) { 2000 2000 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); 2001 gc->away = g_strdup(msg);2001 ic->away = g_strdup(msg); 2002 2002 } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) { 2003 2003 if (no_message) { … … 2005 2005 } else { 2006 2006 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); 2007 gc->away = g_strdup(msg);2007 ic->away = g_strdup(msg); 2008 2008 od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY; 2009 2009 } … … 2013 2013 } 2014 2014 2015 static void oscar_set_away(struct gaim_connection *gc, char *state, char *message)2016 { 2017 struct oscar_data *od = (struct oscar_data *) gc->proto_data;2018 2019 oscar_set_away_aim( gc, od, state, message);2015 static void oscar_set_away(struct im_connection *ic, char *state, char *message) 2016 { 2017 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2018 2019 oscar_set_away_aim(ic, od, state, message); 2020 2020 if (od->icq) 2021 oscar_set_away_icq( gc, od, state, message);2021 oscar_set_away_icq(ic, od, state, message); 2022 2022 2023 2023 return; 2024 2024 } 2025 2025 2026 static void oscar_add_buddy(struct gaim_connection *g, char *name) {2026 static void oscar_add_buddy(struct im_connection *g, char *name, char *group) { 2027 2027 struct oscar_data *odata = (struct oscar_data *)g->proto_data; 2028 2028 aim_ssi_addbuddies(odata->sess, odata->conn, OSCAR_GROUP, &name, 1, 0); 2029 2029 } 2030 2030 2031 static void oscar_remove_buddy(struct gaim_connection *g, char *name, char *group) {2031 static void oscar_remove_buddy(struct im_connection *g, char *name, char *group) { 2032 2032 struct oscar_data *odata = (struct oscar_data *)g->proto_data; 2033 2033 struct aim_ssi_item *ssigroup; … … 2040 2040 2041 2041 static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...) { 2042 struct gaim_connection *gc = sess->aux_data;2042 struct im_connection *ic = sess->aux_data; 2043 2043 struct aim_ssi_item *curitem; 2044 2044 int tmp; … … 2049 2049 switch (curitem->type) { 2050 2050 case 0x0000: /* Buddy */ 2051 if ((curitem->name) && (!find_buddy( gc, curitem->name))) {2051 if ((curitem->name) && (!find_buddy(ic, curitem->name))) { 2052 2052 char *realname = NULL; 2053 2053 … … 2055 2055 realname = aim_gettlv_str(curitem->data, 0x0131, 1); 2056 2056 2057 add_buddy( gc, NULL, curitem->name, realname);2057 add_buddy(ic, NULL, curitem->name, realname); 2058 2058 2059 2059 if (realname) … … 2065 2065 if (curitem->name) { 2066 2066 GSList *list; 2067 for (list= gc->permit; (list && aim_sncmp(curitem->name, list->data)); list=list->next);2067 for (list=ic->permit; (list && aim_sncmp(curitem->name, list->data)); list=list->next); 2068 2068 if (!list) { 2069 2069 char *name; 2070 2070 name = g_strdup(normalize(curitem->name)); 2071 gc->permit = g_slist_append(gc->permit, name);2071 ic->permit = g_slist_append(ic->permit, name); 2072 2072 tmp++; 2073 2073 } … … 2078 2078 if (curitem->name) { 2079 2079 GSList *list; 2080 for (list= gc->deny; (list && aim_sncmp(curitem->name, list->data)); list=list->next);2080 for (list=ic->deny; (list && aim_sncmp(curitem->name, list->data)); list=list->next); 2081 2081 if (!list) { 2082 2082 char *name; 2083 2083 name = g_strdup(normalize(curitem->name)); 2084 gc->deny = g_slist_append(gc->deny, name);2084 ic->deny = g_slist_append(ic->deny, name); 2085 2085 tmp++; 2086 2086 } … … 2091 2091 if (curitem->data) { 2092 2092 guint8 permdeny; 2093 if ((permdeny = aim_ssi_getpermdeny(sess->ssi.items)) && (permdeny != gc->permdeny)) {2094 gc->permdeny = permdeny;2093 if ((permdeny = aim_ssi_getpermdeny(sess->ssi.items)) && (permdeny != ic->permdeny)) { 2094 ic->permdeny = permdeny; 2095 2095 tmp++; 2096 2096 } … … 2110 2110 2111 2111 /* Now that we have a buddy list, we can tell BitlBee that we're online. */ 2112 account_online( gc);2112 account_online(ic); 2113 2113 2114 2114 return 1; … … 2155 2155 } 2156 2156 2157 static void oscar_set_permit_deny(struct gaim_connection *gc) {2158 struct oscar_data *od = (struct oscar_data *) gc->proto_data;2157 static void oscar_set_permit_deny(struct im_connection *ic) { 2158 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2159 2159 if (od->icq) { 2160 2160 GSList *list; … … 2162 2162 int at; 2163 2163 2164 switch( gc->permdeny) {2164 switch(ic->permdeny) { 2165 2165 case 1: 2166 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, gc->username);2166 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, ic->username); 2167 2167 break; 2168 2168 case 2: 2169 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, gc->username);2169 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, ic->username); 2170 2170 break; 2171 2171 case 3: 2172 list = gc->permit;2172 list = ic->permit; 2173 2173 at = 0; 2174 2174 while (list) { … … 2179 2179 break; 2180 2180 case 4: 2181 list = gc->deny;2181 list = ic->deny; 2182 2182 at = 0; 2183 2183 while (list) { … … 2190 2190 break; 2191 2191 } 2192 signoff_blocked( gc);2192 signoff_blocked(ic); 2193 2193 } else { 2194 2194 if (od->sess->ssi.received_data) 2195 aim_ssi_setpermdeny(od->sess, od->conn, gc->permdeny, 0xffffffff);2196 } 2197 } 2198 2199 static void oscar_add_permit(struct gaim_connection *gc, char *who) {2200 struct oscar_data *od = (struct oscar_data *) gc->proto_data;2195 aim_ssi_setpermdeny(od->sess, od->conn, ic->permdeny, 0xffffffff); 2196 } 2197 } 2198 2199 static void oscar_add_permit(struct im_connection *ic, char *who) { 2200 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2201 2201 if (od->icq) { 2202 2202 aim_ssi_auth_reply(od->sess, od->conn, who, 1, ""); … … 2207 2207 } 2208 2208 2209 static void oscar_add_deny(struct gaim_connection *gc, char *who) {2210 struct oscar_data *od = (struct oscar_data *) gc->proto_data;2209 static void oscar_add_deny(struct im_connection *ic, char *who) { 2210 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2211 2211 if (od->icq) { 2212 2212 aim_ssi_auth_reply(od->sess, od->conn, who, 0, ""); … … 2217 2217 } 2218 2218 2219 static void oscar_rem_permit(struct gaim_connection *gc, char *who) {2220 struct oscar_data *od = (struct oscar_data *) gc->proto_data;2219 static void oscar_rem_permit(struct im_connection *ic, char *who) { 2220 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2221 2221 if (!od->icq) { 2222 2222 if (od->sess->ssi.received_data) … … 2225 2225 } 2226 2226 2227 static void oscar_rem_deny(struct gaim_connection *gc, char *who) {2228 struct oscar_data *od = (struct oscar_data *) gc->proto_data;2227 static void oscar_rem_deny(struct im_connection *ic, char *who) { 2228 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2229 2229 if (!od->icq) { 2230 2230 if (od->sess->ssi.received_data) … … 2233 2233 } 2234 2234 2235 static GList *oscar_away_states(struct gaim_connection *gc)2236 { 2237 struct oscar_data *od = gc->proto_data;2235 static GList *oscar_away_states(struct im_connection *ic) 2236 { 2237 struct oscar_data *od = ic->proto_data; 2238 2238 GList *m = NULL; 2239 2239 … … 2254 2254 static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...) 2255 2255 { 2256 struct gaim_connection *gc = sess->aux_data;2256 struct im_connection *ic = sess->aux_data; 2257 2257 gchar who[16]; 2258 2258 GString *str; … … 2330 2330 } 2331 2331 2332 serv_got_crap( gc, "%s\n%s", _("User Info"), str->str);2332 serv_got_crap(ic, "%s\n%s", _("User Info"), str->str); 2333 2333 g_string_free(str, TRUE); 2334 2334 … … 2395 2395 static int gaim_parseaiminfo(aim_session_t *sess, aim_frame_t *fr, ...) 2396 2396 { 2397 struct gaim_connection *gc = sess->aux_data;2397 struct im_connection *ic = sess->aux_data; 2398 2398 va_list ap; 2399 2399 aim_userinfo_t *userinfo; … … 2424 2424 idletime.tm_sec = 0; 2425 2425 strftime(buff, 256, _("%d days %H hours %M minutes"), &idletime); 2426 serv_got_crap( gc, "%s: %s", _("Idle Time"), buff);2426 serv_got_crap(ic, "%s: %s", _("Idle Time"), buff); 2427 2427 } 2428 2428 2429 2429 if(text) { 2430 2430 utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length); 2431 serv_got_crap( gc, "%s\n%s", _("User Info"), utf8);2431 serv_got_crap(ic, "%s\n%s", _("User Info"), utf8); 2432 2432 } else { 2433 serv_got_crap( gc, _("No user info available."));2433 serv_got_crap(ic, _("No user info available.")); 2434 2434 } 2435 2435 } else if(infotype == AIM_GETINFO_AWAYMESSAGE && userinfo->flags & AIM_FLAG_AWAY) { 2436 2436 utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length); 2437 serv_got_crap( gc, "%s\n%s", _("Away Message"), utf8);2437 serv_got_crap(ic, "%s\n%s", _("Away Message"), utf8); 2438 2438 } 2439 2439 … … 2445 2445 int gaim_parsemtn(aim_session_t *sess, aim_frame_t *fr, ...) 2446 2446 { 2447 struct gaim_connection * gc = sess->aux_data;2447 struct im_connection * ic = sess->aux_data; 2448 2448 va_list ap; 2449 2449 guint16 type1, type2; … … 2458 2458 if(type2 == 0x0002) { 2459 2459 /* User is typing */ 2460 serv_got_typing( gc, sn, 0, 1);2460 serv_got_typing(ic, sn, 0, 1); 2461 2461 } 2462 2462 else if (type2 == 0x0001) { 2463 2463 /* User has typed something, but is not actively typing (stale) */ 2464 serv_got_typing( gc, sn, 0, 2);2464 serv_got_typing(ic, sn, 0, 2); 2465 2465 } 2466 2466 else { 2467 2467 /* User has stopped typing */ 2468 serv_got_typing( gc, sn, 0, 0);2468 serv_got_typing(ic, sn, 0, 0); 2469 2469 } 2470 2470 … … 2472 2472 } 2473 2473 2474 static char *oscar_get_status_string( struct gaim_connection *gc, int number )2475 { 2476 struct oscar_data *od = gc->proto_data;2474 static char *oscar_get_status_string( struct im_connection *ic, int number ) 2475 { 2476 struct oscar_data *od = ic->proto_data; 2477 2477 2478 2478 if( ! number & UC_UNAVAILABLE ) … … 2500 2500 } 2501 2501 2502 int oscar_send_typing(struct gaim_connection *gc, char * who, int typing)2503 { 2504 struct oscar_data *od = gc->proto_data;2502 int oscar_send_typing(struct im_connection *ic, char * who, int typing) 2503 { 2504 struct oscar_data *od = ic->proto_data; 2505 2505 return( aim_im_sendmtn(od->sess, 1, who, typing ? 0x0002 : 0x0000) ); 2506 2506 } 2507 2507 2508 int oscar_chat_send(struct conversation *c, char *message)2509 { 2510 struct gaim_connection *gc = c->gc;2511 struct oscar_data * od = (struct oscar_data*) gc->proto_data;2508 void oscar_chat_send(struct groupchat *c, char *message, int msgflags) 2509 { 2510 struct im_connection *ic = c->ic; 2511 struct oscar_data * od = (struct oscar_data*)ic->proto_data; 2512 2512 struct chat_connection * ccon; 2513 2513 int ret; … … 2550 2550 } 2551 2551 2552 return (ret >= 0); 2553 } 2554 2555 void oscar_chat_invite(struct conversation*c, char *message, char *who)2556 { 2557 struct gaim_connection *gc = c->gc;2558 struct oscar_data * od = (struct oscar_data *) gc->proto_data;2552 /* return (ret >= 0); */ 2553 } 2554 2555 void oscar_chat_invite(struct groupchat *c, char *message, char *who) 2556 { 2557 struct im_connection *ic = c->ic; 2558 struct oscar_data * od = (struct oscar_data *)ic->proto_data; 2559 2559 struct chat_connection *ccon = c->data; 2560 2560 … … 2563 2563 } 2564 2564 2565 void oscar_chat_kill(struct gaim_connection *gc, struct chat_connection *cc)2566 { 2567 struct oscar_data *od = (struct oscar_data *) gc->proto_data;2565 void oscar_chat_kill(struct im_connection *ic, struct chat_connection *cc) 2566 { 2567 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2568 2568 2569 2569 /* Notify the conversation window that we've left the chat */ … … 2580 2580 } 2581 2581 2582 void oscar_chat_leave(struct conversation*c)2583 { 2584 oscar_chat_kill(c-> gc, c->data);2585 } 2586 2587 int oscar_chat_join(struct gaim_connection * gc, char * name)2588 { 2589 struct oscar_data * od = (struct oscar_data *) gc->proto_data;2582 void oscar_chat_leave(struct groupchat *c) 2583 { 2584 oscar_chat_kill(c->ic, c->data); 2585 } 2586 2587 int oscar_chat_join(struct im_connection * ic, char * name) 2588 { 2589 struct oscar_data * od = (struct oscar_data *)ic->proto_data; 2590 2590 2591 2591 aim_conn_t * cur; … … 2605 2605 } 2606 2606 2607 struct conversation *oscar_chat_open(struct gaim_connection * gc, char *who)2608 { 2609 struct oscar_data * od = (struct oscar_data *) gc->proto_data;2607 struct groupchat *oscar_chat_with(struct im_connection * ic, char *who) 2608 { 2609 struct oscar_data * od = (struct oscar_data *)ic->proto_data; 2610 2610 int ret; 2611 2611 static int chat_id = 0; 2612 2612 char * chatname; 2613 2613 2614 chatname = g_strdup_printf("%s%d", gc->username, chat_id++);2614 chatname = g_strdup_printf("%s%d", ic->username, chat_id++); 2615 2615 2616 ret = oscar_chat_join( gc, chatname);2616 ret = oscar_chat_join(ic, chatname); 2617 2617 2618 2618 aim_chat_invite(od->sess, od->conn, who, "", 4, chatname, 0x0); … … 2625 2625 void oscar_accept_chat(gpointer w, struct aim_chat_invitation * inv) 2626 2626 { 2627 oscar_chat_join(inv-> gc, inv->name);2627 oscar_chat_join(inv->ic, inv->name); 2628 2628 g_free(inv->name); 2629 2629 g_free(inv); … … 2636 2636 } 2637 2637 2638 void oscar_init ()2638 void oscar_initmodule() 2639 2639 { 2640 2640 struct prpl *ret = g_new0(struct prpl, 1); 2641 2641 ret->name = "oscar"; 2642 2642 ret->away_states = oscar_away_states; 2643 ret->init = oscar_init; 2643 2644 ret->login = oscar_login; 2644 ret-> acc_init = oscar_acc_init;2645 ret-> close = oscar_close;2645 ret->keepalive = oscar_keepalive; 2646 ret->logout = oscar_logout; 2646 2647 ret->send_im = oscar_send_im; 2647 2648 ret->get_info = oscar_get_info; … … 2653 2654 ret->chat_invite = oscar_chat_invite; 2654 2655 ret->chat_leave = oscar_chat_leave; 2655 ret->chat_ open = oscar_chat_open;2656 ret->chat_with = oscar_chat_with; 2656 2657 ret->add_permit = oscar_add_permit; 2657 2658 ret->add_deny = oscar_add_deny; … … 2659 2660 ret->rem_deny = oscar_rem_deny; 2660 2661 ret->set_permit_deny = oscar_set_permit_deny; 2661 ret->keepalive = oscar_keepalive;2662 2662 ret->get_status_string = oscar_get_status_string; 2663 2663 ret->send_typing = oscar_send_typing; -
protocols/oscar/service.c
rfa29d093 r0da65d5 732 732 guint32 data; 733 733 int tlvlen; 734 struct gaim_connection *gc = sess ? sess->aux_data : NULL;734 struct im_connection *ic = sess ? sess->aux_data : NULL; 735 735 736 736 data = AIM_ICQ_STATE_HIDEIP | status; /* yay for error checking ;^) */ 737 737 738 if ( gc && set_getbool(&gc->acc->set, "web_aware"))738 if (ic && set_getbool(&ic->acc->set, "web_aware")) 739 739 data |= AIM_ICQ_STATE_WEBAWARE; 740 740
Note: See TracChangeset
for help on using the changeset viewer.