Commit 5cb5b1cf authored by vvaltman's avatar vvaltman

Run get_differece on new_session_created

parent ce61adac
...@@ -586,6 +586,7 @@ void dlist_cb (void *callback_extra, int success, int size, tgl_peer_id_t peers[ ...@@ -586,6 +586,7 @@ void dlist_cb (void *callback_extra, int success, int size, tgl_peer_id_t peers[
int loop (void) { int loop (void) {
//on_start (); //on_start ();
tgl_set_callback (&upd_cb); tgl_set_callback (&upd_cb);
//tgl_state.temp_key_expire_time = 60;
tgl_init (); tgl_init ();
if (binlog_enabled) { if (binlog_enabled) {
...@@ -731,6 +732,7 @@ int loop (void) { ...@@ -731,6 +732,7 @@ int loop (void) {
tgl_do_get_difference (sync_from_start, get_difference_callback, 0); tgl_do_get_difference (sync_from_start, get_difference_callback, 0);
net_loop (0, dgot); net_loop (0, dgot);
assert (!(tgl_state.locks & TGL_LOCK_DIFF)); assert (!(tgl_state.locks & TGL_LOCK_DIFF));
tgl_state.started = 1;
if (wait_dialog_list) { if (wait_dialog_list) {
d_got_ok = 0; d_got_ok = 0;
tgl_do_get_dialog_list (dlist_cb, 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) ...@@ -906,7 +906,9 @@ static void work_new_session_created (struct connection *c, long long msg_id UU)
//DC->session_id = fetch_long (); //DC->session_id = fetch_long ();
fetch_long (); // unique_id fetch_long (); // unique_id
tgl_state.net_methods->get_dc (c)->server_salt = fetch_long (); 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) { static void work_msgs_ack (struct connection *c UU, long long msg_id UU) {
......
...@@ -135,6 +135,7 @@ struct tgl_state { ...@@ -135,6 +135,7 @@ struct tgl_state {
int unread_messages; int unread_messages;
int active_queries; int active_queries;
int max_msg_id; int max_msg_id;
int started;
long long locks; long long locks;
struct tgl_dc *DC_list[TGL_MAX_DC_NUM]; struct tgl_dc *DC_list[TGL_MAX_DC_NUM];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment