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
fe0e4fed
Commit
fe0e4fed
authored
Nov 16, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed small bugs. Fixed login
parent
78f3e7aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
22 deletions
+31
-22
mtproto-common.h
mtproto-common.h
+1
-0
queries.c
queries.c
+25
-20
structures.c
structures.c
+5
-2
No files found.
mtproto-common.h
View file @
fe0e4fed
...
...
@@ -76,6 +76,7 @@
#define CODE_input_peer_notify_settings_old 0x3cf4b1be
#define CODE_peer_notify_settings_old 0xddbcd4a5
#define CODE_user_profile_photo_old 0x990d1493
#define CODE_msg_detained_info 0x276d3ec6
/* not really a limit, for struct encrypted_message only */
...
...
queries.c
View file @
fe0e4fed
...
...
@@ -303,6 +303,28 @@ void out_random (int n) {
out_cstring
(
buf
,
n
);
}
int
allow_send_linux_version
;
void
do_insert_header
(
void
)
{
out_int
(
CODE_invoke_with_layer9
);
out_int
(
CODE_init_connection
);
out_int
(
TG_APP_ID
);
if
(
allow_send_linux_version
)
{
struct
utsname
st
;
uname
(
&
st
);
out_string
(
st
.
machine
);
static
char
buf
[
1000000
];
sprintf
(
buf
,
"%s %s %s"
,
st
.
sysname
,
st
.
release
,
st
.
version
);
out_string
(
buf
);
out_string
(
TG_VERSION
" (build "
TG_BUILD
")"
);
out_string
(
"En"
);
}
else
{
out_string
(
"x86"
);
out_string
(
"Linux"
);
out_string
(
TG_VERSION
);
out_string
(
"en"
);
}
}
/* {{{ Get config */
void
fetch_dc_option
(
void
)
{
...
...
@@ -413,7 +435,7 @@ void do_send_code (const char *user) {
suser
=
strdup
(
user
);
want_dc_num
=
0
;
clear_packet
();
out_int
(
CODE_invoke_with_layer6
);
do_insert_header
(
);
out_int
(
CODE_auth_send_code
);
out_string
(
user
);
out_int
(
0
);
...
...
@@ -441,7 +463,7 @@ void do_send_code (const char *user) {
logprintf
(
"send_code: dc_num = %d
\n
"
,
dc_working_num
);
want_dc_num
=
0
;
clear_packet
();
out_int
(
CODE_invoke_with_layer6
);
do_insert_header
(
);
out_int
(
CODE_auth_send_code
);
out_string
(
user
);
out_int
(
0
);
...
...
@@ -2501,24 +2523,7 @@ struct query_methods get_difference_methods = {
void
do_get_difference
(
void
)
{
difference_got
=
0
;
clear_packet
();
out_int
(
CODE_invoke_with_layer9
);
out_int
(
CODE_init_connection
);
out_int
(
TG_APP_ID
);
if
(
allow_send_linux_version
)
{
struct
utsname
st
;
uname
(
&
st
);
out_string
(
st
.
machine
);
static
char
buf
[
1000000
];
sprintf
(
buf
,
"%s %s %s"
,
st
.
sysname
,
st
.
release
,
st
.
version
);
out_string
(
buf
);
out_string
(
TG_VERSION
" (build "
TG_BUILD
")"
);
out_string
(
"En"
);
}
else
{
out_string
(
"x86"
);
out_string
(
"Linux"
);
out_string
(
TG_VERSION
);
out_string
(
"en"
);
}
do_insert_header
();
if
(
seq
>
0
)
{
out_int
(
CODE_updates_get_difference
);
out_int
(
pts
);
...
...
structures.c
View file @
fe0e4fed
...
...
@@ -202,8 +202,10 @@ int fetch_user (struct user *U) {
need_update
|=
set_update_int
(
&
U
->
photo_small
.
dc
,
-
2
);
need_update
|=
set_update_int
(
&
U
->
photo_big
.
dc
,
-
2
);
}
else
{
assert
(
y
==
CODE_user_profile_photo
);
fetch_long
();
assert
(
y
==
CODE_user_profile_photo
||
y
==
CODE_user_profile_photo_old
);
if
(
y
==
CODE_user_profile_photo
)
{
fetch_long
();
}
need_update
|=
fetch_file_location
(
&
U
->
photo_small
);
need_update
|=
fetch_file_location
(
&
U
->
photo_big
);
}
...
...
@@ -396,6 +398,7 @@ void fetch_user_full (struct user *U) {
free_photo
(
&
U
->
photo
);
}
fetch_photo
(
&
U
->
photo
);
U
->
flags
|=
FLAG_HAS_PHOTO
;
fetch_notify_settings
();
U
->
blocked
=
fetch_int
();
if
(
U
->
real_first_name
)
{
free
(
U
->
real_first_name
);
}
...
...
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