Commit 80998dc7 authored by vvaltman's avatar vvaltman

Fixed bug in set_friend()

parent e57b7064
...@@ -230,7 +230,6 @@ static int fetch_comb_binlog_user_set_phone (void *extra) { ...@@ -230,7 +230,6 @@ static int fetch_comb_binlog_user_set_phone (void *extra) {
} }
U->user.phone = fetch_str_dup (); U->user.phone = fetch_str_dup ();
if (tgl_state.callback.user_update) { if (tgl_state.callback.user_update) {
tgl_state.callback.user_update ((void *)U, TGL_UPDATE_PHONE); tgl_state.callback.user_update ((void *)U, TGL_UPDATE_PHONE);
} }
...@@ -241,9 +240,6 @@ static int fetch_comb_binlog_user_set_friend (void *extra) { ...@@ -241,9 +240,6 @@ static int fetch_comb_binlog_user_set_friend (void *extra) {
tgl_peer_id_t id = TGL_MK_USER (fetch_int ()); tgl_peer_id_t id = TGL_MK_USER (fetch_int ());
tgl_peer_t *U = tgl_peer_get (id); tgl_peer_t *U = tgl_peer_get (id);
assert (U); assert (U);
if (U->user.phone) {
tfree_str (U->user.phone);
}
int friend = fetch_int (); int friend = fetch_int ();
if (friend) { U->flags |= FLAG_USER_CONTACT; } if (friend) { U->flags |= FLAG_USER_CONTACT; }
else { U->flags &= ~FLAG_USER_CONTACT; } else { U->flags &= ~FLAG_USER_CONTACT; }
......
...@@ -617,7 +617,7 @@ void print_user_info_gw (void *extra, int success, struct tgl_user *U) { ...@@ -617,7 +617,7 @@ void print_user_info_gw (void *extra, int success, struct tgl_user *U) {
push_color (COLOR_YELLOW); push_color (COLOR_YELLOW);
printf ("User "); printf ("User ");
print_user_name (U->id, C); print_user_name (U->id, C);
printf (":\n"); printf (" (#%d):\n", tgl_get_peer_id (U->id));
printf ("\treal name: %s %s\n", U->real_first_name, U->real_last_name); printf ("\treal name: %s %s\n", U->real_first_name, U->real_last_name);
printf ("\tphone: %s\n", U->phone); printf ("\tphone: %s\n", U->phone);
if (U->status.online > 0) { if (U->status.online > 0) {
......
...@@ -69,7 +69,7 @@ void tglu_fetch_date (void) { ...@@ -69,7 +69,7 @@ void tglu_fetch_date (void) {
} }
} }
void tglu_fetch_seq (void) { /*void tglu_fetch_seq (void) {
int x = fetch_int (); int x = fetch_int ();
if (x > tgl_state.seq + 1) { if (x > tgl_state.seq + 1) {
vlogprintf (E_NOTICE, "Hole in seq: seq = %d, x = %d\n", tgl_state.seq, x); vlogprintf (E_NOTICE, "Hole in seq: seq = %d, x = %d\n", tgl_state.seq, x);
...@@ -79,7 +79,7 @@ void tglu_fetch_seq (void) { ...@@ -79,7 +79,7 @@ void tglu_fetch_seq (void) {
tgl_state.seq = x; tgl_state.seq = x;
bl_do_set_seq (tgl_state.seq); bl_do_set_seq (tgl_state.seq);
} }
} }*/
static void fetch_dc_option (void) { static void fetch_dc_option (void) {
assert (fetch_int () == CODE_dc_option); assert (fetch_int () == CODE_dc_option);
......
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