mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-06-26 20:47:34 -05:00
Compare commits
2 commits
222021382f
...
038a651202
Author | SHA1 | Date | |
---|---|---|---|
038a651202 | |||
4aa00fd3d8 |
1 changed files with 4 additions and 1 deletions
|
@ -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!{
|
||||
|
|
Loading…
Add table
Reference in a new issue