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
c9346a75
Commit
c9346a75
authored
Dec 20, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in document loading
parent
25922000
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
interface.c
interface.c
+5
-5
queries.c
queries.c
+24
-1
queries.h
queries.h
+2
-0
No files found.
interface.c
View file @
c9346a75
...
@@ -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
;
...
@@ -994,7 +994,7 @@ void interpreter (char *line UU) {
...
@@ -994,7 +994,7 @@ void interpreter (char *line UU) {
}
}
struct
message
*
M
=
message_get
(
num
);
struct
message
*
M
=
message_get
(
num
);
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
do_load_
video_thumb
(
&
M
->
media
.
video
,
1
);
do_load_
document_thumb
(
&
M
->
media
.
document
,
1
);
}
else
{
}
else
{
printf
(
"Bad msg id
\n
"
);
printf
(
"Bad msg id
\n
"
);
RET
;
RET
;
...
@@ -1007,7 +1007,7 @@ void interpreter (char *line UU) {
...
@@ -1007,7 +1007,7 @@ void interpreter (char *line UU) {
}
}
struct
message
*
M
=
message_get
(
num
);
struct
message
*
M
=
message_get
(
num
);
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
do_load_
video_thumb
(
&
M
->
media
.
video
,
2
);
do_load_
document_thumb
(
&
M
->
media
.
document
,
2
);
}
else
{
}
else
{
printf
(
"Bad msg id
\n
"
);
printf
(
"Bad msg id
\n
"
);
RET
;
RET
;
...
@@ -1020,7 +1020,7 @@ void interpreter (char *line UU) {
...
@@ -1020,7 +1020,7 @@ void interpreter (char *line UU) {
}
}
struct
message
*
M
=
message_get
(
num
);
struct
message
*
M
=
message_get
(
num
);
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
do_load_
video
(
&
M
->
media
.
video
,
1
);
do_load_
document
(
&
M
->
media
.
document
,
1
);
}
else
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_decrypted_message_media_document
)
{
}
else
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_decrypted_message_media_document
)
{
do_load_encr_video
(
&
M
->
media
.
encr_video
,
1
);
do_load_encr_video
(
&
M
->
media
.
encr_video
,
1
);
}
else
{
}
else
{
...
@@ -1035,7 +1035,7 @@ void interpreter (char *line UU) {
...
@@ -1035,7 +1035,7 @@ void interpreter (char *line UU) {
}
}
struct
message
*
M
=
message_get
(
num
);
struct
message
*
M
=
message_get
(
num
);
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_message_media_document
)
{
do_load_
video
(
&
M
->
media
.
video
,
2
);
do_load_
document
(
&
M
->
media
.
document
,
2
);
}
else
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_decrypted_message_media_document
)
{
}
else
if
(
M
&&
!
M
->
service
&&
M
->
media
.
type
==
(
int
)
CODE_decrypted_message_media_document
)
{
do_load_encr_video
(
&
M
->
media
.
encr_video
,
2
);
do_load_encr_video
(
&
M
->
media
.
encr_video
,
2
);
}
else
{
}
else
{
...
...
queries.c
View file @
c9346a75
...
@@ -1758,6 +1758,7 @@ struct download {
...
@@ -1758,6 +1758,7 @@ struct download {
long
long
id
;
long
long
id
;
unsigned
char
*
iv
;
unsigned
char
*
iv
;
unsigned
char
*
key
;
unsigned
char
*
key
;
int
type
;
};
};
...
@@ -1861,7 +1862,7 @@ void load_next_part (struct download *D) {
...
@@ -1861,7 +1862,7 @@ void load_next_part (struct download *D) {
if
(
D
->
iv
)
{
if
(
D
->
iv
)
{
out_int
(
CODE_input_encrypted_file_location
);
out_int
(
CODE_input_encrypted_file_location
);
}
else
{
}
else
{
out_int
(
CODE_input_video_file_location
);
out_int
(
D
->
type
);
}
}
out_long
(
D
->
id
);
out_long
(
D
->
id
);
out_long
(
D
->
access_hash
);
out_long
(
D
->
access_hash
);
...
@@ -1913,6 +1914,10 @@ void do_load_video_thumb (struct video *video, int next) {
...
@@ -1913,6 +1914,10 @@ void do_load_video_thumb (struct video *video, int next) {
do_load_photo_size
(
&
video
->
thumb
,
next
);
do_load_photo_size
(
&
video
->
thumb
,
next
);
}
}
void
do_load_document_thumb
(
struct
document
*
video
,
int
next
)
{
do_load_photo_size
(
&
video
->
thumb
,
next
);
}
void
do_load_video
(
struct
video
*
V
,
int
next
)
{
void
do_load_video
(
struct
video
*
V
,
int
next
)
{
assert
(
V
);
assert
(
V
);
assert
(
next
);
assert
(
next
);
...
@@ -1926,6 +1931,24 @@ void do_load_video (struct video *V, int next) {
...
@@ -1926,6 +1931,24 @@ void do_load_video (struct video *V, int next) {
D
->
next
=
next
;
D
->
next
=
next
;
D
->
name
=
0
;
D
->
name
=
0
;
D
->
fd
=
-
1
;
D
->
fd
=
-
1
;
D
->
type
=
CODE_input_video_file_location
;
load_next_part
(
D
);
}
void
do_load_document
(
struct
document
*
V
,
int
next
)
{
assert
(
V
);
assert
(
next
);
struct
download
*
D
=
malloc
(
sizeof
(
*
D
));
memset
(
D
,
0
,
sizeof
(
*
D
));
D
->
offset
=
0
;
D
->
size
=
V
->
size
;
D
->
id
=
V
->
id
;
D
->
access_hash
=
V
->
access_hash
;
D
->
dc
=
V
->
dc_id
;
D
->
next
=
next
;
D
->
name
=
0
;
D
->
fd
=
-
1
;
D
->
type
=
CODE_input_document_file_location
;
load_next_part
(
D
);
load_next_part
(
D
);
}
}
...
...
queries.h
View file @
c9346a75
...
@@ -90,6 +90,8 @@ struct video;
...
@@ -90,6 +90,8 @@ struct video;
void
do_load_photo
(
struct
photo
*
photo
,
int
next
);
void
do_load_photo
(
struct
photo
*
photo
,
int
next
);
void
do_load_video_thumb
(
struct
video
*
video
,
int
next
);
void
do_load_video_thumb
(
struct
video
*
video
,
int
next
);
void
do_load_video
(
struct
video
*
V
,
int
next
);
void
do_load_video
(
struct
video
*
V
,
int
next
);
void
do_load_document
(
struct
document
*
V
,
int
next
);
void
do_load_document_thumb
(
struct
document
*
video
,
int
next
);
void
do_help_get_config
(
void
);
void
do_help_get_config
(
void
);
int
do_auth_check_phone
(
const
char
*
user
);
int
do_auth_check_phone
(
const
char
*
user
);
int
do_get_nearest_dc
(
void
);
int
do_get_nearest_dc
(
void
);
...
...
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