Mercurial > pidgin
comparison src/protocols/toc/toc.c @ 9140:8b1af7cadeb8
[gaim-migrate @ 9924]
Make the connect steps in toc the same as most other prpl's
(start at 0)
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Sun, 30 May 2004 21:55:21 +0000 |
| parents | 6d7bb1274755 |
| children | 7a8aa87164ae |
comparison
equal
deleted
inserted
replaced
| 9139:89a1cfea74e5 | 9140:8b1af7cadeb8 |
|---|---|
| 113 | 113 |
| 114 /* constants to identify proto_opts */ | 114 /* constants to identify proto_opts */ |
| 115 #define USEROPT_AUTH 0 | 115 #define USEROPT_AUTH 0 |
| 116 #define USEROPT_AUTHPORT 1 | 116 #define USEROPT_AUTHPORT 1 |
| 117 | 117 |
| 118 #define TOC_CONNECT_STEPS 4 | 118 #define TOC_CONNECT_STEPS 3 |
| 119 | 119 |
| 120 static void toc_login_callback(gpointer, gint, GaimInputCondition); | 120 static void toc_login_callback(gpointer, gint, GaimInputCondition); |
| 121 static void toc_callback(gpointer, gint, GaimInputCondition); | 121 static void toc_callback(gpointer, gint, GaimInputCondition); |
| 122 | 122 |
| 123 /* ok. this function used to take username/password, and return 0 on success. | 123 /* ok. this function used to take username/password, and return 0 on success. |
| 134 gc->flags |= GAIM_CONNECTION_HTML; | 134 gc->flags |= GAIM_CONNECTION_HTML; |
| 135 gc->flags |= GAIM_CONNECTION_AUTO_RESP; | 135 gc->flags |= GAIM_CONNECTION_AUTO_RESP; |
| 136 | 136 |
| 137 g_snprintf(buf, sizeof buf, _("Looking up %s"), | 137 g_snprintf(buf, sizeof buf, _("Looking up %s"), |
| 138 gaim_account_get_string(account, "server", TOC_HOST)); | 138 gaim_account_get_string(account, "server", TOC_HOST)); |
| 139 gaim_connection_update_progress(gc, buf, 1, TOC_CONNECT_STEPS); | 139 gaim_connection_update_progress(gc, buf, 0, TOC_CONNECT_STEPS); |
| 140 | 140 |
| 141 gaim_debug(GAIM_DEBUG_INFO, "toc", "Client connects to TOC\n"); | 141 gaim_debug(GAIM_DEBUG_INFO, "toc", "Client connects to TOC\n"); |
| 142 if (gaim_proxy_connect(account, | 142 if (gaim_proxy_connect(account, |
| 143 gaim_account_get_string(account, "server", TOC_HOST), | 143 gaim_account_get_string(account, "server", TOC_HOST), |
| 144 gaim_account_get_int(account, "port", TOC_PORT), | 144 gaim_account_get_int(account, "port", TOC_PORT), |
| 194 * on what this does. it's really simple. when there's data ready to be read from the | 194 * on what this does. it's really simple. when there's data ready to be read from the |
| 195 * toc_fd file descriptor, toc_callback is called, with gc passed as its data arg. */ | 195 * toc_fd file descriptor, toc_callback is called, with gc passed as its data arg. */ |
| 196 gc->inpa = gaim_input_add(tdt->toc_fd, GAIM_INPUT_READ, toc_callback, gc); | 196 gc->inpa = gaim_input_add(tdt->toc_fd, GAIM_INPUT_READ, toc_callback, gc); |
| 197 | 197 |
| 198 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gaim_account_get_username(gc->account)); | 198 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gaim_account_get_username(gc->account)); |
| 199 gaim_connection_update_progress(gc, buf, 2, TOC_CONNECT_STEPS); | 199 gaim_connection_update_progress(gc, buf, 1, TOC_CONNECT_STEPS); |
| 200 } | 200 } |
| 201 | 201 |
| 202 static void toc_close(GaimConnection *gc) | 202 static void toc_close(GaimConnection *gc) |
| 203 { | 203 { |
| 204 if (gc->inpa > 0) | 204 if (gc->inpa > 0) |
| 611 if (sflap_send(gc, snd, -1, TYPE_DATA) < 0) { | 611 if (sflap_send(gc, snd, -1, TYPE_DATA) < 0) { |
| 612 gaim_connection_error(gc, _("Disconnected.")); | 612 gaim_connection_error(gc, _("Disconnected.")); |
| 613 return; | 613 return; |
| 614 } | 614 } |
| 615 | 615 |
| 616 gaim_connection_update_progress(gc, _("Waiting for reply..."), 3, TOC_CONNECT_STEPS); | 616 gaim_connection_update_progress(gc, _("Waiting for reply..."), 2, TOC_CONNECT_STEPS); |
| 617 return; | 617 return; |
| 618 } | 618 } |
| 619 | 619 |
| 620 if (tdt->state == STATE_SIGNON_REQUEST) { | 620 if (tdt->state == STATE_SIGNON_REQUEST) { |
| 621 gaim_debug(GAIM_DEBUG_INFO, "toc", "TOC sends client SIGN_ON reply\n"); | 621 gaim_debug(GAIM_DEBUG_INFO, "toc", "TOC sends client SIGN_ON reply\n"); |
