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
a515e0c9
Commit
a515e0c9
authored
Jun 02, 2015
by
Vincent Castellano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement load_ functions
parent
f37588b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
python-tg.c
python-tg.c
+28
-16
No files found.
python-tg.c
View file @
a515e0c9
...
...
@@ -774,16 +774,21 @@ void py_do_all (void) {
int
preview
=
0
;
int
reply_id
=
0
;
unsigned
long
long
flags
=
0
;
Py_ssize_t
i
;
tgl_user_id_t
*
ids
;
struct
tgl_message
*
M
;
int
len
,
len1
,
len2
,
len3
;
int
limit
,
offset
;
long
msg_id
=
0
;
PyObject
*
pyObj1
=
NULL
;
PyObject
*
pyObj2
=
NULL
;
PyObject
*
cb_extra
=
NULL
;
PyObject
*
msg
=
NULL
;
PyObject
*
peer
=
NULL
;
PyObject
*
peer1
=
NULL
;
...
...
@@ -877,33 +882,40 @@ void py_do_all (void) {
else
PyErr_Print
();
break
;
/*
case pq_load_photo:
case
pq_load_photo
:
case
pq_load_video
:
case
pq_load_audio
:
case
pq_load_document
:
M = py_ptr[p + 1];
if (!M || (M->media.type != tgl_message_media_photo && M->media.type != tgl_message_media_photo_encr && M->media.type != tgl_message_media_document && M->media.type != tgl_message_media_document_encr)) {
py_file_cb (TLS, py_ptr[p], 0, 0);
} else {
, limit, offse, limit, offsettif (M->media.type == tgl_message_media_photo) {
tgl_do_load_photo (TLS, &M->media.photo, py_file_cb, py_ptr[p]);
} else if (M->media.type == tgl_message_media_document) {
tgl_do_load_document (TLS, &M->media.document, py_file_cb, py_ptr[p]);
if
(
PyArg_ParseTuple
(
args
,
"O!O"
,
&
tgl_MsgType
,
&
msg
,
&
cb_extra
))
{
M
=
((
tgl_Msg
*
)
msg
)
->
msg
;
if
(
!
M
||
(
M
->
media
.
type
!=
tgl_message_media_photo
&&
M
->
media
.
type
!=
tgl_message_media_document
&&
M
->
media
.
type
!=
tgl_message_media_document_encr
))
{
py_file_cb
(
TLS
,
cb_extra
,
0
,
0
);
}
else
{
tgl_do_load_encr_document (TLS, &M->media.encr_document, py_file_cb, py_ptr[p]);
if
(
M
->
media
.
type
==
tgl_message_media_photo
)
{
assert
(
M
->
media
.
photo
);
tgl_do_load_photo
(
TLS
,
M
->
media
.
photo
,
py_file_cb
,
cb_extra
);
}
else
if
(
M
->
media
.
type
==
tgl_message_media_document
)
{
tgl_do_load_document
(
TLS
,
M
->
media
.
document
,
py_file_cb
,
cb_extra
);
}
else
{
tgl_do_load_encr_document
(
TLS
,
M
->
media
.
encr_document
,
py_file_cb
,
cb_extra
);
}
}
}
break
;
case
pq_load_video_thumb
:
case
pq_load_document_thumb
:
M = py_ptr[p + 1];
if (!M || (M->media.type != tgl_message_media_document)) {
py_file_cb (TLS, py_ptr[p], 0, 0);
} else {
tgl_do_load_document_thumb (TLS, &M->media.document, py_file_cb, py_ptr[p]);
if
(
PyArg_ParseTuple
(
args
,
"O!O"
,
&
tgl_MsgType
,
&
msg
,
&
cb_extra
))
{
M
=
((
tgl_Msg
*
)
msg
)
->
msg
;
if
(
!
M
||
(
M
->
media
.
type
!=
tgl_message_media_document
))
{
py_file_cb
(
TLS
,
cb_extra
,
0
,
0
);
}
else
{
tgl_do_load_document_thumb
(
TLS
,
M
->
media
.
document
,
py_file_cb
,
cb_extra
);
}
}
break
;
*/
case
pq_fwd
:
if
(
PyArg_ParseTuple
(
args
,
"O!l|O"
,
&
tgl_PeerType
,
&
peer
,
&
msg_id
,
&
cb_extra
))
tgl_do_forward_message
(
TLS
,
PY_PEER_ID
(
peer
),
msg_id
,
0
,
py_msg_cb
,
cb_extra
);
...
...
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