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
Expand all
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
This diff is collapsed.
Click to expand it.
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