| 95 gaim_account_set_password(account, (*entry != '\0') ? entry : NULL); |
95 gaim_account_set_password(account, (*entry != '\0') ? entry : NULL); |
| 96 |
96 |
| 97 gaim_account_connect(account); |
97 gaim_account_connect(account); |
| 98 } |
98 } |
| 99 |
99 |
| |
100 void |
| |
101 gaim_connection_register(GaimConnection *gc) |
| |
102 { |
| |
103 GaimAccount *account; |
| |
104 GaimConnectionUiOps *ops; |
| |
105 GaimPluginProtocolInfo *prpl_info = NULL; |
| |
106 |
| |
107 g_return_if_fail(gc != NULL); |
| |
108 |
| |
109 gaim_debug(GAIM_DEBUG_INFO, "connection", |
| |
110 "Registering. gc = %p\n", gc); |
| |
111 |
| |
112 ops = gaim_get_connection_ui_ops(); |
| |
113 |
| |
114 if (gc->prpl != NULL) |
| |
115 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); |
| |
116 else { |
| |
117 gchar *message = g_strdup_printf(_("Missing protocol plugin for %s"), |
| |
118 gaim_account_get_username(gaim_connection_get_account(gc))); |
| |
119 |
| |
120 gaim_debug(GAIM_DEBUG_ERROR, "connection", |
| |
121 "Could not get prpl info for %p\n", gc); |
| |
122 gaim_notify_error(NULL, _("Registration Error"), |
| |
123 message, NULL); |
| |
124 g_free(message); |
| |
125 return; |
| |
126 } |
| |
127 |
| |
128 account = gaim_connection_get_account(gc); |
| |
129 |
| |
130 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) |
| |
131 return; |
| |
132 |
| |
133 gaim_connection_set_state(gc, GAIM_CONNECTING); |
| |
134 |
| |
135 connections = g_list_append(connections, gc); |
| |
136 |
| |
137 gaim_signal_emit(gaim_connections_get_handle(), "signing-on", gc); |
| |
138 |
| |
139 /* set this so we don't auto-reconnect after registering */ |
| |
140 gc->wants_to_die = TRUE; |
| |
141 |
| |
142 gaim_debug(GAIM_DEBUG_INFO, "connection", "Calling register_user\n"); |
| |
143 |
| |
144 prpl_info->register_user(account); |
| |
145 } |
| |
146 |
| 100 |
147 |
| 101 void |
148 void |
| 102 gaim_connection_connect(GaimConnection *gc) |
149 gaim_connection_connect(GaimConnection *gc) |
| 103 { |
150 { |
| 104 GaimAccount *account; |
151 GaimAccount *account; |