Commit 43397269 authored by vvaltman's avatar vvaltman

Fixed bug with short updates

parent c721eca5
...@@ -647,11 +647,13 @@ void tglf_fetch_message_short (struct tgl_message *M) { ...@@ -647,11 +647,13 @@ void tglf_fetch_message_short (struct tgl_message *M) {
int date = fetch_int (); int date = fetch_int ();
//tglu_fetch_seq (); //tglu_fetch_seq ();
fetch_int (); int seq = fetch_int ();
assert (seq == tgl_state.seq + 1);
bl_do_create_message_text (id, from_id, TGL_PEER_USER, to_id, date, 1, l, s); bl_do_create_message_text (id, from_id, TGL_PEER_USER, to_id, date, 1, l, s);
bl_do_msg_seq_update (id);
} else { } else {
fetch_int (); // id int id = fetch_int (); // id
fetch_int (); // from_id fetch_int (); // from_id
int l = prefetch_strlen (); int l = prefetch_strlen ();
fetch_str (l); // text fetch_str (l); // text
...@@ -659,7 +661,9 @@ void tglf_fetch_message_short (struct tgl_message *M) { ...@@ -659,7 +661,9 @@ void tglf_fetch_message_short (struct tgl_message *M) {
tglu_fetch_pts (); tglu_fetch_pts ();
fetch_int (); fetch_int ();
//tglu_fetch_seq (); //tglu_fetch_seq ();
fetch_int (); int seq = fetch_int ();
assert (seq == tgl_state.seq + 1);
bl_do_msg_seq_update (id);
} }
} }
...@@ -678,10 +682,12 @@ void tglf_fetch_message_short_chat (struct tgl_message *M) { ...@@ -678,10 +682,12 @@ void tglf_fetch_message_short_chat (struct tgl_message *M) {
int date = fetch_int (); int date = fetch_int ();
//tglu_fetch_seq (); //tglu_fetch_seq ();
fetch_int (); int seq = fetch_int ();
assert (seq == tgl_state.seq + 1);
bl_do_create_message_text (id, from_id, TGL_PEER_CHAT, to_id, date, 1, l, s); bl_do_create_message_text (id, from_id, TGL_PEER_CHAT, to_id, date, 1, l, s);
bl_do_msg_seq_update (id);
} else { } else {
fetch_int (); // id int id = fetch_int (); // id
fetch_int (); // from_id fetch_int (); // from_id
fetch_int (); // to_id fetch_int (); // to_id
int l = prefetch_strlen (); int l = prefetch_strlen ();
...@@ -690,7 +696,9 @@ void tglf_fetch_message_short_chat (struct tgl_message *M) { ...@@ -690,7 +696,9 @@ void tglf_fetch_message_short_chat (struct tgl_message *M) {
tglu_fetch_pts (); tglu_fetch_pts ();
fetch_int (); fetch_int ();
//tglu_fetch_seq (); //tglu_fetch_seq ();
fetch_int (); int seq = fetch_int ();
assert (seq == tgl_state.seq + 1);
bl_do_msg_seq_update (id);
} }
} }
......
...@@ -428,8 +428,10 @@ static int do_skip_seq (int seq) { ...@@ -428,8 +428,10 @@ static int do_skip_seq (int seq) {
return -1; return -1;
} }
if (tgl_state.locks & TGL_LOCK_DIFF) { if (tgl_state.locks & TGL_LOCK_DIFF) {
vlogprintf (E_DEBUG, "Update during get_difference. seq = %d\n", seq);
return -1; return -1;
} }
vlogprintf (E_DEBUG, "Ok update. seq = %d\n", seq);
return 0; return 0;
} else { } else {
return -1; return -1;
......
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