Commit 9b956320 authored by vvaltman's avatar vvaltman

added accept_secret_chat

parent 4458d2ca
...@@ -373,6 +373,7 @@ struct command commands[] = { ...@@ -373,6 +373,7 @@ struct command commands[] = {
{"create_group_chat", {ca_string_end}}, {"create_group_chat", {ca_string_end}},
{"chat_set_photo", {ca_chat, ca_file_name_end}}, {"chat_set_photo", {ca_chat, ca_file_name_end}},
{"set_profile_photo", {ca_file_name_end}}, {"set_profile_photo", {ca_file_name_end}},
{"accept_secret_chat", {ca_secret_chat, ca_none}},
{0, {ca_none}} {0, {ca_none}}
}; };
...@@ -1573,6 +1574,11 @@ void interpreter (char *line UU) { ...@@ -1573,6 +1574,11 @@ void interpreter (char *line UU) {
tgl_do_restore_msg (num, 0, 0); tgl_do_restore_msg (num, 0, 0);
} else if (IS_WORD ("quit")) { } else if (IS_WORD ("quit")) {
exit (0); exit (0);
} else if (IS_WORD ("accept_secret_chat")) {
GET_PEER_ENCR_CHAT;
tgl_peer_t *E = tgl_peer_get (id);
assert (E);
tgl_do_accept_encr_chat_request (&E->encr_chat, 0, 0);
} else if (IS_WORD ("safe_quit")) { } else if (IS_WORD ("safe_quit")) {
safe_quit = 1; safe_quit = 1;
} }
......
...@@ -2757,6 +2757,12 @@ static struct query_methods get_dh_config_methods = { ...@@ -2757,6 +2757,12 @@ static struct query_methods get_dh_config_methods = {
}; };
void tgl_do_accept_encr_chat_request (struct tgl_secret_chat *E, void (*callback)(void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) { void tgl_do_accept_encr_chat_request (struct tgl_secret_chat *E, void (*callback)(void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
if (E->state != sc_request) {
if (callback) {
callback (callback_extra, 0, E);
return;
}
}
assert (E->state == sc_request); assert (E->state == sc_request);
clear_packet (); clear_packet ();
......
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