Compare commits

...

2 commits

Author SHA1 Message Date
038a651202 I forgot to define user_id.....
Some checks failed
Build docker images / build (push) Has been cancelled
2025-05-04 01:14:55 -05:00
4aa00fd3d8 Fix for fried list
Man I am hungry and I have no food....
2025-05-03 23:16:02 -05:00

View file

@ -9,6 +9,7 @@ pub const FRIEND_LIMIT: usize = 40;
pub fn friend(req: HttpRequest, body: String) -> Option<JsonValue> {
let key = global::get_login(req.headers(), &body);
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
let user_id = userdata::get_acc(&key)["user"]["id"].as_i64().unwrap();
let friends = userdata::get_acc_friends(&key);
let mut rv = array![];
@ -24,7 +25,9 @@ pub fn friend(req: HttpRequest, body: String) -> Option<JsonValue> {
};
for uid in rv_data.members() {
rv.push(global::get_user(uid.as_i64().unwrap(), &friends, false)).unwrap();
let mut user = global::get_user(uid.as_i64().unwrap(), &friends, false);
user["user"]["last_login_time"] = global::set_time(user["user"]["last_login_time"].as_u64().unwrap_or(0), user_id, false).into();
rv.push(user).unwrap();
}
Some(object!{