Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
8dd17ec6
Commit
8dd17ec6
authored
Aug 12, 2014
by
vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some renaming
parent
a37e5f43
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
91 deletions
+92
-91
binlog.c
binlog.c
+51
-51
binlog.h
binlog.h
+12
-12
binlog.tl
binlog.tl
+14
-13
mtproto-client.c
mtproto-client.c
+2
-2
queries.c
queries.c
+1
-1
structures.c
structures.c
+12
-12
No files found.
binlog.c
View file @
8dd17ec6
...
...
@@ -420,7 +420,7 @@ int fetch_comb_binlog_encr_chat_requested (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_encr_cha
t_access_hash
(
void
*
extra
)
{
int
fetch_comb_binlog_
encr_chat_se
t_access_hash
(
void
*
extra
)
{
peer_id_t
id
=
MK_ENCR_CHAT
(
fetch_int
());
peer_t
*
U
=
user_chat_get
(
id
);
assert
(
U
);
...
...
@@ -432,7 +432,7 @@ int fetch_comb_binlog_set_encr_chat_access_hash (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_encr_cha
t_date
(
void
*
extra
)
{
int
fetch_comb_binlog_
encr_chat_se
t_date
(
void
*
extra
)
{
peer_id_t
id
=
MK_ENCR_CHAT
(
fetch_int
());
peer_t
*
U
=
user_chat_get
(
id
);
assert
(
U
);
...
...
@@ -444,7 +444,7 @@ int fetch_comb_binlog_set_encr_chat_date (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_encr_cha
t_state
(
void
*
extra
)
{
int
fetch_comb_binlog_
encr_chat_se
t_state
(
void
*
extra
)
{
peer_id_t
id
=
MK_ENCR_CHAT
(
fetch_int
());
peer_t
*
U
=
user_chat_get
(
id
);
assert
(
U
);
...
...
@@ -483,7 +483,7 @@ int fetch_comb_binlog_encr_chat_accepted (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_encr_cha
t_key
(
void
*
extra
)
{
int
fetch_comb_binlog_
encr_chat_se
t_key
(
void
*
extra
)
{
peer_id_t
id
=
MK_ENCR_CHAT
(
fetch_int
());
peer_t
*
_U
=
user_chat_get
(
id
);
assert
(
_U
);
...
...
@@ -560,7 +560,7 @@ int fetch_comb_binlog_chat_change_flags (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_cha
t_title
(
void
*
extra
)
{
int
fetch_comb_binlog_
chat_se
t_title
(
void
*
extra
)
{
peer_t
*
C
=
user_chat_get
(
MK_CHAT
(
fetch_int
()));
assert
(
C
&&
(
C
->
flags
&
FLAG_CREATED
));
...
...
@@ -579,7 +579,7 @@ int fetch_comb_binlog_set_chat_title (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_cha
t_photo
(
void
*
extra
)
{
int
fetch_comb_binlog_
chat_se
t_photo
(
void
*
extra
)
{
peer_t
*
C
=
user_chat_get
(
MK_CHAT
(
fetch_int
()));
assert
(
C
&&
(
C
->
flags
&
FLAG_CREATED
));
fetch_data
(
&
C
->
photo_big
,
sizeof
(
struct
file_location
));
...
...
@@ -591,7 +591,7 @@ int fetch_comb_binlog_set_chat_photo (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_cha
t_date
(
void
*
extra
)
{
int
fetch_comb_binlog_
chat_se
t_date
(
void
*
extra
)
{
peer_t
*
C
=
user_chat_get
(
MK_CHAT
(
fetch_int
()));
assert
(
C
&&
(
C
->
flags
&
FLAG_CREATED
));
C
->
chat
.
date
=
fetch_int
();
...
...
@@ -602,7 +602,7 @@ int fetch_comb_binlog_set_chat_date (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_cha
t_version
(
void
*
extra
)
{
int
fetch_comb_binlog_
chat_se
t_version
(
void
*
extra
)
{
peer_t
*
C
=
user_chat_get
(
MK_CHAT
(
fetch_int
()));
assert
(
C
&&
(
C
->
flags
&
FLAG_CREATED
));
C
->
chat
.
version
=
fetch_int
();
...
...
@@ -614,7 +614,7 @@ int fetch_comb_binlog_set_chat_version (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_cha
t_admin
(
void
*
extra
)
{
int
fetch_comb_binlog_
chat_se
t_admin
(
void
*
extra
)
{
peer_t
*
C
=
user_chat_get
(
MK_CHAT
(
fetch_int
()));
assert
(
C
&&
(
C
->
flags
&
FLAG_CREATED
));
C
->
chat
.
admin_id
=
fetch_int
();
...
...
@@ -625,7 +625,7 @@ int fetch_comb_binlog_set_chat_admin (void *extra) {
return
0
;
}
int
fetch_comb_binlog_
set_cha
t_participants
(
void
*
extra
)
{
int
fetch_comb_binlog_
chat_se
t_participants
(
void
*
extra
)
{
peer_t
*
C
=
user_chat_get
(
MK_CHAT
(
fetch_int
()));
assert
(
C
&&
(
C
->
flags
&
FLAG_CREATED
));
C
->
chat
.
user_list_version
=
fetch_int
();
...
...
@@ -640,7 +640,7 @@ int fetch_comb_binlog_set_chat_participants (void *extra) {
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
()));
assert
(
C
&&
(
C
->
flags
&
FLAG_CREATED
));
...
...
@@ -656,7 +656,7 @@ int fetch_comb_binlog_chat_full_photo (void *extra) {
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_t
*
_C
=
user_chat_get
(
id
);
assert
(
_C
&&
(
_C
->
flags
&
FLAG_CREATED
));
...
...
@@ -686,7 +686,7 @@ int fetch_comb_binlog_add_chat_participant (void *extra) {
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_t
*
_C
=
user_chat_get
(
id
);
assert
(
_C
&&
(
_C
->
flags
&
FLAG_CREATED
));
...
...
@@ -1166,24 +1166,24 @@ void replay_log_event (void) {
FETCH_COMBINATOR_FUNCTION
(
binlog_user_set_real_name
)
FETCH_COMBINATOR_FUNCTION
(
binlog_encr_chat_delete
)
FETCH_COMBINATOR_FUNCTION
(
binlog_encr_chat_requested
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_encr_cha
t_access_hash
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_encr_cha
t_date
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_encr_cha
t_state
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
encr_chat_se
t_access_hash
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
encr_chat_se
t_date
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
encr_chat_se
t_state
)
FETCH_COMBINATOR_FUNCTION
(
binlog_encr_chat_accepted
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_encr_cha
t_key
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
encr_chat_se
t_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_cha
t_title
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_cha
t_photo
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_cha
t_date
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_cha
t_version
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_cha
t_admin
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
set_cha
t_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_
chat_se
t_title
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
chat_se
t_photo
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
chat_se
t_date
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
chat_se
t_version
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
chat_se
t_admin
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
chat_se
t_participants
)
FETCH_COMBINATOR_FUNCTION
(
binlog_chat_
set_
full_photo
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
chat_add
_participant
)
FETCH_COMBINATOR_FUNCTION
(
binlog_
chat_del
_participant
)
FETCH_COMBINATOR_FUNCTION
(
binlog_create_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
add_log_event
(
ev
,
540
);
}
void
bl_do_
set_encr_cha
t_access_hash
(
struct
secret_chat
*
U
,
long
long
access_hash
)
{
void
bl_do_
encr_chat_se
t_access_hash
(
struct
secret_chat
*
U
,
long
long
access_hash
)
{
if
(
U
->
access_hash
==
access_hash
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
16
);
ev
[
0
]
=
CODE_binlog_
set_encr_cha
t_access_hash
;
ev
[
0
]
=
CODE_binlog_
encr_chat_se
t_access_hash
;
ev
[
1
]
=
get_peer_id
(
U
->
id
);
*
(
long
long
*
)(
ev
+
2
)
=
access_hash
;
add_log_event
(
ev
,
16
);
}
void
bl_do_
set_encr_cha
t_date
(
struct
secret_chat
*
U
,
int
date
)
{
void
bl_do_
encr_chat_se
t_date
(
struct
secret_chat
*
U
,
int
date
)
{
if
(
U
->
date
==
date
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
12
);
ev
[
0
]
=
CODE_binlog_
set_encr_cha
t_date
;
ev
[
0
]
=
CODE_binlog_
encr_chat_se
t_date
;
ev
[
1
]
=
get_peer_id
(
U
->
id
);
ev
[
2
]
=
date
;
add_log_event
(
ev
,
12
);
}
void
bl_do_
set_encr_cha
t_state
(
struct
secret_chat
*
U
,
enum
secret_chat_state
state
)
{
void
bl_do_
encr_chat_se
t_state
(
struct
secret_chat
*
U
,
enum
secret_chat_state
state
)
{
if
(
U
->
state
==
state
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
12
);
ev
[
0
]
=
CODE_binlog_
set_encr_cha
t_state
;
ev
[
0
]
=
CODE_binlog_
encr_chat_se
t_state
;
ev
[
1
]
=
get_peer_id
(
U
->
id
);
ev
[
2
]
=
state
;
add_log_event
(
ev
,
12
);
...
...
@@ -1551,9 +1551,9 @@ void bl_do_encr_chat_accepted (struct secret_chat *U, const unsigned char g_key[
add_log_event
(
ev
,
528
);
}
void
bl_do_
set_encr_cha
t_key
(
struct
secret_chat
*
E
,
unsigned
char
key
[],
long
long
key_fingerprint
)
{
void
bl_do_
encr_chat_se
t_key
(
struct
secret_chat
*
E
,
unsigned
char
key
[],
long
long
key_fingerprint
)
{
int
*
ev
=
alloc_log_event
(
272
);
ev
[
0
]
=
CODE_binlog_
set_encr_cha
t_key
;
ev
[
0
]
=
CODE_binlog_
encr_chat_se
t_key
;
ev
[
1
]
=
get_peer_id
(
E
->
id
);
memcpy
(
ev
+
2
,
key
,
256
);
*
(
long
long
*
)(
ev
+
66
)
=
key_fingerprint
;
...
...
@@ -1641,36 +1641,36 @@ void bl_do_chat_forbid (struct chat *C, int on) {
}
}
void
bl_do_
set_cha
t_title
(
struct
chat
*
C
,
const
char
*
s
,
int
l
)
{
void
bl_do_
chat_se
t_title
(
struct
chat
*
C
,
const
char
*
s
,
int
l
)
{
if
(
C
->
title
&&
(
int
)
strlen
(
C
->
title
)
==
l
&&
!
strncmp
(
C
->
title
,
s
,
l
))
{
return
;
}
clear_packet
();
out_int
(
CODE_binlog_
set_cha
t_title
);
out_int
(
CODE_binlog_
chat_se
t_title
);
out_int
(
get_peer_id
(
C
->
id
));
out_cstring
(
s
,
l
);
add_log_event
(
packet_buffer
,
4
*
(
packet_ptr
-
packet_buffer
));
}
void
bl_do_
set_cha
t_photo
(
struct
chat
*
C
,
struct
file_location
*
big
,
struct
file_location
*
small
)
{
void
bl_do_
chat_se
t_photo
(
struct
chat
*
C
,
struct
file_location
*
big
,
struct
file_location
*
small
)
{
if
(
!
memcmp
(
&
C
->
photo_small
,
small
,
sizeof
(
struct
file_location
))
&&
!
memcmp
(
&
C
->
photo_big
,
big
,
sizeof
(
struct
file_location
)))
{
return
;
}
clear_packet
();
out_int
(
CODE_binlog_
set_cha
t_photo
);
out_int
(
CODE_binlog_
chat_se
t_photo
);
out_int
(
get_peer_id
(
C
->
id
));
out_data
(
big
,
sizeof
(
struct
file_location
));
out_data
(
small
,
sizeof
(
struct
file_location
));
add_log_event
(
packet_buffer
,
4
*
(
packet_ptr
-
packet_buffer
));
}
void
bl_do_
set_cha
t_date
(
struct
chat
*
C
,
int
date
)
{
void
bl_do_
chat_se
t_date
(
struct
chat
*
C
,
int
date
)
{
if
(
C
->
date
==
date
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
12
);
ev
[
0
]
=
CODE_binlog_
set_cha
t_date
;
ev
[
0
]
=
CODE_binlog_
chat_se
t_date
;
ev
[
1
]
=
get_peer_id
(
C
->
id
);
ev
[
2
]
=
date
;
add_log_event
(
ev
,
12
);
}
void
bl_do_
set_cha
t_set_in_chat
(
struct
chat
*
C
,
int
on
)
{
void
bl_do_
chat_se
t_set_in_chat
(
struct
chat
*
C
,
int
on
)
{
if
(
on
)
{
if
(
C
->
flags
&
FLAG_CHAT_IN_CHAT
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
16
);
...
...
@@ -1690,29 +1690,29 @@ void bl_do_set_chat_set_in_chat (struct chat *C, int on) {
}
}
void
bl_do_
set_cha
t_version
(
struct
chat
*
C
,
int
version
,
int
user_num
)
{
void
bl_do_
chat_se
t_version
(
struct
chat
*
C
,
int
version
,
int
user_num
)
{
if
(
C
->
version
>=
version
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
16
);
ev
[
0
]
=
CODE_binlog_
set_cha
t_version
;
ev
[
0
]
=
CODE_binlog_
chat_se
t_version
;
ev
[
1
]
=
get_peer_id
(
C
->
id
);
ev
[
2
]
=
version
;
ev
[
3
]
=
user_num
;
add_log_event
(
ev
,
16
);
}
void
bl_do_
set_cha
t_admin
(
struct
chat
*
C
,
int
admin
)
{
void
bl_do_
chat_se
t_admin
(
struct
chat
*
C
,
int
admin
)
{
if
(
C
->
admin_id
==
admin
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
12
);
ev
[
0
]
=
CODE_binlog_
set_cha
t_admin
;
ev
[
0
]
=
CODE_binlog_
chat_se
t_admin
;
ev
[
1
]
=
get_peer_id
(
C
->
id
);
ev
[
2
]
=
admin
;
add_log_event
(
ev
,
12
);
}
void
bl_do_
set_cha
t_participants
(
struct
chat
*
C
,
int
version
,
int
user_num
,
struct
chat_user
*
users
)
{
void
bl_do_
chat_se
t_participants
(
struct
chat
*
C
,
int
version
,
int
user_num
,
struct
chat_user
*
users
)
{
if
(
C
->
user_list_version
>=
version
)
{
return
;
}
int
*
ev
=
alloc_log_event
(
12
*
user_num
+
16
);
ev
[
0
]
=
CODE_binlog_
set_cha
t_participants
;
ev
[
0
]
=
CODE_binlog_
chat_se
t_participants
;
ev
[
1
]
=
get_peer_id
(
C
->
id
);
ev
[
2
]
=
version
;
ev
[
3
]
=
user_num
;
...
...
@@ -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
);
}
void
bl_do_
set_cha
t_full_photo
(
struct
chat
*
U
,
const
int
*
start
,
int
len
)
{
void
bl_do_
chat_se
t_full_photo
(
struct
chat
*
U
,
const
int
*
start
,
int
len
)
{
if
(
U
->
photo
.
id
==
*
(
long
long
*
)(
start
+
1
))
{
return
;
}
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
);
memcpy
(
ev
+
2
,
start
,
len
);
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) {
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
;
}
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
[
2
]
=
version
;
ev
[
3
]
=
user
;
...
...
@@ -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
)
{
if
(
C
->
user_list_version
>=
version
||
!
C
->
user_list_version
)
{
return
;
}
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
[
2
]
=
version
;
ev
[
3
]
=
user
;
...
...
binlog.h
View file @
8dd17ec6
...
...
@@ -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_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_cha
t_access_hash
(
struct
secret_chat
*
U
,
long
long
access_hash
);
void
bl_do_
set_encr_cha
t_date
(
struct
secret_chat
*
U
,
int
date
);
void
bl_do_
set_encr_cha
t_state
(
struct
secret_chat
*
U
,
enum
secret_chat_state
state
);
void
bl_do_
encr_chat_se
t_access_hash
(
struct
secret_chat
*
U
,
long
long
access_hash
);
void
bl_do_
encr_chat_se
t_date
(
struct
secret_chat
*
U
,
int
date
);
void
bl_do_
encr_chat_se
t_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_
set_encr_cha
t_key
(
struct
secret_chat
*
E
,
unsigned
char
key
[],
long
long
key_fingerprint
);
void
bl_do_
encr_chat_se
t_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_dc_signed
(
int
id
);
...
...
@@ -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_chat_forbid
(
struct
chat
*
C
,
int
on
);
void
bl_do_
set_cha
t_title
(
struct
chat
*
C
,
const
char
*
s
,
int
l
);
void
bl_do_
set_cha
t_photo
(
struct
chat
*
C
,
struct
file_location
*
big
,
struct
file_location
*
small
);
void
bl_do_
set_cha
t_date
(
struct
chat
*
C
,
int
date
);
void
bl_do_
set_cha
t_set_in_chat
(
struct
chat
*
C
,
int
on
);
void
bl_do_
set_cha
t_version
(
struct
chat
*
C
,
int
version
,
int
user_num
);
void
bl_do_
set_cha
t_admin
(
struct
chat
*
C
,
int
admin
);
void
bl_do_
set_cha
t_participants
(
struct
chat
*
C
,
int
version
,
int
user_num
,
struct
chat_user
*
users
);
void
bl_do_
set_cha
t_full_photo
(
struct
chat
*
U
,
const
int
*
start
,
int
len
);
void
bl_do_
chat_se
t_title
(
struct
chat
*
C
,
const
char
*
s
,
int
l
);
void
bl_do_
chat_se
t_photo
(
struct
chat
*
C
,
struct
file_location
*
big
,
struct
file_location
*
small
);
void
bl_do_
chat_se
t_date
(
struct
chat
*
C
,
int
date
);
void
bl_do_
chat_se
t_set_in_chat
(
struct
chat
*
C
,
int
on
);
void
bl_do_
chat_se
t_version
(
struct
chat
*
C
,
int
version
,
int
user_num
);
void
bl_do_
chat_se
t_admin
(
struct
chat
*
C
,
int
admin
);
void
bl_do_
chat_se
t_participants
(
struct
chat
*
C
,
int
version
,
int
user_num
,
struct
chat_user
*
users
);
void
bl_do_
chat_se
t_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_del_user
(
struct
chat
*
C
,
int
version
,
int
user
);
...
...
binlog.tl
View file @
8dd17ec6
...
...
@@ -30,24 +30,25 @@ binlog.userSetPhoto id:int photo:UserProfilePhoto = 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.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.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.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.chatChangeFlags id:int set_flags:int clear_flags:int = binlog.Update;
binlog.
setCha
tTitle id:int title:string = binlog.Update;
binlog.
setCha
tPhoto id:int photo_big:%binlog.FileLocation photo_small:%binlog.FileLocation = binlog.Update;
binlog.
setCha
tDate id:int date:int = binlog.Update;
binlog.
setCha
tVersion id:int version:int users_num:int = binlog.Update;
binlog.
setCha
tAdmin id:int admin:int = binlog.Update;
binlog.
setCha
tParticipants id:int version:int participants:%(Vector %binlog.ChatParticipant) = binlog.Update;
binlog.chatFullPhoto id:int photo:Photo = binlog.Update;
binlog.
addChat
Participant id:int version:int user:%binlog.ChatParticipant = binlog.Update;
binlog.
delChat
Participant id:int version:int user:int = binlog.Update;
binlog.
chatSe
tTitle id:int title:string = binlog.Update;
binlog.
chatSe
tPhoto id:int photo_big:%binlog.FileLocation photo_small:%binlog.FileLocation = binlog.Update;
binlog.
chatSe
tDate id:int date:int = binlog.Update;
binlog.
chatSe
tVersion id:int version:int users_num:int = binlog.Update;
binlog.
chatSe
tAdmin id:int admin:int = binlog.Update;
binlog.
chatSe
tParticipants id:int version:int participants:%(Vector %binlog.ChatParticipant) = binlog.Update;
binlog.chat
Set
FullPhoto id:int photo:Photo = binlog.Update;
binlog.
chatAdd
Participant id:int version:int user:%binlog.ChatParticipant = binlog.Update;
binlog.
chatDel
Participant 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;
...
...
mtproto-client.c
View file @
8dd17ec6
...
...
@@ -1119,7 +1119,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
peer_t
*
C
=
user_chat_get
(
chat_id
);
if
(
C
&&
(
C
->
flags
&
FLAG_CREATED
))
{
if
(
x
==
CODE_chat_participants
)
{
bl_do_
set_cha
t_admin
(
&
C
->
chat
,
fetch_int
());
bl_do_
chat_se
t_admin
(
&
C
->
chat
,
fetch_int
());
assert
(
fetch_int
()
==
CODE_vector
);
n
=
fetch_int
();
struct
chat_user
*
users
=
talloc
(
12
*
n
);
...
...
@@ -1131,7 +1131,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
users
[
i
].
date
=
fetch_int
();
}
int
version
=
fetch_int
();
bl_do_
set_cha
t_participants
(
&
C
->
chat
,
version
,
n
,
users
);
bl_do_
chat_se
t_participants
(
&
C
->
chat
,
version
,
n
,
users
);
}
}
else
{
if
(
x
==
CODE_chat_participants
)
{
...
...
queries.c
View file @
8dd17ec6
...
...
@@ -2389,7 +2389,7 @@ void do_send_accept_encr_chat (struct secret_chat *E, unsigned char *random) {
static
unsigned
char
sha_buffer
[
20
];
sha1
(
kk
,
256
,
sha_buffer
);
bl_do_
set_encr_cha
t_key
(
E
,
kk
,
*
(
long
long
*
)(
sha_buffer
+
12
));
bl_do_
encr_chat_se
t_key
(
E
,
kk
,
*
(
long
long
*
)(
sha_buffer
+
12
));
clear_packet
();
out_int
(
CODE_messages_accept_encryption
);
...
...
structures.c
View file @
8dd17ec6
...
...
@@ -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
);
write_secret_chat_file
();
}
else
{
bl_do_
set_encr_cha
t_access_hash
(
U
,
fetch_long
());
bl_do_
set_encr_cha
t_date
(
U
,
fetch_int
());
bl_do_
encr_chat_se
t_access_hash
(
U
,
fetch_long
());
bl_do_
encr_chat_se
t_date
(
U
,
fetch_int
());
if
(
fetch_int
()
!=
U
->
admin_id
)
{
logprintf
(
"Changed admin in secret chat. WTF?
\n
"
);
return
;
...
...
@@ -318,7 +318,7 @@ void fetch_encrypted_chat (struct secret_chat *U) {
return
;
}
if
(
x
==
CODE_encrypted_chat_waiting
)
{
bl_do_
set_encr_cha
t_state
(
U
,
sc_waiting
);
bl_do_
encr_chat_se
t_state
(
U
,
sc_waiting
);
write_secret_chat_file
();
return
;
// We needed only access hash from here
}
...
...
@@ -413,7 +413,7 @@ void fetch_chat (struct chat *C) {
}
int
l
=
prefetch_strlen
();
char
*
s
=
fetch_str
(
l
);
bl_do_
set_cha
t_title
(
C
,
s
,
l
);
bl_do_
chat_se
t_title
(
C
,
s
,
l
);
struct
file_location
small
;
struct
file_location
big
;
...
...
@@ -430,13 +430,13 @@ void fetch_chat (struct chat *C) {
fetch_file_location
(
&
small
);
fetch_file_location
(
&
big
);
}
bl_do_
set_cha
t_photo
(
C
,
&
big
,
&
small
);
bl_do_
chat_se
t_photo
(
C
,
&
big
,
&
small
);
int
users_num
=
fetch_int
();
bl_do_
set_cha
t_date
(
C
,
fetch_int
());
bl_do_
set_cha
t_set_in_chat
(
C
,
fetch_bool
());
bl_do_
set_cha
t_version
(
C
,
users_num
,
fetch_int
());
bl_do_
chat_se
t_date
(
C
,
fetch_int
());
bl_do_
chat_se
t_set_in_chat
(
C
,
fetch_bool
());
bl_do_
chat_se
t_version
(
C
,
users_num
,
fetch_int
());
}
else
{
bl_do_
set_cha
t_date
(
C
,
fetch_int
());
bl_do_
chat_se
t_date
(
C
,
fetch_int
());
}
}
}
...
...
@@ -486,13 +486,13 @@ void fetch_chat_full (struct chat *C) {
fetch_alloc_user
();
}
if
(
admin_id
)
{
bl_do_
set_cha
t_admin
(
C
,
admin_id
);
bl_do_
chat_se
t_admin
(
C
,
admin_id
);
}
if
(
version
>
0
)
{
bl_do_
set_cha
t_participants
(
C
,
version
,
users_num
,
users
);
bl_do_
chat_se
t_participants
(
C
,
version
,
users_num
,
users
);
tfree
(
users
,
sizeof
(
struct
chat_user
)
*
users_num
);
}
bl_do_
set_cha
t_full_photo
(
C
,
start
,
4
*
(
end
-
start
));
bl_do_
chat_se
t_full_photo
(
C
,
start
,
4
*
(
end
-
start
));
}
void
fetch_photo_size
(
struct
photo_size
*
S
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment