Commit 8dd17ec6 authored by vysheng's avatar vysheng

Some renaming

parent a37e5f43
...@@ -420,7 +420,7 @@ int fetch_comb_binlog_encr_chat_requested (void *extra) { ...@@ -420,7 +420,7 @@ int fetch_comb_binlog_encr_chat_requested (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_encr_chat_access_hash (void *extra) { int fetch_comb_binlog_encr_chat_set_access_hash (void *extra) {
peer_id_t id = MK_ENCR_CHAT (fetch_int ()); peer_id_t id = MK_ENCR_CHAT (fetch_int ());
peer_t *U = user_chat_get (id); peer_t *U = user_chat_get (id);
assert (U); assert (U);
...@@ -432,7 +432,7 @@ int fetch_comb_binlog_set_encr_chat_access_hash (void *extra) { ...@@ -432,7 +432,7 @@ int fetch_comb_binlog_set_encr_chat_access_hash (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_encr_chat_date (void *extra) { int fetch_comb_binlog_encr_chat_set_date (void *extra) {
peer_id_t id = MK_ENCR_CHAT (fetch_int ()); peer_id_t id = MK_ENCR_CHAT (fetch_int ());
peer_t *U = user_chat_get (id); peer_t *U = user_chat_get (id);
assert (U); assert (U);
...@@ -444,7 +444,7 @@ int fetch_comb_binlog_set_encr_chat_date (void *extra) { ...@@ -444,7 +444,7 @@ int fetch_comb_binlog_set_encr_chat_date (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_encr_chat_state (void *extra) { int fetch_comb_binlog_encr_chat_set_state (void *extra) {
peer_id_t id = MK_ENCR_CHAT (fetch_int ()); peer_id_t id = MK_ENCR_CHAT (fetch_int ());
peer_t *U = user_chat_get (id); peer_t *U = user_chat_get (id);
assert (U); assert (U);
...@@ -483,7 +483,7 @@ int fetch_comb_binlog_encr_chat_accepted (void *extra) { ...@@ -483,7 +483,7 @@ int fetch_comb_binlog_encr_chat_accepted (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_encr_chat_key (void *extra) { int fetch_comb_binlog_encr_chat_set_key (void *extra) {
peer_id_t id = MK_ENCR_CHAT (fetch_int ()); peer_id_t id = MK_ENCR_CHAT (fetch_int ());
peer_t *_U = user_chat_get (id); peer_t *_U = user_chat_get (id);
assert (_U); assert (_U);
...@@ -560,7 +560,7 @@ int fetch_comb_binlog_chat_change_flags (void *extra) { ...@@ -560,7 +560,7 @@ int fetch_comb_binlog_chat_change_flags (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_chat_title (void *extra) { int fetch_comb_binlog_chat_set_title (void *extra) {
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));
...@@ -579,7 +579,7 @@ int fetch_comb_binlog_set_chat_title (void *extra) { ...@@ -579,7 +579,7 @@ int fetch_comb_binlog_set_chat_title (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_chat_photo (void *extra) { int fetch_comb_binlog_chat_set_photo (void *extra) {
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));
...@@ -591,7 +591,7 @@ int fetch_comb_binlog_set_chat_photo (void *extra) { ...@@ -591,7 +591,7 @@ int fetch_comb_binlog_set_chat_photo (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_chat_date (void *extra) { int fetch_comb_binlog_chat_set_date (void *extra) {
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));
C->chat.date = fetch_int (); C->chat.date = fetch_int ();
...@@ -602,7 +602,7 @@ int fetch_comb_binlog_set_chat_date (void *extra) { ...@@ -602,7 +602,7 @@ int fetch_comb_binlog_set_chat_date (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_chat_version (void *extra) { int fetch_comb_binlog_chat_set_version (void *extra) {
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));
C->chat.version = fetch_int (); C->chat.version = fetch_int ();
...@@ -614,7 +614,7 @@ int fetch_comb_binlog_set_chat_version (void *extra) { ...@@ -614,7 +614,7 @@ int fetch_comb_binlog_set_chat_version (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_chat_admin (void *extra) { int fetch_comb_binlog_chat_set_admin (void *extra) {
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));
C->chat.admin_id = fetch_int (); C->chat.admin_id = fetch_int ();
...@@ -625,7 +625,7 @@ int fetch_comb_binlog_set_chat_admin (void *extra) { ...@@ -625,7 +625,7 @@ int fetch_comb_binlog_set_chat_admin (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_set_chat_participants (void *extra) { int fetch_comb_binlog_chat_set_participants (void *extra) {
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));
C->chat.user_list_version = fetch_int (); C->chat.user_list_version = fetch_int ();
...@@ -640,7 +640,7 @@ int fetch_comb_binlog_set_chat_participants (void *extra) { ...@@ -640,7 +640,7 @@ int fetch_comb_binlog_set_chat_participants (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_chat_full_photo (void *extra) { int fetch_comb_binlog_chat_set_full_photo (void *extra) {
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));
...@@ -656,7 +656,7 @@ int fetch_comb_binlog_chat_full_photo (void *extra) { ...@@ -656,7 +656,7 @@ int fetch_comb_binlog_chat_full_photo (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_add_chat_participant (void *extra) { int fetch_comb_binlog_chat_add_participant (void *extra) {
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);
assert (_C && (_C->flags & FLAG_CREATED)); assert (_C && (_C->flags & FLAG_CREATED));
...@@ -686,7 +686,7 @@ int fetch_comb_binlog_add_chat_participant (void *extra) { ...@@ -686,7 +686,7 @@ int fetch_comb_binlog_add_chat_participant (void *extra) {
return 0; return 0;
} }
int fetch_comb_binlog_del_chat_participant (void *extra) { int fetch_comb_binlog_chat_del_participant (void *extra) {
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);
assert (_C && (_C->flags & FLAG_CREATED)); assert (_C && (_C->flags & FLAG_CREATED));
...@@ -1166,24 +1166,24 @@ void replay_log_event (void) { ...@@ -1166,24 +1166,24 @@ void replay_log_event (void) {
FETCH_COMBINATOR_FUNCTION (binlog_user_set_real_name) FETCH_COMBINATOR_FUNCTION (binlog_user_set_real_name)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_delete) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_delete)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_requested) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_requested)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_access_hash) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_set_access_hash)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_date) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_set_date)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_state) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_set_state)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_accepted) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_accepted)
FETCH_COMBINATOR_FUNCTION (binlog_set_encr_chat_key) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_set_key)
FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_init) FETCH_COMBINATOR_FUNCTION (binlog_encr_chat_init)
FETCH_COMBINATOR_FUNCTION (binlog_chat_create) FETCH_COMBINATOR_FUNCTION (binlog_chat_create)
FETCH_COMBINATOR_FUNCTION (binlog_chat_change_flags) FETCH_COMBINATOR_FUNCTION (binlog_chat_change_flags)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_title) FETCH_COMBINATOR_FUNCTION (binlog_chat_set_title)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_photo) FETCH_COMBINATOR_FUNCTION (binlog_chat_set_photo)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_date) FETCH_COMBINATOR_FUNCTION (binlog_chat_set_date)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_version) FETCH_COMBINATOR_FUNCTION (binlog_chat_set_version)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_admin) FETCH_COMBINATOR_FUNCTION (binlog_chat_set_admin)
FETCH_COMBINATOR_FUNCTION (binlog_set_chat_participants) FETCH_COMBINATOR_FUNCTION (binlog_chat_set_participants)
FETCH_COMBINATOR_FUNCTION (binlog_chat_full_photo) FETCH_COMBINATOR_FUNCTION (binlog_chat_set_full_photo)
FETCH_COMBINATOR_FUNCTION (binlog_add_chat_participant) FETCH_COMBINATOR_FUNCTION (binlog_chat_add_participant)
FETCH_COMBINATOR_FUNCTION (binlog_del_chat_participant) FETCH_COMBINATOR_FUNCTION (binlog_chat_del_participant)
FETCH_COMBINATOR_FUNCTION (binlog_create_message_text) FETCH_COMBINATOR_FUNCTION (binlog_create_message_text)
FETCH_COMBINATOR_FUNCTION (binlog_send_message_text) FETCH_COMBINATOR_FUNCTION (binlog_send_message_text)
...@@ -1513,28 +1513,28 @@ void bl_do_encr_chat_requested (struct secret_chat *U, long long access_hash, in ...@@ -1513,28 +1513,28 @@ void bl_do_encr_chat_requested (struct secret_chat *U, long long access_hash, in
add_log_event (ev, 540); add_log_event (ev, 540);
} }
void bl_do_set_encr_chat_access_hash (struct secret_chat *U, long long access_hash) { void bl_do_encr_chat_set_access_hash (struct secret_chat *U, long long access_hash) {
if (U->access_hash == access_hash) { return; } if (U->access_hash == access_hash) { return; }
int *ev = alloc_log_event (16); int *ev = alloc_log_event (16);
ev[0] = CODE_binlog_set_encr_chat_access_hash; ev[0] = CODE_binlog_encr_chat_set_access_hash;
ev[1] = get_peer_id (U->id); ev[1] = get_peer_id (U->id);
*(long long *)(ev + 2) = access_hash; *(long long *)(ev + 2) = access_hash;
add_log_event (ev, 16); add_log_event (ev, 16);
} }
void bl_do_set_encr_chat_date (struct secret_chat *U, int date) { void bl_do_encr_chat_set_date (struct secret_chat *U, int date) {
if (U->date == date) { return; } if (U->date == date) { return; }
int *ev = alloc_log_event (12); int *ev = alloc_log_event (12);
ev[0] = CODE_binlog_set_encr_chat_date; ev[0] = CODE_binlog_encr_chat_set_date;
ev[1] = get_peer_id (U->id); ev[1] = get_peer_id (U->id);
ev[2] = date; ev[2] = date;
add_log_event (ev, 12); add_log_event (ev, 12);
} }
void bl_do_set_encr_chat_state (struct secret_chat *U, enum secret_chat_state state) { void bl_do_encr_chat_set_state (struct secret_chat *U, enum secret_chat_state state) {
if (U->state == state) { return; } if (U->state == state) { return; }
int *ev = alloc_log_event (12); int *ev = alloc_log_event (12);
ev[0] = CODE_binlog_set_encr_chat_state; ev[0] = CODE_binlog_encr_chat_set_state;
ev[1] = get_peer_id (U->id); ev[1] = get_peer_id (U->id);
ev[2] = state; ev[2] = state;
add_log_event (ev, 12); add_log_event (ev, 12);
...@@ -1551,9 +1551,9 @@ void bl_do_encr_chat_accepted (struct secret_chat *U, const unsigned char g_key[ ...@@ -1551,9 +1551,9 @@ void bl_do_encr_chat_accepted (struct secret_chat *U, const unsigned char g_key[
add_log_event (ev, 528); add_log_event (ev, 528);
} }
void bl_do_set_encr_chat_key (struct secret_chat *E, unsigned char key[], long long key_fingerprint) { void bl_do_encr_chat_set_key (struct secret_chat *E, unsigned char key[], long long key_fingerprint) {
int *ev = alloc_log_event (272); int *ev = alloc_log_event (272);
ev[0] = CODE_binlog_set_encr_chat_key; ev[0] = CODE_binlog_encr_chat_set_key;
ev[1] = get_peer_id (E->id); ev[1] = get_peer_id (E->id);
memcpy (ev + 2, key, 256); memcpy (ev + 2, key, 256);
*(long long *)(ev + 66) = key_fingerprint; *(long long *)(ev + 66) = key_fingerprint;
...@@ -1641,36 +1641,36 @@ void bl_do_chat_forbid (struct chat *C, int on) { ...@@ -1641,36 +1641,36 @@ void bl_do_chat_forbid (struct chat *C, int on) {
} }
} }
void bl_do_set_chat_title (struct chat *C, const char *s, int l) { void bl_do_chat_set_title (struct chat *C, const char *s, int l) {
if (C->title && (int)strlen (C->title) == l && !strncmp (C->title, s, l)) { return; } if (C->title && (int)strlen (C->title) == l && !strncmp (C->title, s, l)) { return; }
clear_packet (); clear_packet ();
out_int (CODE_binlog_set_chat_title); out_int (CODE_binlog_chat_set_title);
out_int (get_peer_id (C->id)); out_int (get_peer_id (C->id));
out_cstring (s, l); out_cstring (s, l);
add_log_event (packet_buffer, 4 * (packet_ptr - packet_buffer)); add_log_event (packet_buffer, 4 * (packet_ptr - packet_buffer));
} }
void bl_do_set_chat_photo (struct chat *C, struct file_location *big, struct file_location *small) { void bl_do_chat_set_photo (struct chat *C, struct file_location *big, struct file_location *small) {
if (!memcmp (&C->photo_small, small, sizeof (struct file_location)) && if (!memcmp (&C->photo_small, small, sizeof (struct file_location)) &&
!memcmp (&C->photo_big, big, sizeof (struct file_location))) { return; } !memcmp (&C->photo_big, big, sizeof (struct file_location))) { return; }
clear_packet (); clear_packet ();
out_int (CODE_binlog_set_chat_photo); out_int (CODE_binlog_chat_set_photo);
out_int (get_peer_id (C->id)); out_int (get_peer_id (C->id));
out_data (big, sizeof (struct file_location)); out_data (big, sizeof (struct file_location));
out_data (small, sizeof (struct file_location)); out_data (small, sizeof (struct file_location));
add_log_event (packet_buffer, 4 * (packet_ptr - packet_buffer)); add_log_event (packet_buffer, 4 * (packet_ptr - packet_buffer));
} }
void bl_do_set_chat_date (struct chat *C, int date) { void bl_do_chat_set_date (struct chat *C, int date) {
if (C->date == date) { return; } if (C->date == date) { return; }
int *ev = alloc_log_event (12); int *ev = alloc_log_event (12);
ev[0] = CODE_binlog_set_chat_date; ev[0] = CODE_binlog_chat_set_date;
ev[1] = get_peer_id (C->id); ev[1] = get_peer_id (C->id);
ev[2] = date; ev[2] = date;
add_log_event (ev, 12); add_log_event (ev, 12);
} }
void bl_do_set_chat_set_in_chat (struct chat *C, int on) { void bl_do_chat_set_set_in_chat (struct chat *C, int on) {
if (on) { if (on) {
if (C->flags & FLAG_CHAT_IN_CHAT) { return; } if (C->flags & FLAG_CHAT_IN_CHAT) { return; }
int *ev = alloc_log_event (16); int *ev = alloc_log_event (16);
...@@ -1690,29 +1690,29 @@ void bl_do_set_chat_set_in_chat (struct chat *C, int on) { ...@@ -1690,29 +1690,29 @@ void bl_do_set_chat_set_in_chat (struct chat *C, int on) {
} }
} }
void bl_do_set_chat_version (struct chat *C, int version, int user_num) { void bl_do_chat_set_version (struct chat *C, int version, int user_num) {
if (C->version >= version) { return; } if (C->version >= version) { return; }
int *ev = alloc_log_event (16); int *ev = alloc_log_event (16);
ev[0] = CODE_binlog_set_chat_version; ev[0] = CODE_binlog_chat_set_version;
ev[1] = get_peer_id (C->id); ev[1] = get_peer_id (C->id);
ev[2] = version; ev[2] = version;
ev[3] = user_num; ev[3] = user_num;
add_log_event (ev, 16); add_log_event (ev, 16);
} }
void bl_do_set_chat_admin (struct chat *C, int admin) { void bl_do_chat_set_admin (struct chat *C, int admin) {
if (C->admin_id == admin) { return; } if (C->admin_id == admin) { return; }
int *ev = alloc_log_event (12); int *ev = alloc_log_event (12);
ev[0] = CODE_binlog_set_chat_admin; ev[0] = CODE_binlog_chat_set_admin;
ev[1] = get_peer_id (C->id); ev[1] = get_peer_id (C->id);
ev[2] = admin; ev[2] = admin;
add_log_event (ev, 12); add_log_event (ev, 12);
} }
void bl_do_set_chat_participants (struct chat *C, int version, int user_num, struct chat_user *users) { void bl_do_chat_set_participants (struct chat *C, int version, int user_num, struct chat_user *users) {
if (C->user_list_version >= version) { return; } if (C->user_list_version >= version) { return; }
int *ev = alloc_log_event (12 * user_num + 16); int *ev = alloc_log_event (12 * user_num + 16);
ev[0] = CODE_binlog_set_chat_participants; ev[0] = CODE_binlog_chat_set_participants;
ev[1] = get_peer_id (C->id); ev[1] = get_peer_id (C->id);
ev[2] = version; ev[2] = version;
ev[3] = user_num; ev[3] = user_num;
...@@ -1720,10 +1720,10 @@ void bl_do_set_chat_participants (struct chat *C, int version, int user_num, str ...@@ -1720,10 +1720,10 @@ void bl_do_set_chat_participants (struct chat *C, int version, int user_num, str
add_log_event (ev, 12 * user_num + 16); add_log_event (ev, 12 * user_num + 16);
} }
void bl_do_set_chat_full_photo (struct chat *U, const int *start, int len) { void bl_do_chat_set_full_photo (struct chat *U, const int *start, int len) {
if (U->photo.id == *(long long *)(start + 1)) { return; } if (U->photo.id == *(long long *)(start + 1)) { return; }
int *ev = alloc_log_event (len + 8); int *ev = alloc_log_event (len + 8);
ev[0] = CODE_binlog_chat_full_photo; ev[0] = CODE_binlog_chat_set_full_photo;
ev[1] = get_peer_id (U->id); ev[1] = get_peer_id (U->id);
memcpy (ev + 2, start, len); memcpy (ev + 2, start, len);
add_log_event (ev, len + 8); add_log_event (ev, len + 8);
...@@ -1732,7 +1732,7 @@ void bl_do_set_chat_full_photo (struct chat *U, const int *start, int len) { ...@@ -1732,7 +1732,7 @@ void bl_do_set_chat_full_photo (struct chat *U, const int *start, int len) {
void bl_do_chat_add_user (struct chat *C, int version, int user, int inviter, int date) { void bl_do_chat_add_user (struct chat *C, int version, int user, int inviter, int date) {
if (C->user_list_version >= version || !C->user_list_version) { return; } if (C->user_list_version >= version || !C->user_list_version) { return; }
int *ev = alloc_log_event (24); int *ev = alloc_log_event (24);
ev[0] = CODE_binlog_add_chat_participant; ev[0] = CODE_binlog_chat_add_participant;
ev[1] = get_peer_id (C->id); ev[1] = get_peer_id (C->id);
ev[2] = version; ev[2] = version;
ev[3] = user; ev[3] = user;
...@@ -1744,7 +1744,7 @@ void bl_do_chat_add_user (struct chat *C, int version, int user, int inviter, in ...@@ -1744,7 +1744,7 @@ void bl_do_chat_add_user (struct chat *C, int version, int user, int inviter, in
void bl_do_chat_del_user (struct chat *C, int version, int user) { void bl_do_chat_del_user (struct chat *C, int version, int user) {
if (C->user_list_version >= version || !C->user_list_version) { return; } if (C->user_list_version >= version || !C->user_list_version) { return; }
int *ev = alloc_log_event (16); int *ev = alloc_log_event (16);
ev[0] = CODE_binlog_add_chat_participant; ev[0] = CODE_binlog_chat_del_participant;
ev[1] = get_peer_id (C->id); ev[1] = get_peer_id (C->id);
ev[2] = version; ev[2] = version;
ev[3] = user; ev[3] = user;
......
...@@ -43,11 +43,11 @@ void bl_do_user_set_real_name (struct user *U, const char *f, int fl, const char ...@@ -43,11 +43,11 @@ void bl_do_user_set_real_name (struct user *U, const char *f, int fl, const char
void bl_do_encr_chat_delete (struct secret_chat *U); void bl_do_encr_chat_delete (struct secret_chat *U);
void bl_do_encr_chat_requested (struct secret_chat *U, long long access_hash, int date, int admin_id, int user_id, unsigned char g_key[], unsigned char nonce[]); void bl_do_encr_chat_requested (struct secret_chat *U, long long access_hash, int date, int admin_id, int user_id, unsigned char g_key[], unsigned char nonce[]);
void bl_do_set_encr_chat_access_hash (struct secret_chat *U, long long access_hash); void bl_do_encr_chat_set_access_hash (struct secret_chat *U, long long access_hash);
void bl_do_set_encr_chat_date (struct secret_chat *U, int date); void bl_do_encr_chat_set_date (struct secret_chat *U, int date);
void bl_do_set_encr_chat_state (struct secret_chat *U, enum secret_chat_state state); void bl_do_encr_chat_set_state (struct secret_chat *U, enum secret_chat_state state);
void bl_do_encr_chat_accepted (struct secret_chat *U, const unsigned char g_key[], const unsigned char nonce[], long long key_fingerprint); void bl_do_encr_chat_accepted (struct secret_chat *U, const unsigned char g_key[], const unsigned char nonce[], long long key_fingerprint);
void bl_do_set_encr_chat_key (struct secret_chat *E, unsigned char key[], long long key_fingerprint); void bl_do_encr_chat_set_key (struct secret_chat *E, unsigned char key[], long long key_fingerprint);
void bl_do_encr_chat_init (int id, int user_id, unsigned char random[], unsigned char g_a[]); void bl_do_encr_chat_init (int id, int user_id, unsigned char random[], unsigned char g_a[]);
void bl_do_dc_signed (int id); void bl_do_dc_signed (int id);
...@@ -61,14 +61,14 @@ void bl_do_set_date (int date); ...@@ -61,14 +61,14 @@ void bl_do_set_date (int date);
void bl_do_create_chat (struct chat *C, int y, const char *s, int l, int users_num, int date, int version, struct file_location *big, struct file_location *small); void bl_do_create_chat (struct chat *C, int y, const char *s, int l, int users_num, int date, int version, struct file_location *big, struct file_location *small);
void bl_do_chat_forbid (struct chat *C, int on); void bl_do_chat_forbid (struct chat *C, int on);
void bl_do_set_chat_title (struct chat *C, const char *s, int l); void bl_do_chat_set_title (struct chat *C, const char *s, int l);
void bl_do_set_chat_photo (struct chat *C, struct file_location *big, struct file_location *small); void bl_do_chat_set_photo (struct chat *C, struct file_location *big, struct file_location *small);
void bl_do_set_chat_date (struct chat *C, int date); void bl_do_chat_set_date (struct chat *C, int date);
void bl_do_set_chat_set_in_chat (struct chat *C, int on); void bl_do_chat_set_set_in_chat (struct chat *C, int on);
void bl_do_set_chat_version (struct chat *C, int version, int user_num); void bl_do_chat_set_version (struct chat *C, int version, int user_num);
void bl_do_set_chat_admin (struct chat *C, int admin); void bl_do_chat_set_admin (struct chat *C, int admin);
void bl_do_set_chat_participants (struct chat *C, int version, int user_num, struct chat_user *users); void bl_do_chat_set_participants (struct chat *C, int version, int user_num, struct chat_user *users);
void bl_do_set_chat_full_photo (struct chat *U, const int *start, int len); void bl_do_chat_set_full_photo (struct chat *U, const int *start, int len);
void bl_do_chat_add_user (struct chat *C, int version, int user, int inviter, int date); void bl_do_chat_add_user (struct chat *C, int version, int user, int inviter, int date);
void bl_do_chat_del_user (struct chat *C, int version, int user); void bl_do_chat_del_user (struct chat *C, int version, int user);
......
...@@ -30,24 +30,25 @@ binlog.userSetPhoto id:int photo:UserProfilePhoto = binlog.Update; ...@@ -30,24 +30,25 @@ binlog.userSetPhoto id:int photo:UserProfilePhoto = binlog.Update;
binlog.encrChatDelete id:int = binlog.Update; binlog.encrChatDelete id:int = binlog.Update;
binlog.encrChatRequested id:int hash:long date:int admin:int user:int key:64*[int] nonce:64*[int] = binlog.Update; binlog.encrChatRequested id:int hash:long date:int admin:int user:int key:64*[int] nonce:64*[int] = binlog.Update;
binlog.setEncrChatAccessHash id:int hash:long = binlog.Update;
binlog.setEncrChatDate id:int date: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.encrChatInit id:int user:int key:64*[int] g_key:64*[int] = binlog.Update; binlog.encrChatInit id:int user:int key:64*[int] g_key:64*[int] = binlog.Update;
binlog.encrChatSetAccessHash id:int hash:long = binlog.Update;
binlog.encrChatSetDate id:int date:int = binlog.Update;
binlog.encrChatSetState id:int state:int = binlog.Update;
binlog.encrChatSetKey id:int key:64*[int] fingerprint:long = 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.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.chatChangeFlags id:int set_flags:int clear_flags:int = binlog.Update;
binlog.setChatTitle id:int title:string = binlog.Update; binlog.chatSetTitle id:int title:string = binlog.Update;
binlog.setChatPhoto id:int photo_big:%binlog.FileLocation photo_small:%binlog.FileLocation = binlog.Update; binlog.chatSetPhoto id:int photo_big:%binlog.FileLocation photo_small:%binlog.FileLocation = binlog.Update;
binlog.setChatDate id:int date:int = binlog.Update; binlog.chatSetDate id:int date:int = binlog.Update;
binlog.setChatVersion id:int version:int users_num:int = binlog.Update; binlog.chatSetVersion id:int version:int users_num:int = binlog.Update;
binlog.setChatAdmin id:int admin:int = binlog.Update; binlog.chatSetAdmin id:int admin:int = binlog.Update;
binlog.setChatParticipants id:int version:int participants:%(Vector %binlog.ChatParticipant) = binlog.Update; binlog.chatSetParticipants id:int version:int participants:%(Vector %binlog.ChatParticipant) = binlog.Update;
binlog.chatFullPhoto id:int photo:Photo = binlog.Update; binlog.chatSetFullPhoto id:int photo:Photo = binlog.Update;
binlog.addChatParticipant id:int version:int user:%binlog.ChatParticipant = binlog.Update; binlog.chatAddParticipant id:int version:int user:%binlog.ChatParticipant = binlog.Update;
binlog.delChatParticipant id:int version:int user:int = binlog.Update; binlog.chatDelParticipant 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.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.sendMessageText id:long from_id:int to_type:int to_id:int date:int text:string = binlog.Update;
......
...@@ -1119,7 +1119,7 @@ void work_update (struct connection *c UU, long long msg_id UU) { ...@@ -1119,7 +1119,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
peer_t *C = user_chat_get (chat_id); peer_t *C = user_chat_get (chat_id);
if (C && (C->flags & FLAG_CREATED)) { if (C && (C->flags & FLAG_CREATED)) {
if (x == CODE_chat_participants) { if (x == CODE_chat_participants) {
bl_do_set_chat_admin (&C->chat, fetch_int ()); bl_do_chat_set_admin (&C->chat, fetch_int ());
assert (fetch_int () == CODE_vector); assert (fetch_int () == CODE_vector);
n = fetch_int (); n = fetch_int ();
struct chat_user *users = talloc (12 * n); struct chat_user *users = talloc (12 * n);
...@@ -1131,7 +1131,7 @@ void work_update (struct connection *c UU, long long msg_id UU) { ...@@ -1131,7 +1131,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
users[i].date = fetch_int (); users[i].date = fetch_int ();
} }
int version = fetch_int (); int version = fetch_int ();
bl_do_set_chat_participants (&C->chat, version, n, users); bl_do_chat_set_participants (&C->chat, version, n, users);
} }
} else { } else {
if (x == CODE_chat_participants) { if (x == CODE_chat_participants) {
......
...@@ -2389,7 +2389,7 @@ void do_send_accept_encr_chat (struct secret_chat *E, unsigned char *random) { ...@@ -2389,7 +2389,7 @@ void do_send_accept_encr_chat (struct secret_chat *E, unsigned char *random) {
static unsigned char sha_buffer[20]; static unsigned char sha_buffer[20];
sha1 (kk, 256, sha_buffer); sha1 (kk, 256, sha_buffer);
bl_do_set_encr_chat_key (E, kk, *(long long *)(sha_buffer + 12)); bl_do_encr_chat_set_key (E, kk, *(long long *)(sha_buffer + 12));
clear_packet (); clear_packet ();
out_int (CODE_messages_accept_encryption); out_int (CODE_messages_accept_encryption);
......
...@@ -307,8 +307,8 @@ void fetch_encrypted_chat (struct secret_chat *U) { ...@@ -307,8 +307,8 @@ void fetch_encrypted_chat (struct secret_chat *U) {
bl_do_encr_chat_requested (U, access_hash, date, admin_id, user_id, (void *)g_key, (void *)nonce); bl_do_encr_chat_requested (U, access_hash, date, admin_id, user_id, (void *)g_key, (void *)nonce);
write_secret_chat_file (); write_secret_chat_file ();
} else { } else {
bl_do_set_encr_chat_access_hash (U, fetch_long ()); bl_do_encr_chat_set_access_hash (U, fetch_long ());
bl_do_set_encr_chat_date (U, fetch_int ()); bl_do_encr_chat_set_date (U, fetch_int ());
if (fetch_int () != U->admin_id) { if (fetch_int () != U->admin_id) {
logprintf ("Changed admin in secret chat. WTF?\n"); logprintf ("Changed admin in secret chat. WTF?\n");
return; return;
...@@ -318,7 +318,7 @@ void fetch_encrypted_chat (struct secret_chat *U) { ...@@ -318,7 +318,7 @@ void fetch_encrypted_chat (struct secret_chat *U) {
return; return;
} }
if (x == CODE_encrypted_chat_waiting) { if (x == CODE_encrypted_chat_waiting) {
bl_do_set_encr_chat_state (U, sc_waiting); bl_do_encr_chat_set_state (U, sc_waiting);
write_secret_chat_file (); write_secret_chat_file ();
return; // We needed only access hash from here return; // We needed only access hash from here
} }
...@@ -413,7 +413,7 @@ void fetch_chat (struct chat *C) { ...@@ -413,7 +413,7 @@ void fetch_chat (struct chat *C) {
} }
int l = prefetch_strlen (); int l = prefetch_strlen ();
char *s = fetch_str (l); char *s = fetch_str (l);
bl_do_set_chat_title (C, s, l); bl_do_chat_set_title (C, s, l);
struct file_location small; struct file_location small;
struct file_location big; struct file_location big;
...@@ -430,13 +430,13 @@ void fetch_chat (struct chat *C) { ...@@ -430,13 +430,13 @@ void fetch_chat (struct chat *C) {
fetch_file_location (&small); fetch_file_location (&small);
fetch_file_location (&big); fetch_file_location (&big);
} }
bl_do_set_chat_photo (C, &big, &small); bl_do_chat_set_photo (C, &big, &small);
int users_num = fetch_int (); int users_num = fetch_int ();
bl_do_set_chat_date (C, fetch_int ()); bl_do_chat_set_date (C, fetch_int ());
bl_do_set_chat_set_in_chat (C, fetch_bool ()); bl_do_chat_set_set_in_chat (C, fetch_bool ());
bl_do_set_chat_version (C, users_num, fetch_int ()); bl_do_chat_set_version (C, users_num, fetch_int ());
} else { } else {
bl_do_set_chat_date (C, fetch_int ()); bl_do_chat_set_date (C, fetch_int ());
} }
} }
} }
...@@ -486,13 +486,13 @@ void fetch_chat_full (struct chat *C) { ...@@ -486,13 +486,13 @@ void fetch_chat_full (struct chat *C) {
fetch_alloc_user (); fetch_alloc_user ();
} }
if (admin_id) { if (admin_id) {
bl_do_set_chat_admin (C, admin_id); bl_do_chat_set_admin (C, admin_id);
} }
if (version > 0) { if (version > 0) {
bl_do_set_chat_participants (C, version, users_num, users); bl_do_chat_set_participants (C, version, users_num, users);
tfree (users, sizeof (struct chat_user) * users_num); tfree (users, sizeof (struct chat_user) * users_num);
} }
bl_do_set_chat_full_photo (C, start, 4 * (end - start)); bl_do_chat_set_full_photo (C, start, 4 * (end - start));
} }
void fetch_photo_size (struct photo_size *S) { void fetch_photo_size (struct photo_size *S) {
......
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