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
baa1b481
Commit
baa1b481
authored
Nov 13, 2013
by
vysheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge github.com:vysheng/tg
parents
50451ea9
a11c19ec
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
2 deletions
+51
-2
constants.h
constants.h
+6
-0
main.c
main.c
+4
-0
mtproto-client.c
mtproto-client.c
+40
-0
queries.c
queries.c
+1
-2
No files found.
constants.h
View file @
baa1b481
...
@@ -203,6 +203,8 @@
...
@@ -203,6 +203,8 @@
#define CODE_dc_option 0x2ec2a43c
#define CODE_dc_option 0x2ec2a43c
#define CODE_config 0x232d5905
#define CODE_config 0x232d5905
#define CODE_nearest_dc 0x8e1a1775
#define CODE_nearest_dc 0x8e1a1775
#define CODE_help_app_update 0x8987f311
#define CODE_help_no_app_update 0xc45a6536
#define CODE_help_invite_text 0x18cb9f78
#define CODE_help_invite_text 0x18cb9f78
#define CODE_messages_stated_messages_links 0x3e74f5c6
#define CODE_messages_stated_messages_links 0x3e74f5c6
#define CODE_messages_stated_message_link 0xa9af2881
#define CODE_messages_stated_message_link 0xa9af2881
...
@@ -254,6 +256,8 @@
...
@@ -254,6 +256,8 @@
#define CODE_messages_sent_encrypted_file 0x9493ff32
#define CODE_messages_sent_encrypted_file 0x9493ff32
#define CODE_input_file_big 0xfa4f0bb5
#define CODE_input_file_big 0xfa4f0bb5
#define CODE_input_encrypted_file_big_uploaded 0x2dc173c8
#define CODE_input_encrypted_file_big_uploaded 0x2dc173c8
#define CODE_update_chat_participant_add 0x3a0eeb22
#define CODE_update_chat_participant_delete 0x6e5f8c22
#define CODE_invoke_after_msg 0xcb9f372d
#define CODE_invoke_after_msg 0xcb9f372d
#define CODE_invoke_after_msgs 0x3dc4b4f0
#define CODE_invoke_after_msgs 0x3dc4b4f0
#define CODE_invoke_with_layer1 0x53835315
#define CODE_invoke_with_layer1 0x53835315
...
@@ -315,6 +319,7 @@
...
@@ -315,6 +319,7 @@
#define CODE_upload_get_file 0xe3a6cfb5
#define CODE_upload_get_file 0xe3a6cfb5
#define CODE_help_get_config 0xc4f9186b
#define CODE_help_get_config 0xc4f9186b
#define CODE_help_get_nearest_dc 0x1fb33026
#define CODE_help_get_nearest_dc 0x1fb33026
#define CODE_help_get_app_update 0xc812ac7e
#define CODE_help_save_app_log 0x6f02f748
#define CODE_help_save_app_log 0x6f02f748
#define CODE_help_get_invite_text 0xa4a95186
#define CODE_help_get_invite_text 0xa4a95186
#define CODE_photos_get_user_photos 0xb7ee553c
#define CODE_photos_get_user_photos 0xb7ee553c
...
@@ -352,4 +357,5 @@
...
@@ -352,4 +357,5 @@
#define CODE_upload_save_big_file_part 0xde7b673d
#define CODE_upload_save_big_file_part 0xde7b673d
#define CODE_init_connection 0x69796de9
#define CODE_init_connection 0x69796de9
#define CODE_invoke_with_layer9 0x76715a63
#define CODE_invoke_with_layer9 0x76715a63
#define CODE_invoke_with_layer10 0x39620c41
#endif
#endif
main.c
View file @
baa1b481
...
@@ -282,6 +282,10 @@ void parse_config (void) {
...
@@ -282,6 +282,10 @@ void parse_config (void) {
#else
#else
void
parse_config
(
void
)
{
void
parse_config
(
void
)
{
printf
(
"libconfig not enabled
\n
"
);
printf
(
"libconfig not enabled
\n
"
);
assert
(
asprintf
(
&
auth_file_name
,
"%s/%s/%s"
,
get_home_directory
(),
CONFIG_DIRECTORY
,
AUTH_KEY_FILE
)
>=
0
);
assert
(
asprintf
(
&
state_file_name
,
"%s/%s/%s"
,
get_home_directory
(),
CONFIG_DIRECTORY
,
STATE_FILE
)
>=
0
);
assert
(
asprintf
(
&
secret_chat_file_name
,
"%s/%s/%s"
,
get_home_directory
(),
CONFIG_DIRECTORY
,
SECRET_CHAT_FILE
)
>=
0
);
assert
(
asprintf
(
&
downloads_directory
,
"%s/%s/%s"
,
get_home_directory
(),
CONFIG_DIRECTORY
,
DOWNLOADS_DIRECTORY
)
>=
0
);
}
}
#endif
#endif
...
...
mtproto-client.c
View file @
baa1b481
...
@@ -1088,6 +1088,45 @@ void work_update (struct connection *c UU, long long msg_id UU) {
...
@@ -1088,6 +1088,45 @@ void work_update (struct connection *c UU, long long msg_id UU) {
print_end
();
print_end
();
}
}
break
;
break
;
case
CODE_update_chat_participant_add
:
{
peer_id_t
chat_id
=
MK_CHAT
(
fetch_int
());
peer_id_t
user_id
=
MK_USER
(
fetch_int
());
peer_id_t
inviter_id
=
MK_USER
(
fetch_int
());
fetch_int
();
// version
print_start
();
push_color
(
COLOR_YELLOW
);
print_date
(
time
(
0
));
printf
(
" Chat "
);
print_chat_name
(
chat_id
,
user_chat_get
(
chat_id
));
printf
(
": user "
);
print_user_name
(
user_id
,
user_chat_get
(
user_id
));
printf
(
" added by user "
);
print_user_name
(
inviter_id
,
user_chat_get
(
inviter_id
));
printf
(
"
\n
"
);
pop_color
();
print_end
();
}
break
;
case
CODE_update_chat_participant_delete
:
{
peer_id_t
chat_id
=
MK_CHAT
(
fetch_int
());
peer_id_t
user_id
=
MK_USER
(
fetch_int
());
fetch_int
();
// version
print_start
();
push_color
(
COLOR_YELLOW
);
print_date
(
time
(
0
));
printf
(
" Chat "
);
print_chat_name
(
chat_id
,
user_chat_get
(
chat_id
));
printf
(
": user "
);
print_user_name
(
user_id
,
user_chat_get
(
user_id
));
printf
(
" deleted
\n
"
);
pop_color
();
print_end
();
}
break
;
default:
default:
logprintf
(
"Unknown update type %08x
\n
"
,
op
);
logprintf
(
"Unknown update type %08x
\n
"
,
op
);
}
}
...
@@ -1273,6 +1312,7 @@ void work_detained_info (struct connection *c UU, long long msg_id UU) {
...
@@ -1273,6 +1312,7 @@ void work_detained_info (struct connection *c UU, long long msg_id UU) {
void
work_updates_to_long
(
struct
connection
*
c
UU
,
long
long
msg_id
UU
)
{
void
work_updates_to_long
(
struct
connection
*
c
UU
,
long
long
msg_id
UU
)
{
assert
(
fetch_int
()
==
(
int
)
CODE_updates_too_long
);
assert
(
fetch_int
()
==
(
int
)
CODE_updates_too_long
);
logprintf
(
"updates to long... Getting difference
\n
"
);
do_get_difference
();
do_get_difference
();
}
}
void
rpc_execute_answer
(
struct
connection
*
c
,
long
long
msg_id
UU
)
{
void
rpc_execute_answer
(
struct
connection
*
c
,
long
long
msg_id
UU
)
{
...
...
queries.c
View file @
baa1b481
...
@@ -1489,7 +1489,6 @@ void do_forward_message (peer_id_t id, int n) {
...
@@ -1489,7 +1489,6 @@ void do_forward_message (peer_id_t id, int n) {
return
;
return
;
}
}
clear_packet
();
clear_packet
();
out_int
(
CODE_invoke_with_layer9
);
out_int
(
CODE_messages_forward_message
);
out_int
(
CODE_messages_forward_message
);
out_peer_id
(
id
);
out_peer_id
(
id
);
out_int
(
n
);
out_int
(
n
);
...
@@ -2408,7 +2407,7 @@ struct query_methods get_difference_methods = {
...
@@ -2408,7 +2407,7 @@ struct query_methods get_difference_methods = {
void
do_get_difference
(
void
)
{
void
do_get_difference
(
void
)
{
difference_got
=
0
;
difference_got
=
0
;
clear_packet
();
clear_packet
();
out_int
(
CODE_invoke_with_layer
9
);
out_int
(
CODE_invoke_with_layer
10
);
out_int
(
CODE_init_connection
);
out_int
(
CODE_init_connection
);
out_int
(
TG_APP_ID
);
out_int
(
TG_APP_ID
);
if
(
allow_send_linux_version
)
{
if
(
allow_send_linux_version
)
{
...
...
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