Run get_differece on new_session_created
This commit is contained in:
parent
8bdaf6e55b
commit
c9a0346971
3 changed files with 6 additions and 1 deletions
2
loop.c
2
loop.c
|
@ -586,6 +586,7 @@ void dlist_cb (void *callback_extra, int success, int size, tgl_peer_id_t peers[
|
|||
int loop (void) {
|
||||
//on_start ();
|
||||
tgl_set_callback (&upd_cb);
|
||||
//tgl_state.temp_key_expire_time = 60;
|
||||
tgl_init ();
|
||||
|
||||
if (binlog_enabled) {
|
||||
|
@ -731,6 +732,7 @@ int loop (void) {
|
|||
tgl_do_get_difference (sync_from_start, get_difference_callback, 0);
|
||||
net_loop (0, dgot);
|
||||
assert (!(tgl_state.locks & TGL_LOCK_DIFF));
|
||||
tgl_state.started = 1;
|
||||
if (wait_dialog_list) {
|
||||
d_got_ok = 0;
|
||||
tgl_do_get_dialog_list (dlist_cb, 0);
|
||||
|
|
|
@ -906,7 +906,9 @@ static void work_new_session_created (struct connection *c, long long msg_id UU)
|
|||
//DC->session_id = fetch_long ();
|
||||
fetch_long (); // unique_id
|
||||
tgl_state.net_methods->get_dc (c)->server_salt = fetch_long ();
|
||||
|
||||
if (tgl_state.started && !(tgl_state.locks & TGL_LOCK_DIFF)) {
|
||||
tgl_do_get_difference (0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void work_msgs_ack (struct connection *c UU, long long msg_id UU) {
|
||||
|
|
1
tgl.h
1
tgl.h
|
@ -135,6 +135,7 @@ struct tgl_state {
|
|||
int unread_messages;
|
||||
int active_queries;
|
||||
int max_msg_id;
|
||||
int started;
|
||||
|
||||
long long locks;
|
||||
struct tgl_dc *DC_list[TGL_MAX_DC_NUM];
|
||||
|
|
Loading…
Add table
Reference in a new issue