Remove "_network" from telegram connect function
This commit is contained in:
parent
fa457a6900
commit
0aa8a9de15
3 changed files with 14 additions and 8 deletions
|
@ -371,7 +371,8 @@ static void tgprpl_login(PurpleAccount * acct)
|
|||
tg->extra = conn;
|
||||
|
||||
purple_connection_set_state (conn->gc, PURPLE_CONNECTING);
|
||||
telegram_network_connect (tg);
|
||||
telegram_connect (tg);
|
||||
}
|
||||
|
||||
/**
|
||||
* This must be implemented.
|
||||
|
|
12
telegram.c
12
telegram.c
|
@ -161,9 +161,8 @@ void telegram_change_state (struct telegram *instance, int state, void *data)
|
|||
instance->config->proxy_close_cb (instance, instance->connection->connection->fd);
|
||||
|
||||
// start a new connection to the demanded data center. The pointer to the
|
||||
// currently working dc should have already been updated by the
|
||||
// on_error function of the query
|
||||
telegram_network_connect (instance);
|
||||
// new dc should was already updated by the on_error function of the query
|
||||
telegram_connect (instance);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -308,7 +307,7 @@ void on_authorized(struct mtproto_connection *c, void* data);
|
|||
/**
|
||||
* Connect to the currently active data center
|
||||
*/
|
||||
void telegram_network_connect(struct telegram *instance)
|
||||
void telegram_connect (struct telegram *instance)
|
||||
{
|
||||
logprintf ("telegram_network_connect()\n");
|
||||
if (! instance->auth.DC_list) {
|
||||
|
@ -364,8 +363,9 @@ int telegram_write_output (struct telegram *instance)
|
|||
return try_write(instance->connection->connection);
|
||||
}
|
||||
|
||||
int telegram_has_output (struct telegram *instance)
|
||||
int telegram_authenticated (struct telegram *instance)
|
||||
{
|
||||
return instance->connection->queries_num > 0;
|
||||
return telegram_get_working_dc (instance)->auth_key_id > 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ void telegram_change_state(struct telegram *instance, int state, void *data);
|
|||
/**
|
||||
* Connect to the telegram network with the given configuration
|
||||
*/
|
||||
void telegram_network_connect(struct telegram *instance);
|
||||
void telegram_connect(struct telegram *instance);
|
||||
|
||||
int telegram_login (struct telegram *instance);
|
||||
|
||||
|
@ -397,4 +397,9 @@ void set_net_write_cb(ssize_t (*cb)(int fd, const void *buff, size_t size));
|
|||
*/
|
||||
void telegram_set_proxy(struct telegram *instance, int fd);
|
||||
|
||||
/**
|
||||
* Return wether telegram is authenticated with the currently active data center
|
||||
*/
|
||||
int telegram_authenticated (struct telegram *instance);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue