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
725c6669
Commit
725c6669
authored
Nov 30, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manty fixes. Mostly binlog for messages
parent
d095e607
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1038 additions
and
235 deletions
+1038
-235
binlog.c
binlog.c
+463
-3
binlog.h
binlog.h
+25
-0
interface.c
interface.c
+2
-1
loop.c
loop.c
+5
-0
mtproto-client.c
mtproto-client.c
+3
-3
mtproto-common.h
mtproto-common.h
+1
-1
queries.c
queries.c
+52
-63
queries.h
queries.h
+1
-0
structures.c
structures.c
+469
-162
structures.h
structures.h
+15
-0
telegram.h
telegram.h
+2
-2
No files found.
binlog.c
View file @
725c6669
This diff is collapsed.
Click to expand it.
binlog.h
View file @
725c6669
...
@@ -51,6 +51,18 @@
...
@@ -51,6 +51,18 @@
#define CODE_binlog_chat_full_photo 0x6cca6629
#define CODE_binlog_chat_full_photo 0x6cca6629
#define CODE_binlog_add_chat_participant 0x63345108
#define CODE_binlog_add_chat_participant 0x63345108
#define CODE_binlog_del_chat_participant 0x82d1f0ee
#define CODE_binlog_del_chat_participant 0x82d1f0ee
#define CODE_binlog_create_message_text 0x269acd5b
#define CODE_binlog_create_message_text_fwd 0xa3d864cd
#define CODE_binlog_create_message_service 0xbbe5e94b
#define CODE_binlog_create_message_service_fwd 0xea9c57ae
#define CODE_binlog_create_message_media 0x62a92d19
#define CODE_binlog_create_message_media_fwd 0xbefdc462
#define CODE_binlog_send_message_text 0x31cfd652
#define CODE_binlog_set_unread 0x21d4c909
#define CODE_binlog_set_message_sent 0xc335282b
#define CODE_binlog_set_msg_id 0xf3285b6a
#define CODE_binlog_create_message_media_encr 0x19cd7c9d
#define CODE_binlog_create_message_service_encr 0x8b4b9395
void
*
alloc_log_event
(
int
l
);
void
*
alloc_log_event
(
int
l
);
void
replay_log
(
void
);
void
replay_log
(
void
);
...
@@ -102,4 +114,17 @@ void bl_do_set_chat_participants (struct chat *C, int version, int user_num, str
...
@@ -102,4 +114,17 @@ void bl_do_set_chat_participants (struct chat *C, int version, int user_num, str
void
bl_do_set_chat_full_photo
(
struct
chat
*
U
,
const
int
*
start
,
int
len
);
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
);
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
);
void
bl_do_chat_del_user
(
struct
chat
*
C
,
int
version
,
int
user
);
void
bl_do_create_message_text
(
int
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
int
l
,
const
char
*
s
);
void
bl_do_create_message_text_fwd
(
int
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
int
fwd
,
int
fwd_date
,
int
l
,
const
char
*
s
);
void
bl_do_create_message_service
(
int
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
const
int
*
data
,
int
len
);
void
bl_do_create_message_service_fwd
(
int
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
int
fwd
,
int
fwd_date
,
const
int
*
data
,
int
len
);
void
bl_do_create_message_media
(
int
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
int
l
,
const
char
*
s
,
const
int
*
data
,
int
len
);
void
bl_do_create_message_media_fwd
(
int
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
int
fwd
,
int
fwd_date
,
int
l
,
const
char
*
s
,
const
int
*
data
,
int
len
);
void
bl_do_create_message_media_encr
(
long
long
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
int
l
,
const
char
*
s
,
const
int
*
data
,
int
len
,
const
int
*
data2
,
int
len2
);
void
bl_do_create_message_service_encr
(
long
long
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
const
int
*
data
,
int
len
);
void
bl_do_send_message_text
(
long
long
msg_id
,
int
from_id
,
int
to_type
,
int
to_id
,
int
date
,
int
l
,
const
char
*
s
);
void
bl_do_set_unread
(
struct
message
*
M
,
int
unread
);
void
bl_do_set_message_sent
(
struct
message
*
M
);
void
bl_do_set_msg_id
(
struct
message
*
M
,
int
id
);
#endif
#endif
interface.c
View file @
725c6669
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
#include "mtproto-common.h"
#include "mtproto-common.h"
//
#define ALLOW_MULT 1
#define ALLOW_MULT 1
char
*
default_prompt
=
"> "
;
char
*
default_prompt
=
"> "
;
int
unread_messages
;
int
unread_messages
;
...
@@ -1096,6 +1096,7 @@ void pop_color (void) {
...
@@ -1096,6 +1096,7 @@ void pop_color (void) {
void
print_media
(
struct
message_media
*
M
)
{
void
print_media
(
struct
message_media
*
M
)
{
switch
(
M
->
type
)
{
switch
(
M
->
type
)
{
case
CODE_message_media_empty
:
case
CODE_message_media_empty
:
case
CODE_decrypted_message_media_empty
:
return
;
return
;
case
CODE_message_media_photo
:
case
CODE_message_media_photo
:
if
(
M
->
photo
.
caption
&&
strlen
(
M
->
photo
.
caption
))
{
if
(
M
->
photo
.
caption
&&
strlen
(
M
->
photo
.
caption
))
{
...
...
loop.c
View file @
725c6669
...
@@ -436,7 +436,10 @@ int new_dc_num;
...
@@ -436,7 +436,10 @@ int new_dc_num;
int
loop
(
void
)
{
int
loop
(
void
)
{
on_start
();
on_start
();
if
(
binlog_enabled
)
{
if
(
binlog_enabled
)
{
double
t
=
get_double_time
();
logprintf
(
"replay log start
\n
"
);
replay_log
();
replay_log
();
logprintf
(
"replay log end in %lf seconds
\n
"
,
get_double_time
()
-
t
);
write_binlog
();
write_binlog
();
}
else
{
}
else
{
read_auth_file
();
read_auth_file
();
...
@@ -571,6 +574,8 @@ int loop (void) {
...
@@ -571,6 +574,8 @@ int loop (void) {
do_get_difference
();
do_get_difference
();
net_loop
(
0
,
dgot
);
net_loop
(
0
,
dgot
);
send_all_unsent
();
do_get_dialog_list
();
do_get_dialog_list
();
return
main_loop
();
return
main_loop
();
...
...
mtproto-client.c
View file @
725c6669
...
@@ -789,7 +789,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
...
@@ -789,7 +789,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
int
new
=
fetch_long
();
// random_id
int
new
=
fetch_long
();
// random_id
struct
message
*
M
=
message_get
(
new
);
struct
message
*
M
=
message_get
(
new
);
if
(
M
)
{
if
(
M
)
{
update_message
_id
(
M
,
id
);
bl_do_set_msg
_id
(
M
,
id
);
}
}
}
}
break
;
break
;
...
@@ -802,7 +802,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
...
@@ -802,7 +802,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
int
id
=
fetch_int
();
int
id
=
fetch_int
();
struct
message
*
M
=
message_get
(
id
);
struct
message
*
M
=
message_get
(
id
);
if
(
M
)
{
if
(
M
)
{
M
->
unread
=
0
;
bl_do_set_unread
(
M
,
0
)
;
}
}
}
}
fetch_pts
();
fetch_pts
();
...
@@ -885,7 +885,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
...
@@ -885,7 +885,7 @@ void work_update (struct connection *c UU, long long msg_id UU) {
int
l2
=
prefetch_strlen
();
int
l2
=
prefetch_strlen
();
char
*
l
=
fetch_str
(
l2
);
char
*
l
=
fetch_str
(
l2
);
struct
user
*
U
=
&
UC
->
user
;
struct
user
*
U
=
&
UC
->
user
;
bl_do_set_user_name
(
U
,
f
,
l1
,
l
,
l2
);
bl_do_set_user_
real_
name
(
U
,
f
,
l1
,
l
,
l2
);
print_start
();
print_start
();
push_color
(
COLOR_YELLOW
);
push_color
(
COLOR_YELLOW
);
print_date
(
time
(
0
));
print_date
(
time
(
0
));
...
...
mtproto-common.h
View file @
725c6669
...
@@ -226,7 +226,7 @@ long long compute_rsa_key_fingerprint (RSA *key);
...
@@ -226,7 +226,7 @@ long long compute_rsa_key_fingerprint (RSA *key);
extern
int
*
packet_buffer
;
extern
int
*
packet_buffer
;
extern
int
*
packet_ptr
;
extern
int
*
packet_ptr
;
static
inline
void
out_ints
(
int
*
what
,
int
len
)
{
static
inline
void
out_ints
(
const
int
*
what
,
int
len
)
{
assert
(
packet_ptr
+
len
<=
packet_buffer
+
PACKET_BUFFER_SIZE
);
assert
(
packet_ptr
+
len
<=
packet_buffer
+
PACKET_BUFFER_SIZE
);
memcpy
(
packet_ptr
,
what
,
len
*
4
);
memcpy
(
packet_ptr
,
what
,
len
*
4
);
packet_ptr
+=
len
;
packet_ptr
+=
len
;
...
...
queries.c
View file @
725c6669
...
@@ -779,8 +779,9 @@ int msg_send_encr_on_answer (struct query *q UU) {
...
@@ -779,8 +779,9 @@ int msg_send_encr_on_answer (struct query *q UU) {
assert
(
fetch_int
()
==
CODE_messages_sent_encrypted_message
);
assert
(
fetch_int
()
==
CODE_messages_sent_encrypted_message
);
rprintf
(
"Sent
\n
"
);
rprintf
(
"Sent
\n
"
);
struct
message
*
M
=
q
->
extra
;
struct
message
*
M
=
q
->
extra
;
M
->
date
=
fetch_int
();
//M->date = fetch_int ();
message_insert
(
M
);
fetch_int
();
bl_do_set_message_sent
(
M
);
return
0
;
return
0
;
}
}
...
@@ -788,12 +789,11 @@ int msg_send_on_answer (struct query *q UU) {
...
@@ -788,12 +789,11 @@ int msg_send_on_answer (struct query *q UU) {
unsigned
x
=
fetch_int
();
unsigned
x
=
fetch_int
();
assert
(
x
==
CODE_messages_sent_message
||
x
==
CODE_messages_sent_message_link
);
assert
(
x
==
CODE_messages_sent_message
||
x
==
CODE_messages_sent_message_link
);
int
id
=
fetch_int
();
// id
int
id
=
fetch_int
();
// id
struct
message
*
M
=
q
->
extra
;
bl_do_set_msg_id
(
M
,
id
);
fetch_date
();
fetch_date
();
fetch_pts
();
fetch_pts
();
fetch_seq
();
fetch_seq
();
struct
message
*
M
=
q
->
extra
;
M
->
id
=
id
;
message_insert
(
M
);
if
(
x
==
CODE_messages_sent_message_link
)
{
if
(
x
==
CODE_messages_sent_message_link
)
{
assert
(
fetch_int
()
==
CODE_vector
);
assert
(
fetch_int
()
==
CODE_vector
);
int
n
=
fetch_int
();
int
n
=
fetch_int
();
...
@@ -834,6 +834,7 @@ int msg_send_on_answer (struct query *q UU) {
...
@@ -834,6 +834,7 @@ int msg_send_on_answer (struct query *q UU) {
}
}
}
}
rprintf
(
"Sent: id = %d
\n
"
,
id
);
rprintf
(
"Sent: id = %d
\n
"
,
id
);
bl_do_set_message_sent
(
M
);
return
0
;
return
0
;
}
}
...
@@ -848,86 +849,62 @@ struct query_methods msg_send_encr_methods = {
...
@@ -848,86 +849,62 @@ struct query_methods msg_send_encr_methods = {
int
out_message_num
;
int
out_message_num
;
int
our_id
;
int
our_id
;
void
do_send_encr_message
(
peer_id_t
id
,
const
char
*
msg
,
int
len
)
{
void
do_send_encr_msg
(
struct
message
*
M
)
{
peer_t
*
P
=
user_chat_get
(
id
);
peer_t
*
P
=
user_chat_get
(
M
->
to_id
);
if
(
!
P
)
{
if
(
!
P
||
P
->
encr_chat
.
state
!=
sc_ok
)
{
return
;
}
logprintf
(
"Can not send to unknown encrypted chat
\n
"
);
return
;
}
if
(
P
->
encr_chat
.
state
!=
sc_ok
)
{
logprintf
(
"Chat is not yet initialized
\n
"
);
return
;
}
clear_packet
();
clear_packet
();
out_int
(
CODE_messages_send_encrypted
);
out_int
(
CODE_messages_send_encrypted
);
out_int
(
CODE_input_encrypted_chat
);
out_int
(
CODE_input_encrypted_chat
);
out_int
(
get_peer_id
(
id
));
out_int
(
get_peer_id
(
M
->
to_
id
));
out_long
(
P
->
encr_chat
.
access_hash
);
out_long
(
P
->
encr_chat
.
access_hash
);
if
(
!
out_message_num
)
{
out_long
(
M
->
id
);
out_message_num
=
-
lrand48
();
}
out_long
((
--
out_message_num
)
-
(
4ll
<<
32
));
encr_start
();
encr_start
();
//out_int (CODE_decrypted_message_layer);
//out_int (8);
out_int
(
CODE_decrypted_message
);
out_int
(
CODE_decrypted_message
);
out_long
(
(
out_message_num
)
-
(
4ll
<<
32
)
);
out_long
(
M
->
id
);
static
int
buf
[
4
];
static
int
buf
[
4
];
int
i
;
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
buf
[
i
]
=
mrand48
();
buf
[
i
]
=
mrand48
();
}
}
out_cstring
((
void
*
)
buf
,
16
);
out_cstring
((
void
*
)
buf
,
16
);
out_cstring
((
void
*
)
msg
,
len
);
out_cstring
((
void
*
)
M
->
message
,
M
->
message_
len
);
out_int
(
CODE_decrypted_message_media_empty
);
out_int
(
CODE_decrypted_message_media_empty
);
encr_finish
(
&
P
->
encr_chat
);
encr_finish
(
&
P
->
encr_chat
);
struct
message
*
M
=
malloc
(
sizeof
(
*
M
));
memset
(
M
,
0
,
sizeof
(
*
M
));
M
->
flags
=
FLAG_ENCRYPTED
;
M
->
from_id
=
MK_USER
(
our_id
);
M
->
to_id
=
id
;
M
->
unread
=
1
;
M
->
message
=
malloc
(
len
+
1
);
memcpy
(
M
->
message
,
msg
,
len
);
M
->
message
[
len
]
=
0
;
M
->
message_len
=
len
;
M
->
out
=
1
;
M
->
media
.
type
=
CODE_message_media_empty
;
M
->
id
=
(
out_message_num
)
-
(
4ll
<<
32
);
M
->
date
=
time
(
0
);
send_query
(
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
msg_send_encr_methods
,
M
);
send_query
(
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
msg_send_encr_methods
,
M
);
print_message
(
M
);
}
}
void
do_send_m
essage
(
peer_id_t
id
,
const
char
*
msg
,
int
len
)
{
void
do_send_m
sg
(
struct
message
*
M
)
{
if
(
get_peer_type
(
id
)
==
PEER_ENCR_CHAT
)
{
if
(
get_peer_type
(
M
->
to_
id
)
==
PEER_ENCR_CHAT
)
{
do_send_encr_m
essage
(
id
,
msg
,
len
);
do_send_encr_m
sg
(
M
);
return
;
return
;
}
}
if
(
!
out_message_num
)
{
out_message_num
=
-
lrand48
();
}
clear_packet
();
clear_packet
();
out_int
(
CODE_messages_send_message
);
out_int
(
CODE_messages_send_message
);
struct
message
*
M
=
malloc
(
sizeof
(
*
M
));
out_peer_id
(
M
->
to_id
);
memset
(
M
,
0
,
sizeof
(
*
M
));
out_cstring
(
M
->
message
,
M
->
message_len
);
M
->
from_id
=
MK_USER
(
our_id
);
out_long
(
M
->
id
);
M
->
to_id
=
id
;
M
->
unread
=
1
;
out_peer_id
(
id
);
M
->
message
=
malloc
(
len
+
1
);
memcpy
(
M
->
message
,
msg
,
len
);
M
->
message
[
len
]
=
0
;
M
->
message_len
=
len
;
M
->
out
=
1
;
M
->
media
.
type
=
CODE_message_media_empty
;
M
->
id
=
out_message_num
;
M
->
date
=
time
(
0
);
out_cstring
(
msg
,
len
);
out_long
((
--
out_message_num
)
-
(
1ll
<<
32
));
send_query
(
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
msg_send_methods
,
M
);
send_query
(
DC_working
,
packet_ptr
-
packet_buffer
,
packet_buffer
,
&
msg_send_methods
,
M
);
}
void
do_send_message
(
peer_id_t
id
,
const
char
*
msg
,
int
len
)
{
if
(
get_peer_type
(
id
)
==
PEER_ENCR_CHAT
)
{
peer_t
*
P
=
user_chat_get
(
id
);
if
(
!
P
)
{
logprintf
(
"Can not send to unknown encrypted chat
\n
"
);
return
;
}
if
(
P
->
encr_chat
.
state
!=
sc_ok
)
{
logprintf
(
"Chat is not yet initialized
\n
"
);
return
;
}
}
long
long
t
=
-
lrand48
()
*
(
1ll
<<
32
)
-
lrand48
();
bl_do_send_message_text
(
t
,
our_id
,
get_peer_type
(
id
),
get_peer_id
(
id
),
time
(
0
),
len
,
msg
);
struct
message
*
M
=
message_get
(
t
);
assert
(
M
);
do_send_msg
(
M
);
print_message
(
M
);
print_message
(
M
);
}
}
/* }}} */
/* }}} */
...
@@ -1070,6 +1047,7 @@ void do_get_local_history (peer_id_t id, int limit) {
...
@@ -1070,6 +1047,7 @@ void do_get_local_history (peer_id_t id, int limit) {
if
(
!
P
||
!
P
->
last
)
{
return
;
}
if
(
!
P
||
!
P
->
last
)
{
return
;
}
struct
message
*
M
=
P
->
last
;
struct
message
*
M
=
P
->
last
;
int
count
=
1
;
int
count
=
1
;
assert
(
!
M
->
prev
);
while
(
count
<
limit
&&
M
->
next
)
{
while
(
count
<
limit
&&
M
->
next
)
{
M
=
M
->
next
;
M
=
M
->
next
;
count
++
;
count
++
;
...
@@ -2296,6 +2274,9 @@ void do_create_keys_end (struct secret_chat *U) {
...
@@ -2296,6 +2274,9 @@ void do_create_keys_end (struct secret_chat *U) {
BN_init
(
r
);
BN_init
(
r
);
BN_mod_exp
(
r
,
g_b
,
a
,
p
,
ctx
);
BN_mod_exp
(
r
,
g_b
,
a
,
p
,
ctx
);
void
*
t
=
malloc
(
256
);
memcpy
(
t
,
U
->
key
,
256
);
memset
(
U
->
key
,
0
,
sizeof
(
U
->
key
));
memset
(
U
->
key
,
0
,
sizeof
(
U
->
key
));
BN_bn2bin
(
r
,
(
void
*
)
U
->
key
);
BN_bn2bin
(
r
,
(
void
*
)
U
->
key
);
int
i
;
int
i
;
...
@@ -2306,7 +2287,15 @@ void do_create_keys_end (struct secret_chat *U) {
...
@@ -2306,7 +2287,15 @@ void do_create_keys_end (struct secret_chat *U) {
static
unsigned
char
sha_buffer
[
20
];
static
unsigned
char
sha_buffer
[
20
];
sha1
((
void
*
)
U
->
key
,
256
,
sha_buffer
);
sha1
((
void
*
)
U
->
key
,
256
,
sha_buffer
);
long
long
k
=
*
(
long
long
*
)(
sha_buffer
+
12
);
long
long
k
=
*
(
long
long
*
)(
sha_buffer
+
12
);
assert
(
k
==
U
->
key_fingerprint
);
if
(
k
!=
U
->
key_fingerprint
)
{
logprintf
(
"version = %d
\n
"
,
encr_param_version
);
hexdump
((
void
*
)
U
->
nonce
,
(
void
*
)(
U
->
nonce
+
256
));
hexdump
((
void
*
)
U
->
g_key
,
(
void
*
)(
U
->
g_key
+
256
));
hexdump
((
void
*
)
U
->
key
,
(
void
*
)(
U
->
key
+
64
));
hexdump
((
void
*
)
t
,
(
void
*
)(
t
+
256
));
logprintf
(
"!!Key fingerprint mismatch
\n
"
);
U
->
state
=
sc_deleted
;
}
BN_clear_free
(
p
);
BN_clear_free
(
p
);
BN_clear_free
(
g_b
);
BN_clear_free
(
g_b
);
...
...
queries.h
View file @
725c6669
...
@@ -107,6 +107,7 @@ void do_add_user_to_chat (peer_id_t chat_id, peer_id_t id, int limit);
...
@@ -107,6 +107,7 @@ void do_add_user_to_chat (peer_id_t chat_id, peer_id_t id, int limit);
void
do_del_user_from_chat
(
peer_id_t
chat_id
,
peer_id_t
id
);
void
do_del_user_from_chat
(
peer_id_t
chat_id
,
peer_id_t
id
);
void
do_update_status
(
int
online
);
void
do_update_status
(
int
online
);
void
do_contacts_search
(
int
limit
,
const
char
*
s
);
void
do_contacts_search
(
int
limit
,
const
char
*
s
);
void
do_send_msg
(
struct
message
*
M
);
// For binlog
// For binlog
...
...
structures.c
View file @
725c6669
This diff is collapsed.
Click to expand it.
structures.h
View file @
725c6669
...
@@ -38,6 +38,7 @@ typedef struct { int type; int id; } peer_id_t;
...
@@ -38,6 +38,7 @@ typedef struct { int type; int id; } peer_id_t;
#define FLAG_CHAT_IN_CHAT 128
#define FLAG_CHAT_IN_CHAT 128
#define FLAG_ENCRYPTED 4096
#define FLAG_ENCRYPTED 4096
#define FLAG_PENDING 8192
struct
file_location
{
struct
file_location
{
int
dc
;
int
dc
;
...
@@ -337,8 +338,16 @@ struct message *fetch_alloc_message_short (void);
...
@@ -337,8 +338,16 @@ struct message *fetch_alloc_message_short (void);
struct
message
*
fetch_alloc_message_short_chat
(
void
);
struct
message
*
fetch_alloc_message_short_chat
(
void
);
struct
message
*
fetch_alloc_encrypted_message
(
void
);
struct
message
*
fetch_alloc_encrypted_message
(
void
);
void
fetch_encrypted_message_file
(
struct
message_media
*
M
);
void
fetch_encrypted_message_file
(
struct
message_media
*
M
);
void
fetch_skip_encrypted_message_file
(
void
);
void
fetch_encrypted_message_file
(
struct
message_media
*
M
);
void
fetch_message_action_encrypted
(
struct
message_action
*
M
);
peer_id_t
fetch_peer_id
(
void
);
peer_id_t
fetch_peer_id
(
void
);
void
fetch_message_media
(
struct
message_media
*
M
);
void
fetch_message_media_encrypted
(
struct
message_media
*
M
);
void
fetch_message_action
(
struct
message_action
*
M
);
void
message_insert_tree
(
struct
message
*
M
);
void
free_user
(
struct
user
*
U
);
void
free_user
(
struct
user
*
U
);
void
free_chat
(
struct
chat
*
U
);
void
free_chat
(
struct
chat
*
U
);
...
@@ -356,6 +365,12 @@ void insert_user (peer_t *P);
...
@@ -356,6 +365,12 @@ void insert_user (peer_t *P);
void
insert_chat
(
peer_t
*
P
);
void
insert_chat
(
peer_t
*
P
);
void
fetch_photo
(
struct
photo
*
P
);
void
fetch_photo
(
struct
photo
*
P
);
void
free_photo
(
struct
photo
*
P
);
void
free_photo
(
struct
photo
*
P
);
void
message_insert_unsent
(
struct
message
*
M
);
void
message_remove_unsent
(
struct
message
*
M
);
void
send_all_unsent
(
void
);
void
message_remove_tree
(
struct
message
*
M
);
void
message_add_peer
(
struct
message
*
M
);
void
message_del_peer
(
struct
message
*
M
);
#define PEER_USER 1
#define PEER_USER 1
#define PEER_CHAT 2
#define PEER_CHAT 2
...
...
telegram.h
View file @
725c6669
...
@@ -17,5 +17,5 @@
...
@@ -17,5 +17,5 @@
Copyright Vitaly Valtman 2013
Copyright Vitaly Valtman 2013
*/
*/
#define MAX_DC_NUM 9
#define MAX_DC_NUM 9
#define MAX_USER_NUM 1000
#define MAX_USER_NUM 1000
00
#define MAX_CHAT_NUM 1000
#define MAX_CHAT_NUM 1000
00
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