comparison src/protocols/gg/gg.c @ 4634:d19872836812

[gaim-migrate @ 4941] This will let you set up different proxy settings for different accounts. Mainly useful to the corporate users that need to connect to an internal jabber server, and still want to connect to "external" stuff through a proxy, or something along those lines. I'm sure someone will come up with another use for it. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 02 Mar 2003 18:48:02 +0000
parents 5fcb44d771d2
children 283fb289c510
comparison
equal deleted inserted replaced
4633:812148fb2e2f 4634:d19872836812
1 /* 1 /*
2 * gaim - Gadu-Gadu Protocol Plugin 2 * gaim - Gadu-Gadu Protocol Plugin
3 * $Id: gg.c 4896 2003-02-24 00:29:54Z faceprint $ 3 * $Id: gg.c 4941 2003-03-02 18:48:02Z faceprint $
4 * 4 *
5 * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> 5 * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
468 switch( gd->sess->state ) { 468 switch( gd->sess->state ) {
469 case GG_STATE_CONNECTING_GG: 469 case GG_STATE_CONNECTING_GG:
470 { 470 {
471 struct in_addr ip; 471 struct in_addr ip;
472 char buf[256]; 472 char buf[256];
473 473
474 /* Remove watch on initial socket - now that we have ip and port of login server */ 474 /* Remove watch on initial socket - now that we have ip and port of login server */
475 gaim_input_remove(gc->inpa); 475 gaim_input_remove(gc->inpa);
476 476
477 ip.s_addr = gd->sess->server_ip; 477 ip.s_addr = gd->sess->server_ip;
478 478
479 if (proxy_connect(inet_ntoa(ip), gd->sess->port, login_callback, gc) < 0) { 479 if (proxy_connect(gc->account, inet_ntoa(ip), gd->sess->port, login_callback, gc) < 0) {
480 g_snprintf(buf, sizeof(buf), _("Connect to %s failed"), inet_ntoa(ip)); 480 g_snprintf(buf, sizeof(buf), _("Connect to %s failed"), inet_ntoa(ip));
481 hide_login_progress(gc, buf); 481 hide_login_progress(gc, buf);
482 signoff(gc); 482 signoff(gc);
483 return; 483 return;
484 } 484 }
570 gd->sess->uin = (uin_t) strtol(account->username, (char **)NULL, 10); 570 gd->sess->uin = (uin_t) strtol(account->username, (char **)NULL, 10);
571 gd->sess->password = g_strdup(account->password); 571 gd->sess->password = g_strdup(account->password);
572 gd->sess->state = GG_STATE_CONNECTING; 572 gd->sess->state = GG_STATE_CONNECTING;
573 gd->sess->check = GG_CHECK_WRITE; 573 gd->sess->check = GG_CHECK_WRITE;
574 gd->sess->async = 1; 574 gd->sess->async = 1;
575 if (proxy_connect(GG_APPMSG_HOST, GG_APPMSG_PORT, login_callback, gc) < 0) { 575 if (proxy_connect(account, GG_APPMSG_HOST, GG_APPMSG_PORT, login_callback, gc) < 0) {
576 g_snprintf(buf, sizeof(buf), _("Connect to %s failed"), GG_APPMSG_HOST); 576 g_snprintf(buf, sizeof(buf), _("Connect to %s failed"), GG_APPMSG_HOST);
577 hide_login_progress(gc, buf); 577 hide_login_progress(gc, buf);
578 signoff(gc); 578 signoff(gc);
579 return; 579 return;
580 } 580 }
986 hi->request = g_strdup_printf("FmNum=%s&Pass=%s", u, p); 986 hi->request = g_strdup_printf("FmNum=%s&Pass=%s", u, p);
987 987
988 g_free(u); 988 g_free(u);
989 g_free(p); 989 g_free(p);
990 990
991 if (proxy_connect(GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, hi) < 0) { 991 if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, hi) < 0) {
992 do_error_dialog(_("Unable to import Gadu-Gadu buddy list"), 992 do_error_dialog(_("Unable to import Gadu-Gadu buddy list"),
993 _("Gaim was unable to connect to the Gadu-Gadu buddy list " 993 _("Gaim was unable to connect to the Gadu-Gadu buddy list "
994 "server. Please try again later."), GAIM_ERROR); 994 "server. Please try again later."), GAIM_ERROR);
995 g_free(hi->request); 995 g_free(hi->request);
996 g_free(hi); 996 g_free(hi);
1053 m = g_slist_next(m); 1053 m = g_slist_next(m);
1054 } 1054 }
1055 gr = g_slist_next(gr); 1055 gr = g_slist_next(gr);
1056 } 1056 }
1057 1057
1058 if (proxy_connect(GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) { 1058 if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) {
1059 do_error_dialog(_("Couldn't export buddy list"), 1059 do_error_dialog(_("Couldn't export buddy list"),
1060 _("Gaim was unable to connect to the buddy list server. " 1060 _("Gaim was unable to connect to the buddy list server. "
1061 "Please try again later."), GAIM_ERROR); 1061 "Please try again later."), GAIM_ERROR);
1062 g_free(he->request); 1062 g_free(he->request);
1063 g_free(he); 1063 g_free(he);
1075 he->type = AGG_HTTP_USERLIST_DELETE; 1075 he->type = AGG_HTTP_USERLIST_DELETE;
1076 he->form = AGG_PUBDIR_USERLIST_EXPORT_FORM; 1076 he->form = AGG_PUBDIR_USERLIST_EXPORT_FORM;
1077 he->host = GG_PUBDIR_HOST; 1077 he->host = GG_PUBDIR_HOST;
1078 he->request = g_strdup_printf("FmNum=%s&Pass=%s&Delete=1", u, p); 1078 he->request = g_strdup_printf("FmNum=%s&Pass=%s&Delete=1", u, p);
1079 1079
1080 if (proxy_connect(GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) { 1080 if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) {
1081 do_error_dialog(_("Unable to delete Gadu-Gadu buddy list"), 1081 do_error_dialog(_("Unable to delete Gadu-Gadu buddy list"),
1082 _("Gaim was unable to connect to the buddy list server. " 1082 _("Gaim was unable to connect to the buddy list server. "
1083 "Please try again later."), GAIM_ERROR); 1083 "Please try again later."), GAIM_ERROR);
1084 g_free(he->request); 1084 g_free(he->request);
1085 g_free(he); 1085 g_free(he);
1123 g_free(enew_first); 1123 g_free(enew_first);
1124 g_free(enew_last); 1124 g_free(enew_last);
1125 g_free(enew_city); 1125 g_free(enew_city);
1126 } 1126 }
1127 1127
1128 if (proxy_connect(GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, srch) < 0) { 1128 if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, srch) < 0) {
1129 do_error_dialog(_("Unable to access directory"), 1129 do_error_dialog(_("Unable to access directory"),
1130 _("Gaim was unable to search the Directory because it " 1130 _("Gaim was unable to search the Directory because it "
1131 "was unable to connect to the directory server. Please try " 1131 "was unable to connect to the directory server. Please try "
1132 "again later."), GAIM_ERROR); 1132 "again later."), GAIM_ERROR);
1133 g_free(srch->request); 1133 g_free(srch->request);
1156 g_free(u); 1156 g_free(u);
1157 g_free(p); 1157 g_free(p);
1158 g_free(enew); 1158 g_free(enew);
1159 g_free(eold); 1159 g_free(eold);
1160 1160
1161 if (proxy_connect(GG_REGISTER_HOST, GG_REGISTER_PORT, http_req_callback, hpass) < 0) { 1161 if (proxy_connect(gc->account, GG_REGISTER_HOST, GG_REGISTER_PORT, http_req_callback, hpass) < 0) {
1162 do_error_dialog(_("Unable to change Gadu-Gadu password"), 1162 do_error_dialog(_("Unable to change Gadu-Gadu password"),
1163 _("Gaim was unable to change your password due to an error connecting " 1163 _("Gaim was unable to change your password due to an error connecting "
1164 "to the Gadu-Gadu server. Please try again later."), GAIM_ERROR); 1164 "to the Gadu-Gadu server. Please try again later."), GAIM_ERROR);
1165 g_free(hpass->request); 1165 g_free(hpass->request);
1166 g_free(hpass); 1166 g_free(hpass);
1231 1231
1232 g_free(enew_who); 1232 g_free(enew_who);
1233 } else 1233 } else
1234 srch->request = g_strdup_printf("Mode=3&UserId=%s", who); 1234 srch->request = g_strdup_printf("Mode=3&UserId=%s", who);
1235 1235
1236 if (proxy_connect(GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, srch) < 0) { 1236 if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, srch) < 0) {
1237 do_error_dialog(_("Unable to access user profile."), 1237 do_error_dialog(_("Unable to access user profile."),
1238 _("Gaim was unable to access this user's profile due to an error " 1238 _("Gaim was unable to access this user's profile due to an error "
1239 "connecting to the directory server. Please try again later."), GAIM_ERROR); 1239 "connecting to the directory server. Please try again later."), GAIM_ERROR);
1240 g_free(srch->request); 1240 g_free(srch->request);
1241 g_free(srch); 1241 g_free(srch);