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
c33e8da7
Commit
c33e8da7
authored
Jun 07, 2015
by
Floens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use pack_peer instead of pack_user in user_status
Gets more info e.g. the id and flags
parent
fbff266d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
json-tg.c
json-tg.c
+1
-4
No files found.
json-tg.c
View file @
c33e8da7
...
@@ -437,11 +437,8 @@ int str_format_time(long when, char* string)
...
@@ -437,11 +437,8 @@ int str_format_time(long when, char* string)
json_t
*
json_pack_user_status
(
struct
tgl_user
*
U
)
{
json_t
*
json_pack_user_status
(
struct
tgl_user
*
U
)
{
json_t
*
res
=
json_object
();
json_t
*
res
=
json_object
();
assert
(
json_object_set
(
res
,
"user"
,
json_pack_peer
(
U
->
id
))
>=
0
);
struct
tgl_user_status
*
S
=
&
U
->
status
;
struct
tgl_user_status
*
S
=
&
U
->
status
;
json_object
();
json_t
*
user_res
=
json_object
();
json_pack_user
(
user_res
,
(
void
*
)
U
);
assert
(
json_object_set
(
res
,
"user"
,
user_res
)
>=
0
);
assert
(
json_object_set
(
res
,
"online"
,
json_boolean
(
S
->
online
==
1
))
>=
0
);
assert
(
json_object_set
(
res
,
"online"
,
json_boolean
(
S
->
online
==
1
))
>=
0
);
assert
(
json_object_set
(
res
,
"state"
,
json_integer
(
S
->
online
))
>=
0
);
assert
(
json_object_set
(
res
,
"state"
,
json_integer
(
S
->
online
))
>=
0
);
if
(
S
->
online
>
0
||
S
->
online
==
-
1
)
{
if
(
S
->
online
>
0
||
S
->
online
==
-
1
)
{
...
...
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