Commit 084e5dfe authored by Vysheng's avatar Vysheng

Fixes

parent 5c1da6c9
...@@ -140,6 +140,44 @@ int fetch_comb_binlog_dc_salt (void *extra) { ...@@ -140,6 +140,44 @@ int fetch_comb_binlog_dc_salt (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_dh_params (void *extra) {
if (encr_prime) { tfree (encr_prime, 256); }
encr_root = fetch_int ();
encr_prime = talloc (256);
fetch_ints (encr_prime, 64);
encr_param_version = fetch_int ();
return 0;
}
int fetch_comb_binlog_set_pts (void *extra) {
int new_pts = fetch_int ();
assert (new_pts >= pts);
pts = new_pts;
return 0;
}
int fetch_comb_binlog_set_qts (void *extra) {
int new_qts = fetch_int ();
assert (new_qts >= qts);
qts = new_qts;
return 0;
}
int fetch_comb_binlog_set_date (void *extra) {
int new_date = fetch_int ();
assert (new_date >= last_date);
last_date = new_date;
return 0;
}
int fetch_comb_binlog_set_seq (void *extra) {
int new_seq = fetch_int ();
assert (new_seq >= seq);
seq = new_seq;
return 0;
}
int fetch_comb_binlog_new_user (void *extra) { int fetch_comb_binlog_new_user (void *extra) {
peer_id_t id = MK_USER (fetch_int ()); peer_id_t id = MK_USER (fetch_int ());
peer_t *_U = user_chat_get (id); peer_t *_U = user_chat_get (id);
...@@ -413,16 +451,6 @@ int fetch_comb_binlog_set_encr_chat_key (void *extra) { ...@@ -413,16 +451,6 @@ int fetch_comb_binlog_set_encr_chat_key (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_dh_params (void *extra) {
if (encr_prime) { tfree (encr_prime, 256); }
encr_root = fetch_int ();
encr_prime = talloc (256);
fetch_ints (encr_prime, 64);
encr_param_version = fetch_int ();
return 0;
}
int fetch_comb_binlog_encr_chat_init (void *extra) { int fetch_comb_binlog_encr_chat_init (void *extra) {
peer_t *P = talloc0 (sizeof (*P)); peer_t *P = talloc0 (sizeof (*P));
P->id = MK_ENCR_CHAT (fetch_int ()); P->id = MK_ENCR_CHAT (fetch_int ());
...@@ -445,84 +473,7 @@ int fetch_comb_binlog_encr_chat_init (void *extra) { ...@@ -445,84 +473,7 @@ int fetch_comb_binlog_encr_chat_init (void *extra) {
return 0; return 0;
} }
FETCH_COMBINATOR_FUNCTION (binlog_start) int fetch_comb_binlog_chat_create (void *extra) {
FETCH_COMBINATOR_FUNCTION (binlog_dc_option)
FETCH_COMBINATOR_FUNCTION (binlog_auth_key)
FETCH_COMBINATOR_FUNCTION (binlog_default_dc)
FETCH_COMBINATOR_FUNCTION (binlog_our_id)
FETCH_COMBINATOR_FUNCTION (binlog_dc_signed)
FETCH_COMBINATOR_FUNCTION (binlog_dc_salt)
FETCH_COMBINATOR_FUNCTION (binlog_new_user)
FETCH_COMBINATOR_FUNCTION (binlog_user_delete)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_access_token)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_phone)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_friend)
FETCH_COMBINATOR_FUNCTION (binlog_user_full_photo)
FETCH_COMBINATOR_FUNCTION (binlog_user_blocked)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_full_name)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_delete)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_requested)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_access_hash)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_date)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_state)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_accepted)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_key)
FETCH_COMBINATOR_FUNCTION (binlog_set_dh_params)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_init)
void replay_log_event (void) {
int *start = rptr;
in_replay_log = 1;
assert (rptr < wptr);
int op = *rptr;
if (verbosity >= 2) {
logprintf ("log_pos %lld, op 0x%08x\n", binlog_pos, op);
}
in_ptr = rptr;
in_end = wptr;
switch (op) {
case CODE_binlog_encr_chat_init:
rptr ++;
{
peer_t *P = talloc0 (sizeof (*P));
P->id = MK_ENCR_CHAT (*(rptr ++));
assert (!user_chat_get (P->id));
P->encr_chat.user_id = *(rptr ++);
P->encr_chat.admin_id = our_id;
insert_encrypted_chat (P);
peer_t *Us = user_chat_get (MK_USER (P->encr_chat.user_id));
assert (Us);
P->print_name = create_print_name (P->id, "!", Us->user.first_name, Us->user.last_name, 0);
peer_insert_name (P);
memcpy (P->encr_chat.key, rptr, 256);
rptr += 64;
P->encr_chat.g_key = talloc (256);
memcpy (P->encr_chat.g_key, rptr, 256);
rptr += 64;
P->flags |= FLAG_CREATED;
}
break;
case CODE_binlog_set_pts:
rptr ++;
pts = *(rptr ++);
break;
case CODE_binlog_set_qts:
rptr ++;
qts = *(rptr ++);
break;
case CODE_binlog_set_date:
rptr ++;
last_date = *(rptr ++);
break;
case CODE_binlog_set_seq:
rptr ++;
seq = *(rptr ++);
break;
case CODE_binlog_chat_create:
in_ptr ++;
{
peer_id_t id = MK_CHAT (fetch_int ()); peer_id_t id = MK_CHAT (fetch_int ());
peer_t *_C = user_chat_get (id); peer_t *_C = user_chat_get (id);
if (!_C) { if (!_C) {
...@@ -541,156 +492,162 @@ void replay_log_event (void) { ...@@ -541,156 +492,162 @@ void replay_log_event (void) {
C->users_num = fetch_int (); C->users_num = fetch_int ();
C->date = fetch_int (); C->date = fetch_int ();
C->version = fetch_int (); C->version = fetch_int ();
fetch_data (&C->photo_big, sizeof (struct file_location)); fetch_data (&C->photo_big, sizeof (struct file_location));
fetch_data (&C->photo_small, sizeof (struct file_location)); fetch_data (&C->photo_small, sizeof (struct file_location));
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (C); lua_chat_update (C);
#endif #endif
}; return 0;
rptr = in_ptr; }
break;
case CODE_binlog_chat_change_flags: int fetch_comb_binlog_chat_change_flags (void *extra) {
rptr ++; peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
{
peer_t *C = user_chat_get (MK_CHAT (*(rptr ++)));
assert (C && (C->flags & FLAG_CREATED)); assert (C && (C->flags & FLAG_CREATED));
C->flags |= *(rptr ++); C->chat.flags |= fetch_int ();
C->flags &= ~*(rptr ++); C->chat.flags &= ~fetch_int ();
};
break; #ifdef USE_LUA
case CODE_binlog_set_chat_title: lua_chat_update (&C->chat);
in_ptr ++; #endif
{ return 0;
peer_t *_C = user_chat_get (MK_CHAT (fetch_int ())); }
assert (_C && (_C->flags & FLAG_CREATED));
struct chat *C = &_C->chat; int fetch_comb_binlog_set_chat_title (void *extra) {
if (C->title) { tfree_str (C->title); } peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
C->title = fetch_str_dup (); assert (C && (C->flags & FLAG_CREATED));
if (C->print_title) {
if (C->chat.title) { tfree_str (C->chat.title); }
C->chat.title = fetch_str_dup ();
if (C->print_name) {
peer_delete_name ((void *)C); peer_delete_name ((void *)C);
tfree_str (C->print_title); tfree_str (C->print_name);
} }
C->print_title = create_print_name (C->id, C->title, 0, 0, 0); C->print_name = create_print_name (C->id, C->chat.title, 0, 0, 0);
peer_insert_name ((void *)C); peer_insert_name ((void *)C);
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (C); lua_chat_update (&C->chat);
#endif #endif
}; return 0;
rptr = in_ptr; }
break;
case CODE_binlog_set_chat_photo: int fetch_comb_binlog_set_chat_photo (void *extra) {
in_ptr ++;
{
peer_t *C = user_chat_get (MK_CHAT (fetch_int ())); peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
assert (C && (C->flags & FLAG_CREATED)); assert (C && (C->flags & FLAG_CREATED));
fetch_data (&C->photo_big, sizeof (struct file_location)); fetch_data (&C->photo_big, sizeof (struct file_location));
fetch_data (&C->photo_small, sizeof (struct file_location)); fetch_data (&C->photo_small, sizeof (struct file_location));
};
rptr = in_ptr; #ifdef USE_LUA
break; lua_chat_update (&C->chat);
case CODE_binlog_set_chat_date: #endif
rptr ++; return 0;
{ }
peer_t *C = user_chat_get (MK_CHAT (*(rptr ++)));
int fetch_comb_binlog_set_chat_date (void *extra) {
peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
assert (C && (C->flags & FLAG_CREATED)); assert (C && (C->flags & FLAG_CREATED));
C->chat.date = *(rptr ++); C->chat.date = fetch_int ();
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (&C->chat); lua_chat_update (&C->chat);
#endif #endif
}; return 0;
break; }
case CODE_binlog_set_chat_version:
rptr ++; int fetch_comb_binlog_set_chat_version (void *extra) {
{ peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
peer_t *C = user_chat_get (MK_CHAT (*(rptr ++)));
assert (C && (C->flags & FLAG_CREATED)); assert (C && (C->flags & FLAG_CREATED));
C->chat.version = *(rptr ++); C->chat.version = fetch_int ();
C->chat.users_num = *(rptr ++); C->chat.users_num = fetch_int ();
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (&C->chat); lua_chat_update (&C->chat);
#endif #endif
}; return 0;
break; }
case CODE_binlog_set_chat_admin:
rptr ++; int fetch_comb_binlog_set_chat_admin (void *extra) {
{ peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
peer_t *C = user_chat_get (MK_CHAT (*(rptr ++)));
assert (C && (C->flags & FLAG_CREATED)); assert (C && (C->flags & FLAG_CREATED));
C->chat.admin_id = *(rptr ++); C->chat.admin_id = fetch_int ();
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (&C->chat); lua_chat_update (&C->chat);
#endif #endif
}; return 0;
break; }
case CODE_binlog_set_chat_participants:
rptr ++; int fetch_comb_binlog_set_chat_participants (void *extra) {
{ peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
peer_t *C = user_chat_get (MK_CHAT (*(rptr ++)));
assert (C && (C->flags & FLAG_CREATED)); assert (C && (C->flags & FLAG_CREATED));
C->chat.user_list_version = *(rptr ++); C->chat.user_list_version = fetch_int ();
if (C->chat.user_list) { tfree (C->chat.user_list, 12 * C->chat.user_list_size); } if (C->chat.user_list) { tfree (C->chat.user_list, 12 * C->chat.user_list_size); }
C->chat.user_list_size = *(rptr ++); C->chat.user_list_size = fetch_int ();
C->chat.user_list = talloc (12 * C->chat.user_list_size); C->chat.user_list = talloc (12 * C->chat.user_list_size);
memcpy (C->chat.user_list, rptr, 12 * C->chat.user_list_size); fetch_ints (C->chat.user_list, 3 * C->chat.user_list_size);
rptr += 3 * C->chat.user_list_size;
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (&C->chat); lua_chat_update (&C->chat);
#endif #endif
}; return 0;
break; }
case CODE_binlog_chat_full_photo:
in_ptr ++; int fetch_comb_binlog_chat_full_photo (void *extra) {
{ peer_t *C = user_chat_get (MK_CHAT (fetch_int ()));
peer_id_t id = MK_CHAT (fetch_int ()); assert (C && (C->flags & FLAG_CREATED));
peer_t *U = user_chat_get (id);
assert (U && (U->flags & FLAG_CREATED)); assert (C && (C->flags & FLAG_CREATED));
if (U->flags & FLAG_HAS_PHOTO) { if (C->flags & FLAG_HAS_PHOTO) {
free_photo (&U->chat.photo); free_photo (&C->chat.photo);
}
fetch_photo (&U->chat.photo);
} }
rptr = in_ptr; fetch_photo (&C->chat.photo);
break;
case CODE_binlog_add_chat_participant: #ifdef USE_LUA
rptr ++; lua_chat_update (&C->chat);
{ #endif
peer_id_t id = MK_CHAT (*(rptr ++)); return 0;
}
int fetch_comb_binlog_add_chat_participant (void *extra) {
peer_id_t id = MK_CHAT (fetch_int ());
peer_t *_C = user_chat_get (id); peer_t *_C = user_chat_get (id);
assert (_C && (_C->flags & FLAG_CREATED)); assert (_C && (_C->flags & FLAG_CREATED));
struct chat *C = &_C->chat; struct chat *C = &_C->chat;
int version = *(rptr ++); int version = fetch_int ();
int user = *(rptr ++); int user = fetch_int ();
int inviter = *(rptr ++); int inviter = fetch_int ();
int date = *(rptr ++); int date = fetch_int ();
assert (C->user_list_version < version); assert (C->user_list_version < version);
int i; int i;
for (i = 0; i < C->user_list_size; i++) { for (i = 0; i < C->user_list_size; i++) {
assert (C->user_list[i].user_id != user); assert (C->user_list[i].user_id != user);
} }
C->user_list_size ++; C->user_list_size ++;
C->user_list = trealloc (C->user_list, 12 * C->user_list_size - 12, 12 * C->user_list_size); C->user_list = trealloc (C->user_list, 12 * C->user_list_size - 12, 12 * C->user_list_size);
C->user_list[C->user_list_size - 1].user_id = user; C->user_list[C->user_list_size - 1].user_id = user;
C->user_list[C->user_list_size - 1].inviter_id = inviter; C->user_list[C->user_list_size - 1].inviter_id = inviter;
C->user_list[C->user_list_size - 1].date = date; C->user_list[C->user_list_size - 1].date = date;
C->user_list_version = version; C->user_list_version = version;
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (C); lua_chat_update (C);
#endif #endif
} return 0;
break; }
case CODE_binlog_del_chat_participant:
rptr ++; int fetch_comb_binlog_del_chat_participant (void *extra) {
{ peer_id_t id = MK_CHAT (fetch_int ());
peer_id_t id = MK_CHAT (*(rptr ++));
peer_t *_C = user_chat_get (id); peer_t *_C = user_chat_get (id);
assert (_C && (_C->flags & FLAG_CREATED)); assert (_C && (_C->flags & FLAG_CREATED));
struct chat *C = &_C->chat; struct chat *C = &_C->chat;
int version = *(rptr ++); int version = fetch_int ();
int user = *(rptr ++); int user = fetch_int ();
assert (C->user_list_version < version); assert (C->user_list_version < version);
int i; int i;
...@@ -706,21 +663,62 @@ void replay_log_event (void) { ...@@ -706,21 +663,62 @@ void replay_log_event (void) {
C->user_list_size --; C->user_list_size --;
C->user_list = trealloc (C->user_list, 12 * C->user_list_size + 12, 12 * C->user_list_size); C->user_list = trealloc (C->user_list, 12 * C->user_list_size + 12, 12 * C->user_list_size);
C->user_list_version = version; C->user_list_version = version;
#ifdef USE_LUA #ifdef USE_LUA
lua_chat_update (C); lua_chat_update (C);
#endif #endif
return 0;
}
int fetch_comb_binlog_create_message_text (void *extra) {
long long id = fetch_int ();
struct message *M = message_get (id);
if (!M) {
M = talloc0 (sizeof (*M));
M->id = id;
message_insert_tree (M);
messages_allocated ++;
} else {
assert (!(M->flags & FLAG_CREATED));
} }
break;
case CODE_binlog_create_message_text: M->flags |= FLAG_CREATED;
case CODE_binlog_send_message_text: M->from_id = MK_USER (fetch_int ());
in_ptr ++; int t = fetch_int ();
{ if (t == PEER_ENCR_CHAT) {
long long id; M->flags |= FLAG_ENCRYPTED;
if (op == CODE_binlog_create_message_text) { }
id = fetch_int ();
M->to_id = set_peer_id (t, fetch_int ());
M->date = fetch_int ();
int l = prefetch_strlen ();
M->message = talloc (l + 1);
memcpy (M->message, fetch_str (l), l);
M->message[l] = 0;
M->message_len = l;
if (t == PEER_ENCR_CHAT) {
M->media.type = CODE_decrypted_message_media_empty;
} else { } else {
id = fetch_long (); M->media.type = CODE_message_media_empty;
} }
M->unread = 1;
M->out = get_peer_id (M->from_id) == our_id;
message_insert (M);
#ifdef USE_LUA
lua_new_msg (M);
#endif
return 0;
}
int fetch_comb_binlog_send_message_text (void *extra) {
long long id = fetch_long ();
struct message *M = message_get (id); struct message *M = message_get (id);
if (!M) { if (!M) {
M = talloc0 (sizeof (*M)); M = talloc0 (sizeof (*M));
...@@ -730,12 +728,14 @@ void replay_log_event (void) { ...@@ -730,12 +728,14 @@ void replay_log_event (void) {
} else { } else {
assert (!(M->flags & FLAG_CREATED)); assert (!(M->flags & FLAG_CREATED));
} }
M->flags |= FLAG_CREATED; M->flags |= FLAG_CREATED;
M->from_id = MK_USER (fetch_int ()); M->from_id = MK_USER (fetch_int ());
int t = fetch_int (); int t = fetch_int ();
if (t == PEER_ENCR_CHAT) { if (t == PEER_ENCR_CHAT) {
M->flags |= FLAG_ENCRYPTED; M->flags |= FLAG_ENCRYPTED;
} }
M->to_id = set_peer_id (t, fetch_int ()); M->to_id = set_peer_id (t, fetch_int ());
M->date = fetch_int (); M->date = fetch_int ();
...@@ -750,25 +750,23 @@ void replay_log_event (void) { ...@@ -750,25 +750,23 @@ void replay_log_event (void) {
} else { } else {
M->media.type = CODE_message_media_empty; M->media.type = CODE_message_media_empty;
} }
M->unread = 1; M->unread = 1;
M->out = get_peer_id (M->from_id) == our_id; M->out = get_peer_id (M->from_id) == our_id;
message_insert (M); message_insert (M);
if (op == CODE_binlog_send_message_text) {
message_insert_unsent (M); message_insert_unsent (M);
M->flags |= FLAG_PENDING; M->flags |= FLAG_PENDING;
}
#ifdef USE_LUA #ifdef USE_LUA
lua_new_msg (M); lua_new_msg (M);
#endif #endif
} return 0;
rptr = in_ptr; }
break;
case CODE_binlog_create_message_text_fwd: int fetch_comb_binlog_create_message_text_fwd (void *extra) {
in_ptr ++; long long id = fetch_int ();
{
int id = fetch_int ();
struct message *M = message_get (id); struct message *M = message_get (id);
if (!M) { if (!M) {
M = talloc0 (sizeof (*M)); M = talloc0 (sizeof (*M));
...@@ -778,11 +776,17 @@ void replay_log_event (void) { ...@@ -778,11 +776,17 @@ void replay_log_event (void) {
} else { } else {
assert (!(M->flags & FLAG_CREATED)); assert (!(M->flags & FLAG_CREATED));
} }
M->flags |= FLAG_CREATED; M->flags |= FLAG_CREATED;
M->from_id = MK_USER (fetch_int ()); M->from_id = MK_USER (fetch_int ());
int t = fetch_int (); int t = fetch_int ();
if (t == PEER_ENCR_CHAT) {
M->flags |= FLAG_ENCRYPTED;
}
M->to_id = set_peer_id (t, fetch_int ()); M->to_id = set_peer_id (t, fetch_int ());
M->date = fetch_int (); M->date = fetch_int ();
M->fwd_from_id = MK_USER (fetch_int ()); M->fwd_from_id = MK_USER (fetch_int ());
M->fwd_date = fetch_int (); M->fwd_date = fetch_int ();
...@@ -792,20 +796,24 @@ void replay_log_event (void) { ...@@ -792,20 +796,24 @@ void replay_log_event (void) {
M->message[l] = 0; M->message[l] = 0;
M->message_len = l; M->message_len = l;
if (t == PEER_ENCR_CHAT) {
M->media.type = CODE_decrypted_message_media_empty;
} else {
M->media.type = CODE_message_media_empty; M->media.type = CODE_message_media_empty;
}
M->unread = 1; M->unread = 1;
M->out = get_peer_id (M->from_id) == our_id; M->out = get_peer_id (M->from_id) == our_id;
message_insert (M); message_insert (M);
#ifdef USE_LUA #ifdef USE_LUA
lua_new_msg (M); lua_new_msg (M);
#endif #endif
} return 0;
rptr = in_ptr; }
break;
case CODE_binlog_create_message_media: int fetch_comb_binlog_create_message_media (void *extra) {
in_ptr ++;
{
int id = fetch_int (); int id = fetch_int ();
struct message *M = message_get (id); struct message *M = message_get (id);
if (!M) { if (!M) {
...@@ -836,13 +844,11 @@ void replay_log_event (void) { ...@@ -836,13 +844,11 @@ void replay_log_event (void) {
#ifdef USE_LUA #ifdef USE_LUA
lua_new_msg (M); lua_new_msg (M);
#endif #endif
} return 0;
rptr = in_ptr; }
break;
case CODE_binlog_create_message_media_encr: int fetch_comb_binlog_create_message_media_encr (void *extra) {
in_ptr ++; int id = fetch_int ();
{
long long id = fetch_long ();
struct message *M = message_get (id); struct message *M = message_get (id);
if (!M) { if (!M) {
M = talloc0 (sizeof (*M)); M = talloc0 (sizeof (*M));
...@@ -866,7 +872,6 @@ void replay_log_event (void) { ...@@ -866,7 +872,6 @@ void replay_log_event (void) {
fetch_message_media_encrypted (&M->media); fetch_message_media_encrypted (&M->media);
fetch_encrypted_message_file (&M->media); fetch_encrypted_message_file (&M->media);
M->unread = 1; M->unread = 1;
M->out = get_peer_id (M->from_id) == our_id; M->out = get_peer_id (M->from_id) == our_id;
...@@ -874,9 +879,71 @@ void replay_log_event (void) { ...@@ -874,9 +879,71 @@ void replay_log_event (void) {
#ifdef USE_LUA #ifdef USE_LUA
lua_new_msg (M); lua_new_msg (M);
#endif #endif
return 0;
}
FETCH_COMBINATOR_FUNCTION (binlog_start)
FETCH_COMBINATOR_FUNCTION (binlog_dc_option)
FETCH_COMBINATOR_FUNCTION (binlog_auth_key)
FETCH_COMBINATOR_FUNCTION (binlog_default_dc)
FETCH_COMBINATOR_FUNCTION (binlog_our_id)
FETCH_COMBINATOR_FUNCTION (binlog_dc_signed)
FETCH_COMBINATOR_FUNCTION (binlog_dc_salt)
FETCH_COMBINATOR_FUNCTION (binlog_set_dh_params)
FETCH_COMBINATOR_FUNCTION (binlog_set_pts)
FETCH_COMBINATOR_FUNCTION (binlog_set_qts)
FETCH_COMBINATOR_FUNCTION (binlog_set_date)
FETCH_COMBINATOR_FUNCTION (binlog_set_seq)
FETCH_COMBINATOR_FUNCTION (binlog_new_user)
FETCH_COMBINATOR_FUNCTION (binlog_user_delete)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_access_token)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_phone)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_friend)
FETCH_COMBINATOR_FUNCTION (binlog_user_full_photo)
FETCH_COMBINATOR_FUNCTION (binlog_user_blocked)
FETCH_COMBINATOR_FUNCTION (binlog_set_user_full_name)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_delete)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_requested)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_access_hash)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_date)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_state)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_accepted)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_key)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_init)
FETCH_COMBINATOR_FUNCTION (binlog_chat_create)
FETCH_COMBINATOR_FUNCTION (binlog_chat_change_flags)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_title)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_photo)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_date)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_version)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_admin)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_participants)
FETCH_COMBINATOR_FUNCTION (binlog_chat_full_photo)
FETCH_COMBINATOR_FUNCTION (binlog_add_chat_participant)
FETCH_COMBINATOR_FUNCTION (binlog_del_chat_participant)
FETCH_COMBINATOR_FUNCTION (binlog_create_message_text)
FETCH_COMBINATOR_FUNCTION (binlog_send_message_text)
FETCH_COMBINATOR_FUNCTION (binlog_create_message_text_fwd)
FETCH_COMBINATOR_FUNCTION (binlog_create_message_media)
void replay_log_event (void) {
int *start = rptr;
in_replay_log = 1;
assert (rptr < wptr);
int op = *rptr;
if (verbosity >= 2) {
logprintf ("log_pos %lld, op 0x%08x\n", binlog_pos, op);
} }
rptr = in_ptr;
break; in_ptr = rptr;
in_end = wptr;
switch (op) {
case CODE_binlog_create_message_media_fwd: case CODE_binlog_create_message_media_fwd:
in_ptr ++; in_ptr ++;
{ {
......
...@@ -36,34 +36,12 @@ ...@@ -36,34 +36,12 @@
#define LOG_ENCR_CHAT_REQUESTED 0x9011011a #define LOG_ENCR_CHAT_REQUESTED 0x9011011a
#define LOG_ENCR_CHAT_OK 0x7612ce13 #define LOG_ENCR_CHAT_OK 0x7612ce13
#define CODE_binlog_dc_option 0x08c0ef19
#define CODE_binlog_encr_chat_init 0x939cd1c7
#define CODE_binlog_set_pts 0x844e4c1c
#define CODE_binlog_set_qts 0x3cf22b79
#define CODE_binlog_set_date 0x33dfe392
#define CODE_binlog_set_seq 0xb9294837
#define CODE_binlog_chat_create 0xbaa75791
#define CODE_binlog_chat_change_flags 0x1e494031
#define CODE_binlog_set_chat_title 0x7dd9bea8
#define CODE_binlog_set_chat_photo 0xb4ea1fd2
#define CODE_binlog_set_chat_date 0x78d1114e
#define CODE_binlog_set_chat_version 0xa5d3504f
#define CODE_binlog_set_chat_admin 0x1e7cea04
#define CODE_binlog_set_chat_participants 0x3a29d335
#define CODE_binlog_chat_full_photo 0x6cca6629
#define CODE_binlog_add_chat_participant 0x63345108
#define CODE_binlog_del_chat_participant 0x82d1f0ee
#define CODE_binlog_create_message_text 0x269acd5b
#define CODE_binlog_create_message_text_fwd 0xa3d864cd
#define CODE_binlog_create_message_service 0xbbe5e94b #define CODE_binlog_create_message_service 0xbbe5e94b
#define CODE_binlog_create_message_service_fwd 0xea9c57ae #define CODE_binlog_create_message_service_fwd 0xea9c57ae
#define CODE_binlog_create_message_media 0x62a92d19
#define CODE_binlog_create_message_media_fwd 0xbefdc462 #define CODE_binlog_create_message_media_fwd 0xbefdc462
#define CODE_binlog_send_message_text 0x31cfd652
#define CODE_binlog_set_unread 0x21d4c909 #define CODE_binlog_set_unread 0x21d4c909
#define CODE_binlog_set_message_sent 0xc335282b #define CODE_binlog_set_message_sent 0xc335282b
#define CODE_binlog_set_msg_id 0xf3285b6a #define CODE_binlog_set_msg_id 0xf3285b6a
#define CODE_binlog_create_message_media_encr 0x19cd7c9d
#define CODE_binlog_create_message_service_encr 0x8b4b9395 #define CODE_binlog_create_message_service_encr 0x8b4b9395
#define CODE_binlog_delete_msg 0xa1d6ab6d #define CODE_binlog_delete_msg 0xa1d6ab6d
......
---types--- ---types---
binlog.fileLocation dc:int volume:long local_id:int secret:long = binlog.FileLocation;
binlog.chatParticipant user:int inviter:int date:int = binlog.ChatParticipant;
binlog.start = binlog.Update; binlog.start = binlog.Update;
binlog.dcUpdate id:int name:string ip:string port:int = binlog.Update; binlog.dcOption id:int name:string ip:string port:int = binlog.Update;
binlog.authKey dc:int key_id:long key:64*[int] = binlog.Update; binlog.authKey dc:int key_id:long key:64*[int] = binlog.Update;
binlog.defaultDc dc:int = binlog.Update; binlog.defaultDc dc:int = binlog.Update;
binlog.ourId id:int = binlog.Update; binlog.ourId id:int = binlog.Update;
...@@ -8,6 +11,10 @@ binlog.dcSigned id:int = binlog.Update; ...@@ -8,6 +11,10 @@ binlog.dcSigned id:int = binlog.Update;
binlog.dcSalt id:int salt:long = binlog.Update; binlog.dcSalt id:int salt:long = binlog.Update;
binlog.setDhParams root:int prime:64*[int] version:int = binlog.Update; binlog.setDhParams root:int prime:64*[int] version:int = binlog.Update;
binlog.setPts pts:int = binlog.Update;
binlog.setQts qts:int = binlog.Update;
binlog.setDate date:int = binlog.Update;
binlog.setSeq seq:int = binlog.Update;
binlog.newUser id:int first_name:string last_name:string hash:long phone:string is_contact:int = binlog.Update; binlog.newUser id:int first_name:string last_name:string hash:long phone:string is_contact:int = binlog.Update;
binlog.userDelete id:int = binlog.Update; binlog.userDelete id:int = binlog.Update;
...@@ -25,5 +32,23 @@ binlog.setEncrChatDate id:int date:int = binlog.Update; ...@@ -25,5 +32,23 @@ binlog.setEncrChatDate id:int date:int = binlog.Update;
binlog.setEncrChatState id:int state:int = binlog.Update; binlog.setEncrChatState id:int state:int = binlog.Update;
binlog.encrChatAccepted id:int key:64*[int] nonce:64*[int] fingerprint:long = binlog.Update; binlog.encrChatAccepted id:int key:64*[int] nonce:64*[int] fingerprint:long = binlog.Update;
binlog.setEncrChatKey id:int key:64*[int] fingerprint:long = binlog.Update; binlog.setEncrChatKey id:int key:64*[int] fingerprint:long = binlog.Update;
binlog.encrChatInit id:int user:int key:64*[int] g_key:64*[int] = binlog.Update;
binlog.chatCreate id:int flags:int title:string user_num:int date:int version:int photo_big:%binlog.FileLocation photo_small:%binlog.FileLocation = binlog.Update;
binlog.chatChangeFlags id:int set_flags:int clear_flags:int = binlog.Update;
binlog.setChatTitle id:int title:string = binlog.Update;
binlog.setChatPhoto id:int photo_big:%binlog.FileLocation photo_small:%binlog.FileLocation = binlog.Update;
binlog.setChatDate id:int date:int = binlog.Update;
binlog.setChatVersion id:int version:int users_num:int = binlog.Update;
binlog.setChatAdmin id:int admin:int = binlog.Update;
binlog.setChatParticipants id:int version:int participants:%(Vector %binlog.ChatParticipant) = binlog.Update;
binlog.chatFullPhoto id:int photo:Photo = binlog.Update;
binlog.addChatParticipant id:int version:int user:%binlog.ChatParticipant = binlog.Update;
binlog.delChatParticipant id:int version:int user:int = binlog.Update;
binlog.createMessageText id:int from_id:int to_type:int to_id:int date:int text:string = binlog.Update;
binlog.sendMessageText id:long from_id:int to_type:int to_id:int date:int text:string = binlog.Update;
binlog.createMessageTextFwd id:int from_id:int to_type:int to_id:int date:int fwd_from_id:int fwd_date:int text:string = binlog.Update;
binlog.createMessageMedia id:int from_id:int to_type:int to_id:int date:int text:string media:MessageMedia = binlog.Update;
binlog.createMessageMediaEncr id:int from_id:int to_type:int to_id:int date:int text:string media:DecryptedMessageMedia file:EncryptedFile = binlog.Update;
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