Commit 4aeb0ebb authored by vvaltman's avatar vvaltman

Fixed updates

parent d7f9fcc6
......@@ -21,7 +21,8 @@ These functions may return false immidiately if something is bad with args, or r
cb_function would have two or three arguments: first cb_extra, second success (1 or 0), third result (if applicable).
If you want to pass msg to function, you should pass it's id.
If you want to pass peer to function, you should pass it's print_name
If you want to pass peer to function, you should pass it's print_name.
Or, you can pass string user#id<id> chat#id<id> and secret_chat#id<id> as peer. It is in some cases better. For example if you want to postpone and you are afraid, that print_name would be changed in the meantime.
Function_list (arguments are listed aside from cb_function and cb_extra, :
get_contact_list ()
......
......@@ -646,7 +646,7 @@ void tglf_fetch_message_short (struct tgl_message *M) {
int l = prefetch_strlen ();
char *s = fetch_str (l);
tglu_fetch_pts ();
int pts = fetch_int ();
int date = fetch_int ();
//tglu_fetch_seq ();
......@@ -654,6 +654,14 @@ void tglf_fetch_message_short (struct tgl_message *M) {
assert (seq == tgl_state.seq + 1);
bl_do_create_message_text (id, from_id, TGL_PEER_USER, to_id, date, 1, l, s);
tgl_peer_t *P = tgl_peer_get (TGL_MK_USER (from_id));
if (!P || !(P->flags & FLAG_CREATED)) {
tgl_do_get_difference (0, 0, 0);
} else {
bl_do_set_pts (pts);
bl_do_set_date (date);
}
//bl_do_msg_seq_update (id);
} else {
fetch_int (); // id
......@@ -680,14 +688,26 @@ void tglf_fetch_message_short_chat (struct tgl_message *M) {
int l = prefetch_strlen ();
char *s = fetch_str (l);
tglu_fetch_pts ();
int pts = fetch_int ();
int date = fetch_int ();
//tglu_fetch_seq ();
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);
tgl_peer_t *P = tgl_peer_get (TGL_MK_CHAT (to_id));
if (!P || !(P->flags & FLAG_CREATED)) {
tgl_do_get_difference (0, 0, 0);
} else {
P = tgl_peer_get (TGL_MK_USER (from_id));
if (!P || !(P->flags & FLAG_CREATED)) {
tgl_do_get_difference (0, 0, 0);
} else {
bl_do_set_pts (pts);
bl_do_set_date (date);
}
}
//bl_do_msg_seq_update (id);
} else {
fetch_int (); // id
......
......@@ -489,7 +489,9 @@ void tglu_work_update_short_message (struct connection *c, long long msg_id) {
assert (M);
assert (save_end == in_ptr);
bl_do_msg_seq_update (M->id);
if (!(tgl_state.locks & TGL_LOCK_DIFF)) {
bl_do_msg_seq_update (M->id);
}
}
void tglu_work_update_short_chat_message (struct connection *c, long long msg_id) {
......@@ -506,7 +508,9 @@ void tglu_work_update_short_chat_message (struct connection *c, long long msg_id
assert (M);
assert (save_end == in_ptr);
bl_do_msg_seq_update (M->id);
if (!(tgl_state.locks & TGL_LOCK_DIFF)) {
bl_do_msg_seq_update (M->id);
}
}
void tglu_work_updates_to_long (struct connection *c, long long msg_id) {
......
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