Commit 337be909 authored by Vysheng's avatar Vysheng

many changes

parent a05d1cfd
......@@ -36,7 +36,7 @@ CC=@CC@
.SUFFIXES: .c .h .o
all: ${EXE_LIST} ${DIR_LIST}
create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto.c ${AUTO}/auto-header.h
create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto.c ${AUTO}/auto-header.h ${AUTO}/constants.h
create_dirs: ${DIR_LIST}
${DIR_LIST}:
......@@ -59,8 +59,14 @@ ${EXE}/telegram-cli: ${TG_OBJECTS} ${COMMON_OBJECTS}
${EXE}/generate: ${GENERATE_OBJECTS} ${COMMON_OBJECTS}
${CC} ${GENERATE_OBJECTS} ${COMMON_OBJECTS} ${LINK_FLAGS} -o $@
${AUTO}/scheme.tlo: ${srcdir}/scheme.tl ${EXE}/tlc
${EXE}/tlc -e $@ ${srcdir}/scheme.tl
${AUTO}/scheme.tlo: ${AUTO}/scheme.tl ${EXE}/tlc
${EXE}/tlc -e $@ ${AUTO}/scheme.tl
${AUTO}/scheme.tl: ${srcdir}/scheme.tl ${srcdir}/binlog.tl
cat $^ > $@
${AUTO}/scheme2.tl: ${AUTO}/scheme.tl ${EXE}/tlc
${EXE}/tlc -E ${AUTO}/scheme.tl 2> $@ || ( cat $@ && rm $@ && false )
${AUTO}/auto.c: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate ${AUTO}/scheme.tlo > $@
......@@ -68,6 +74,9 @@ ${AUTO}/auto.c: ${AUTO}/scheme.tlo ${EXE}/generate
${AUTO}/auto-header.h: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate -H ${AUTO}/scheme.tlo > $@
${AUTO}/constants.h: ${AUTO}/scheme2.tl
awk -f ${srcdir}/gen_constants_h.awk < $^ > $@
clean:
rm -rf ${DIR_LIST} config.log config.status > /dev/null || echo "all clean"
......@@ -14,11 +14,14 @@ struct paramed_type {
#define NAME_ARRAY 0x89932ad9
#define TYPE_TO_PARAM(NAME) (&(struct paramed_type) {.type = &tl_type_## NAME, .params=0})
#define TYPE_TO_PARAM_1(NAME,PARAM1) (&(struct paramed_type) {.type = &tl_type_## NAME, .params=(struct paramed_type *[1]){PARAM1}})
#define ODDP(x) (((long)(x)) & 1)
#define EVENP(x) (!ODDP(x))
#define INT2PTR(x) (void *)(long)(((long)x) * 2 + 1)
#define PTR2INT(x) ((((long)x) - 1) / 2)
#define FETCH_COMBINATOR_FUNCTION(NAME)
#include "auto/auto-header.h"
#endif
......@@ -76,6 +76,125 @@ void *alloc_log_event (int l UU) {
long long binlog_pos;
int fetch_comb_binlog_start (void *extra) {
return 0;
}
int fetch_comb_binlog_dc_option (void *extra) {
int id = fetch_int ();
int l1 = prefetch_strlen ();
assert (l1 >= 0);
char *name = fetch_str (l1);
int l2 = prefetch_strlen ();
assert (l2 >= 0);
char *ip = fetch_str (l2);
int port = fetch_int ();
if (verbosity) {
logprintf ("DC%d '%s' update: %s:%d\n", id, name, ip, port);
}
alloc_dc (id, tstrndup (ip, l2), port);
return 0;
}
int fetch_comb_binlog_auth_key (void *extra) {
int num = fetch_int ();
assert (num >= 0 && num <= MAX_DC_ID);
assert (DC_list[num]);
DC_list[num]->auth_key_id = fetch_long ();
fetch_ints (DC_list[num]->auth_key, 64);
DC_list[num]->flags |= 1;
return 0;
}
int fetch_comb_binlog_default_dc (void *extra) {
int num = fetch_int ();
assert (num >= 0 && num <= MAX_DC_ID);
DC_working = DC_list[num];
dc_working_num = num;
return 0;
}
int fetch_comb_binlog_our_id (void *extra) {
our_id = fetch_int ();
#ifdef USE_LUA
lua_our_id (our_id);
#endif
return 0;
}
int fetch_comb_binlog_dc_signed (void *extra) {
int num = fetch_int ();
assert (num >= 0 && num <= MAX_DC_ID);
assert (DC_list[num]);
DC_list[num]->has_auth = 1;
return 0;
}
int fetch_comb_binlog_dc_salt (void *extra) {
int num = fetch_int ();
assert (num >= 0 && num <= MAX_DC_ID);
assert (DC_list[num]);
DC_list[num]->server_salt = fetch_long ();
return 0;
}
int fetch_comb_binlog_new_user (void *extra) {
peer_id_t id = MK_USER (fetch_int ());
peer_t *_U = user_chat_get (id);
if (!_U) {
_U = talloc0 (sizeof (*_U));
_U->id = id;
insert_user (_U);
} else {
assert (!(_U->flags & FLAG_CREATED));
}
struct user *U = (void *)_U;
U->flags |= FLAG_CREATED;
if (get_peer_id (id) == our_id) {
U->flags |= FLAG_USER_SELF;
}
U->first_name = fetch_str_dup ();
U->last_name = fetch_str_dup ();
assert (!U->print_name);
U->print_name = create_print_name (U->id, U->first_name, U->last_name, 0, 0);
peer_insert_name ((void *)U);
U->access_hash = fetch_long ();
U->phone = fetch_str_dup ();
if (fetch_int ()) {
U->flags |= FLAG_USER_CONTACT;
}
#ifdef USE_LUA
lua_user_update (U);
#endif
return 0;
}
int fetch_comb_binlog_new_user (void *extra) {
peer_id_t id = MK_USER (fetch_int ());
peer_t *U = user_chat_get (id);
assert (U);
U->flags |= FLAG_DELETED;
#ifdef USE_LUA
lua_user_update (U);
#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_new_user)
FETCH_COMBINATOR_FUNCTION (binlog_user_delete)
void replay_log_event (void) {
int *start = rptr;
in_replay_log = 1;
......@@ -89,258 +208,6 @@ void replay_log_event (void) {
in_ptr = rptr;
in_end = wptr;
switch (op) {
case LOG_START:
rptr ++;
break;
case CODE_binlog_dc_option:
in_ptr ++;
{
int id = fetch_int ();
int l1 = prefetch_strlen ();
char *name = fetch_str (l1);
int l2 = prefetch_strlen ();
char *ip = fetch_str (l2);
int port = fetch_int ();
if (verbosity) {
logprintf ( "id = %d, name = %.*s ip = %.*s port = %d\n", id, l1, name, l2, ip, port);
}
alloc_dc (id, tstrndup (ip, l2), port);
}
rptr = in_ptr;
break;
case LOG_AUTH_KEY:
rptr ++;
{
int num = *(rptr ++);
assert (num >= 0 && num <= MAX_DC_ID);
assert (DC_list[num]);
DC_list[num]->auth_key_id = *(long long *)rptr;
rptr += 2;
memcpy (DC_list[num]->auth_key, rptr, 256);
rptr += 64;
DC_list[num]->flags |= 1;
};
break;
case LOG_DEFAULT_DC:
rptr ++;
{
int num = *(rptr ++);
assert (num >= 0 && num <= MAX_DC_ID);
DC_working = DC_list[num];
dc_working_num = num;
}
break;
case LOG_OUR_ID:
rptr ++;
{
our_id = *(rptr ++);
#ifdef USE_LUA
lua_our_id (our_id);
#endif
}
break;
case LOG_DC_SIGNED:
rptr ++;
{
int num = *(rptr ++);
assert (num >= 0 && num <= MAX_DC_ID);
assert (DC_list[num]);
DC_list[num]->has_auth = 1;
}
break;
case LOG_DC_SALT:
rptr ++;
{
int num = *(rptr ++);
assert (num >= 0 && num <= MAX_DC_ID);
assert (DC_list[num]);
DC_list[num]->server_salt = *(long long *)rptr;
rptr += 2;
};
break;
/* case CODE_user_empty:
case CODE_user_self:
case CODE_user_contact:
case CODE_user_request:
case CODE_user_foreign:
case CODE_user_deleted:
fetch_alloc_user ();
rptr = in_ptr;
break;*/
case LOG_DH_CONFIG:
get_dh_config_on_answer (0);
rptr = in_ptr;
break;
case LOG_ENCR_CHAT_KEY:
rptr ++;
{
peer_id_t id = MK_ENCR_CHAT (*(rptr ++));
struct secret_chat *U = (void *)user_chat_get (id);
assert (U);
U->key_fingerprint = *(long long *)rptr;
rptr += 2;
memcpy (U->key, rptr, 256);
rptr += 64;
};
break;
case LOG_ENCR_CHAT_SEND_ACCEPT:
rptr ++;
{
peer_id_t id = MK_ENCR_CHAT (*(rptr ++));
struct secret_chat *U = (void *)user_chat_get (id);
assert (U);
U->key_fingerprint = *(long long *)rptr;
rptr += 2;
memcpy (U->key, rptr, 256);
rptr += 64;
if (!U->g_key) {
U->g_key = talloc (256);
}
memcpy (U->g_key, rptr, 256);
rptr += 64;
};
break;
case LOG_ENCR_CHAT_SEND_CREATE:
rptr ++;
{
peer_id_t id = MK_ENCR_CHAT (*(rptr ++));
struct secret_chat *U = (void *)user_chat_get (id);
assert (!U || !(U->flags & FLAG_CREATED));
if (!U) {
U = talloc0 (sizeof (peer_t));
U->id = id;
insert_encrypted_chat ((void *)U);
}
U->flags |= FLAG_CREATED;
U->user_id = *(rptr ++);
memcpy (U->key, rptr, 256);
rptr += 64;
if (!U->print_name) {
peer_t *P = user_chat_get (MK_USER (U->user_id));
if (P) {
U->print_name = create_print_name (U->id, "!", P->user.first_name, P->user.last_name, 0);
} else {
static char buf[100];
tsnprintf (buf, 99, "user#%d", U->user_id);
U->print_name = create_print_name (U->id, "!", buf, 0, 0);
}
peer_insert_name ((void *)U);
}
};
break;
case LOG_ENCR_CHAT_DELETED:
rptr ++;
{
peer_id_t id = MK_ENCR_CHAT (*(rptr ++));
struct secret_chat *U = (void *)user_chat_get (id);
if (!U) {
U = talloc0 (sizeof (peer_t));
U->id = id;
insert_encrypted_chat ((void *)U);
}
U->flags |= FLAG_CREATED;
U->state = sc_deleted;
};
break;
case LOG_ENCR_CHAT_WAITING:
rptr ++;
{
peer_id_t id = MK_ENCR_CHAT (*(rptr ++));
struct secret_chat *U = (void *)user_chat_get (id);
assert (U);
U->state = sc_waiting;
U->date = *(rptr ++);
U->admin_id = *(rptr ++);
U->user_id = *(rptr ++);
U->access_hash = *(long long *)rptr;
rptr += 2;
};
break;
case LOG_ENCR_CHAT_REQUESTED:
rptr ++;
{
peer_id_t id = MK_ENCR_CHAT (*(rptr ++));
struct secret_chat *U = (void *)user_chat_get (id);
if (!U) {
U = talloc0 (sizeof (peer_t));
U->id = id;
insert_encrypted_chat ((void *)U);
}
U->flags |= FLAG_CREATED;
U->state = sc_request;
U->date = *(rptr ++);
U->admin_id = *(rptr ++);
U->user_id = *(rptr ++);
U->access_hash = *(long long *)rptr;
if (!U->print_name) {
peer_t *P = user_chat_get (MK_USER (U->user_id));
if (P) {
U->print_name = create_print_name (U->id, "!", P->user.first_name, P->user.last_name, 0);
} else {
static char buf[100];
tsnprintf (buf, 99, "user#%d", U->user_id);
U->print_name = create_print_name (U->id, "!", buf, 0, 0);
}
peer_insert_name ((void *)U);
}
rptr += 2;
};
break;
case LOG_ENCR_CHAT_OK:
rptr ++;
{
peer_id_t id = MK_ENCR_CHAT (*(rptr ++));
struct secret_chat *U = (void *)user_chat_get (id);
assert (U);
U->state = sc_ok;
#ifdef USE_LUA
lua_secret_chat_created (U);
#endif
}
break;
case CODE_binlog_new_user:
in_ptr ++;
{
peer_id_t id = MK_USER (fetch_int ());
peer_t *_U = user_chat_get (id);
if (!_U) {
_U = talloc0 (sizeof (*_U));
_U->id = id;
insert_user (_U);
} else {
assert (!(_U->flags & FLAG_CREATED));
}
struct user *U = (void *)_U;
U->flags |= FLAG_CREATED;
if (get_peer_id (id) == our_id) {
U->flags |= FLAG_USER_SELF;
}
U->first_name = fetch_str_dup ();
U->last_name = fetch_str_dup ();
assert (!U->print_name);
U->print_name = create_print_name (U->id, U->first_name, U->last_name, 0, 0);
peer_insert_name ((void *)U);
U->access_hash = fetch_long ();
U->phone = fetch_str_dup ();
if (fetch_int ()) {
U->flags |= FLAG_USER_CONTACT;
}
#ifdef USE_LUA
lua_user_update (U);
#endif
}
rptr = in_ptr;
break;
case CODE_binlog_user_delete:
rptr ++;
{
peer_id_t id = MK_USER (*(rptr ++));
peer_t *U = user_chat_get (id);
assert (U);
U->flags |= FLAG_DELETED;
}
break;
case CODE_binlog_set_user_access_token:
rptr ++;
{
......
......@@ -36,7 +36,6 @@
#define LOG_ENCR_CHAT_REQUESTED 0x9011011a
#define LOG_ENCR_CHAT_OK 0x7612ce13
#define CODE_binlog_new_user 0xe04f30de
#define CODE_binlog_user_delete 0xf7a27c79
#define CODE_binlog_set_user_access_token 0x1349f615
#define CODE_binlog_set_user_phone 0x5d3afde2
......
log.peer peer_type:int peer_id:int = log.Peer;
log.dc num:int hostname:string ip:string port:int = log.Event;
log.dcRenum old_num:int new_num:int = log.Event;
log.authKey dc:int key:bytes key_id:long = log.Event;
log.signIn dc:int id:int = log.Event;
log.user id:int flags:int access_hash:long first_name:string last_name:string real_first_name:string real_last_name:string phone:string photo:log.Photo photo_id:long photo_big:log.FileLocation photo_small:long.FileLocation = log.Event;
---types---
binlog.start = binlog.Update;
binlog.dcUpdate id:int name:string ip:string port:int = binlog.Update;
binlog.authKey dc:int key_id:long key:64*[int] = binlog.Update;
binlog.defaultDc dc:int = binlog.Update;
binlog.ourId id:int = binlog.Update;
binlog.dcSigned id:int = binlog.Update;
binlog.dcSalt id:int salt:long = 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;
This diff is collapsed.
......@@ -17,7 +17,7 @@ lua_State *luaState;
#include "structures.h"
#include "interface.h"
#include "constants.h"
#include "auto/constants.h"
#include "tools.h"
#include "queries.h"
#include "net.h"
......
......@@ -1409,7 +1409,7 @@ void work_update_short (struct connection *c, long long msg_id) {
void work_updates (struct connection *c, long long msg_id) {
int *save = in_ptr;
assert (!skip_type_any (&(struct paramed_type) {.type = &tl_type_Updates, .params=0}));
assert (!skip_type_any (TYPE_TO_PARAM (Updates)));
int *save_end = in_ptr;
in_ptr = save;
assert (fetch_int () == CODE_updates);
......
......@@ -28,7 +28,7 @@
#include "interface.h"
#include "tools.h"
#include "constants.h"
#include "auto/constants.h"
/* DH key exchange protocol data structures */
#define CODE_req_pq 0x60469778
#define CODE_resPQ 0x05162463
......@@ -323,6 +323,17 @@ static inline void fetch_ints (void *data, int count) {
memcpy (data, in_ptr, 4 * count);
in_ptr += count;
}
static inline void fetch256 (void *buf) {
int l = prefetch_strlen ();
assert (l >= 0);
char *s = fetch_str (l);
if (l < 256) {
memcpy (buf + 256 - l, s, l);
} else {
memcpy (buf, s + (l - 256), 256);
}
}
int get_random_bytes (unsigned char *buf, int n);
......
......@@ -1324,15 +1324,18 @@ int send_encr_file_on_answer (struct query *q UU) {
}
struct query_methods send_file_part_methods = {
.on_answer = send_file_part_on_answer
.on_answer = send_file_part_on_answer,
.type = TYPE_TO_PARAM(Bool)
};
struct query_methods send_file_methods = {
.on_answer = send_file_on_answer
.on_answer = send_file_on_answer,
.type = TYPE_TO_PARAM(messages_StatedMessage)
};
struct query_methods send_encr_file_methods = {
.on_answer = send_encr_file_on_answer
.on_answer = send_encr_file_on_answer,
.type = TYPE_TO_PARAM(messages_SentEncryptedMessage)
};
void send_part (struct send_file *f) {
......@@ -1614,7 +1617,8 @@ int fwd_msg_on_answer (struct query *q UU) {
}
struct query_methods fwd_msg_methods = {
.on_answer = fwd_msg_on_answer
.on_answer = fwd_msg_on_answer,
.type = TYPE_TO_PARAM(messages_StatedMessage)
};
void do_forward_message (peer_id_t id, int n) {
......@@ -1653,7 +1657,8 @@ int rename_chat_on_answer (struct query *q UU) {
}
struct query_methods rename_chat_methods = {
.on_answer = rename_chat_on_answer
.on_answer = rename_chat_on_answer,
.type = TYPE_TO_PARAM(messages_StatedMessage)
};
void do_rename_chat (peer_id_t id, char *name UU) {
......@@ -1698,7 +1703,8 @@ int chat_info_on_answer (struct query *q UU) {
}
struct query_methods chat_info_methods = {
.on_answer = chat_info_on_answer
.on_answer = chat_info_on_answer,
.type = TYPE_TO_PARAM(messages_ChatFull)
};
void do_get_chat_info (peer_id_t id) {
......@@ -1748,7 +1754,8 @@ int user_info_on_answer (struct query *q UU) {
}
struct query_methods user_info_methods = {
.on_answer = user_info_on_answer
.on_answer = user_info_on_answer,
.type = TYPE_TO_PARAM(UserFull)
};
void do_get_user_info (peer_id_t id) {
......@@ -1789,7 +1796,8 @@ int user_list_info_silent_on_answer (struct query *q UU) {
}
struct query_methods user_list_info_silent_methods = {
.on_answer = user_list_info_silent_on_answer
.on_answer = user_list_info_silent_on_answer,
.type = TYPE_TO_PARAM_1(Vector, TYPE_TO_PARAM(User))
};
void do_get_user_list_info_silent (int num, int *list) {
......@@ -1891,7 +1899,8 @@ int download_on_answer (struct query *q) {
}
struct query_methods download_methods = {
.on_answer = download_on_answer
.on_answer = download_on_answer,
.type = TYPE_TO_PARAM(upload_File)
};
void load_next_part (struct download *D) {
......@@ -2092,7 +2101,8 @@ int export_auth_on_answer (struct query *q UU) {
struct query_methods export_auth_methods = {
.on_answer = export_auth_on_answer,
.on_error = fail_on_error
.on_error = fail_on_error,
.type = TYPE_TO_PARAM(auth_ExportedAuthorization)
};
void do_export_auth (int num) {
......@@ -2117,7 +2127,8 @@ int import_auth_on_answer (struct query *q UU) {
struct query_methods import_auth_methods = {
.on_answer = import_auth_on_answer,
.on_error = fail_on_error
.on_error = fail_on_error,
.type = TYPE_TO_PARAM(auth_Authorization)
};
void do_import_auth (int num) {
......@@ -2183,6 +2194,7 @@ int add_contact_on_answer (struct query *q UU) {
struct query_methods add_contact_methods = {
.on_answer = add_contact_on_answer,
.type = TYPE_TO_PARAM(contacts_ImportedContacts)
};
void do_add_contact (const char *phone, int phone_len, const char *first_name, int first_name_len, const char *last_name, int last_name_len, int force) {
......@@ -2206,7 +2218,8 @@ int msg_search_on_answer (struct query *q UU) {
}
struct query_methods msg_search_methods = {
.on_answer = msg_search_on_answer
.on_answer = msg_search_on_answer,
.type = TYPE_TO_PARAM(messages_Messages)
};
void do_msg_search (peer_id_t id, int from, int to, int limit, const char *s) {
......@@ -2260,7 +2273,8 @@ int contacts_search_on_answer (struct query *q UU) {
}
struct query_methods contacts_search_methods = {
.on_answer = contacts_search_on_answer
.on_answer = contacts_search_on_answer,
.type = TYPE_TO_PARAM(contacts_Found)
};
void do_contacts_search (int limit, const char *s) {
......@@ -2321,11 +2335,13 @@ int send_encr_request_on_answer (struct query *q UU) {
}
struct query_methods send_encr_accept_methods = {
.on_answer = send_encr_accept_on_answer
.on_answer = send_encr_accept_on_answer,
.type = TYPE_TO_PARAM(EncryptedChat)
};
struct query_methods send_encr_request_methods = {
.on_answer = send_encr_request_on_answer
.on_answer = send_encr_request_on_answer,
.type = TYPE_TO_PARAM(EncryptedChat)
};
int encr_root;
......@@ -2544,7 +2560,8 @@ int get_dh_config_on_answer (struct query *q UU) {
}
struct query_methods get_dh_config_methods = {
.on_answer = get_dh_config_on_answer
.on_answer = get_dh_config_on_answer,
.type = TYPE_TO_PARAM(messages_DhConfig)
};
void do_accept_encr_chat_request (struct secret_chat *E) {
......@@ -2655,11 +2672,13 @@ int get_difference_on_answer (struct query *q UU) {
}
struct query_methods get_state_methods = {
.on_answer = get_state_on_answer
.on_answer = get_state_on_answer,
.type = TYPE_TO_PARAM(updates_State)
};
struct query_methods get_difference_methods = {
.on_answer = get_difference_on_answer
.on_answer = get_difference_on_answer,
.type = TYPE_TO_PARAM(updates_Difference)
};
void do_get_difference (void) {
......@@ -2746,7 +2765,8 @@ int get_suggested_on_answer (struct query *q UU) {
}
struct query_methods get_suggested_methods = {
.on_answer = get_suggested_on_answer
.on_answer = get_suggested_on_answer,
.type = TYPE_TO_PARAM(contacts_Suggested)
};
void do_get_suggested (void) {
......@@ -2760,7 +2780,8 @@ void do_get_suggested (void) {
/* {{{ Add user to chat */
struct query_methods add_user_to_chat_methods = {
.on_answer = fwd_msg_on_answer
.on_answer = fwd_msg_on_answer,
.type = TYPE_TO_PARAM(MessageAction)
};
void do_add_user_to_chat (peer_id_t chat_id, peer_id_t id, int limit) {
......@@ -2818,7 +2839,8 @@ void do_create_secret_chat (peer_id_t id) {
/* {{{ Create group chat */
struct query_methods create_group_chat_methods = {
.on_answer = fwd_msg_on_answer
.on_answer = fwd_msg_on_answer,
.type = TYPE_TO_PARAM(MessageAction)
};
void do_create_group_chat (peer_id_t id, char *chat_topic) {
......@@ -2857,7 +2879,8 @@ int delete_msg_on_answer (struct query *q UU) {
}
struct query_methods delete_msg_methods = {
.on_answer = delete_msg_on_answer
.on_answer = delete_msg_on_answer,
.type = TYPE_TO_PARAM_1(Vector, TYPE_TO_PARAM (bare_Int))
};
void do_delete_msg (long long id) {
......@@ -2881,7 +2904,8 @@ int restore_msg_on_answer (struct query *q UU) {
}
struct query_methods restore_msg_methods = {
.on_answer = restore_msg_on_answer
.on_answer = restore_msg_on_answer,
.type = TYPE_TO_PARAM_1(Vector, TYPE_TO_PARAM (bare_Int))
};
void do_restore_msg (long long id) {
......@@ -2899,7 +2923,8 @@ int update_status_on_answer (struct query *q UU) {
}
struct query_methods update_status_methods = {
.on_answer = update_status_on_answer
.on_answer = update_status_on_answer,
.type = TYPE_TO_PARAM(Bool)
};
void do_update_status (int online UU) {
......
This diff is collapsed.
......@@ -1197,6 +1197,8 @@ struct tl_constructor *tl_add_function (struct tl_type *a, const char *_id, int
assert (magic && magic != (unsigned)-1);
}
len = x;
struct tl_constructor _t = {.id = id};
if (tree_lookup_tl_constructor (tl_function_tree, &_t)) {
TL_ERROR ("Duplicate function id `%s`\n", id);
......
......@@ -139,6 +139,9 @@ void *talloc (size_t size) {
*(int *)(p + RES_AFTER + 4 + size) = used_blocks;
blocks[used_blocks ++] = p;
if (used_blocks - 1 == 24867) {
assert (0);
}
tcheck ();
return p + 8;
#else
......
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