Commit c33e8da7 authored by Floens's avatar Floens

Use pack_peer instead of pack_user in user_status

Gets more info e.g. the id and flags
parent fbff266d
...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment