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
c35619f6
Commit
c35619f6
authored
Apr 30, 2015
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated tgl
parent
4dff2a3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
37 deletions
+34
-37
interface.c
interface.c
+30
-33
lua-tg.c
lua-tg.c
+3
-3
tgl
tgl
+1
-1
No files found.
interface.c
View file @
c35619f6
...
...
@@ -790,10 +790,10 @@ void do_ ## act ## _ ## tp (int arg_num, struct arg args[], struct in_ev *ev) {
tgl_do_load_photo (TLS, M->media.photo, actf, ev);\
} else if (M->media.type == tgl_message_media_document) {\
tgl_do_load_document (TLS, M->media.document, actf, ev);\
} else if (M->media.type == tgl_message_media_
photo_encr || M->media.type == tgl_message_media_
document_encr) {\
tgl_do_load_encr_document (TLS,
&
M->media.encr_document, actf, ev); \
} else if (M->media.type == tgl_message_media_document_encr) {\
tgl_do_load_encr_document (TLS, M->media.encr_document, actf, ev); \
} else if (M->media.type == tgl_message_media_webpage) {\
actf (TLS, ev, 1, M->media.webpage
.
url);\
actf (TLS, ev, 1, M->media.webpage
->
url);\
} else if (M->media.type == tgl_message_media_geo || M->media.type == tgl_message_media_venue) { \
static char s[1000]; \
sprintf (s, "https://maps.google.com/?q=%.6lf,%.6lf", M->media.geo.latitude, M->media.geo.longitude);\
...
...
@@ -2695,51 +2695,48 @@ void print_media (struct in_ev *ev, struct tgl_message_media *M) {
mprintf
(
ev
,
"]"
);
return
;
case
tgl_message_media_photo_encr
:
mprintf
(
ev
,
"[photo]"
);
return
;
case
tgl_message_media_document_encr
:
mprintf
(
ev
,
"["
);
if
(
M
->
encr_document
.
flags
&
FLAG_DOCUMENT_IMAGE
)
{
if
(
M
->
encr_document
->
flags
&
FLAG_DOCUMENT_IMAGE
)
{
mprintf
(
ev
,
"image"
);
}
else
if
(
M
->
encr_document
.
flags
&
FLAG_DOCUMENT_AUDIO
)
{
}
else
if
(
M
->
encr_document
->
flags
&
FLAG_DOCUMENT_AUDIO
)
{
mprintf
(
ev
,
"audio"
);
}
else
if
(
M
->
encr_document
.
flags
&
FLAG_DOCUMENT_VIDEO
)
{
}
else
if
(
M
->
encr_document
->
flags
&
FLAG_DOCUMENT_VIDEO
)
{
mprintf
(
ev
,
"video"
);
}
else
if
(
M
->
encr_document
.
flags
&
FLAG_DOCUMENT_STICKER
)
{
}
else
if
(
M
->
encr_document
->
flags
&
FLAG_DOCUMENT_STICKER
)
{
mprintf
(
ev
,
"sticker"
);
}
else
{
mprintf
(
ev
,
"document"
);
}
if
(
M
->
encr_document
.
caption
&&
strlen
(
M
->
encr_document
.
caption
))
{
mprintf
(
ev
,
" %s:"
,
M
->
encr_document
.
caption
);
if
(
M
->
encr_document
->
caption
&&
strlen
(
M
->
encr_document
->
caption
))
{
mprintf
(
ev
,
" %s:"
,
M
->
encr_document
->
caption
);
}
else
{
mprintf
(
ev
,
":"
);
}
if
(
M
->
encr_document
.
mime_type
)
{
mprintf
(
ev
,
" type=%s"
,
M
->
encr_document
.
mime_type
);
if
(
M
->
encr_document
->
mime_type
)
{
mprintf
(
ev
,
" type=%s"
,
M
->
encr_document
->
mime_type
);
}
if
(
M
->
encr_document
.
w
&&
M
->
encr_document
.
h
)
{
mprintf
(
ev
,
" size=%dx%d"
,
M
->
encr_document
.
w
,
M
->
encr_document
.
h
);
if
(
M
->
encr_document
->
w
&&
M
->
encr_document
->
h
)
{
mprintf
(
ev
,
" size=%dx%d"
,
M
->
encr_document
->
w
,
M
->
encr_document
->
h
);
}
if
(
M
->
encr_document
.
duration
)
{
mprintf
(
ev
,
" duration=%d"
,
M
->
encr_document
.
duration
);
if
(
M
->
encr_document
->
duration
)
{
mprintf
(
ev
,
" duration=%d"
,
M
->
encr_document
->
duration
);
}
mprintf
(
ev
,
" size="
);
if
(
M
->
encr_document
.
size
<
(
1
<<
10
))
{
mprintf
(
ev
,
"%dB"
,
M
->
encr_document
.
size
);
}
else
if
(
M
->
encr_document
.
size
<
(
1
<<
20
))
{
mprintf
(
ev
,
"%dKiB"
,
M
->
encr_document
.
size
>>
10
);
}
else
if
(
M
->
encr_document
.
size
<
(
1
<<
30
))
{
mprintf
(
ev
,
"%dMiB"
,
M
->
encr_document
.
size
>>
20
);
if
(
M
->
encr_document
->
size
<
(
1
<<
10
))
{
mprintf
(
ev
,
"%dB"
,
M
->
encr_document
->
size
);
}
else
if
(
M
->
encr_document
->
size
<
(
1
<<
20
))
{
mprintf
(
ev
,
"%dKiB"
,
M
->
encr_document
->
size
>>
10
);
}
else
if
(
M
->
encr_document
->
size
<
(
1
<<
30
))
{
mprintf
(
ev
,
"%dMiB"
,
M
->
encr_document
->
size
>>
20
);
}
else
{
mprintf
(
ev
,
"%dGiB"
,
M
->
encr_document
.
size
>>
30
);
mprintf
(
ev
,
"%dGiB"
,
M
->
encr_document
->
size
>>
30
);
}
mprintf
(
ev
,
"]"
);
...
...
@@ -2760,17 +2757,17 @@ void print_media (struct in_ev *ev, struct tgl_message_media *M) {
return
;
case
tgl_message_media_webpage
:
mprintf
(
ev
,
"[webpage:"
);
if
(
M
->
webpage
.
url
)
{
mprintf
(
ev
,
" url:'%s'"
,
M
->
webpage
.
url
);
if
(
M
->
webpage
->
url
)
{
mprintf
(
ev
,
" url:'%s'"
,
M
->
webpage
->
url
);
}
if
(
M
->
webpage
.
title
)
{
mprintf
(
ev
,
" title:'%s'"
,
M
->
webpage
.
title
);
if
(
M
->
webpage
->
title
)
{
mprintf
(
ev
,
" title:'%s'"
,
M
->
webpage
->
title
);
}
if
(
M
->
webpage
.
description
)
{
mprintf
(
ev
,
" description:'%s'"
,
M
->
webpage
.
description
);
if
(
M
->
webpage
->
description
)
{
mprintf
(
ev
,
" description:'%s'"
,
M
->
webpage
->
description
);
}
if
(
M
->
webpage
.
author
)
{
mprintf
(
ev
,
" author:'%s'"
,
M
->
webpage
.
author
);
if
(
M
->
webpage
->
author
)
{
mprintf
(
ev
,
" author:'%s'"
,
M
->
webpage
->
author
);
}
mprintf
(
ev
,
"]"
);
break
;
...
...
lua-tg.c
View file @
c35619f6
...
...
@@ -243,8 +243,8 @@ void push_media (struct tgl_message_media *M) {
my_lua_checkstack
(
luaState
,
4
);
switch
(
M
->
type
)
{
//case tgl_message_media_photo_encr:
case
tgl_message_media_photo
:
case
tgl_message_media_photo_encr
:
lua_newtable
(
luaState
);
lua_add_string_field
(
"type"
,
"photo"
);
break
;
...
...
@@ -933,7 +933,7 @@ void lua_do_all (void) {
case
lq_load_audio
:
case
lq_load_document
:
M
=
lua_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
))
{
if
(
!
M
||
(
M
->
media
.
type
!=
tgl_message_media_photo
&&
M
->
media
.
type
!=
tgl_message_media_document
&&
M
->
media
.
type
!=
tgl_message_media_document_encr
))
{
lua_file_cb
(
TLS
,
lua_ptr
[
p
],
0
,
0
);
}
else
{
if
(
M
->
media
.
type
==
tgl_message_media_photo
)
{
...
...
@@ -943,7 +943,7 @@ void lua_do_all (void) {
assert
(
M
->
media
.
document
);
tgl_do_load_document
(
TLS
,
M
->
media
.
document
,
lua_file_cb
,
lua_ptr
[
p
]);
}
else
{
tgl_do_load_encr_document
(
TLS
,
&
M
->
media
.
encr_document
,
lua_file_cb
,
lua_ptr
[
p
]);
tgl_do_load_encr_document
(
TLS
,
M
->
media
.
encr_document
,
lua_file_cb
,
lua_ptr
[
p
]);
}
}
p
+=
2
;
...
...
tgl
@
03f46aea
Subproject commit
69ecf07c45ac100addadc7af00c6252e12d46a49
Subproject commit
03f46aea574f8628ba869192505b7fe76cceccfc
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