Send any friends your have as live guests

This commit is contained in:
Ethan O'Brien
2024-04-15 17:04:03 -05:00
parent d4ae8f7c5c
commit 60f8e96406
4 changed files with 85 additions and 12 deletions

View File

@@ -160,7 +160,7 @@ fn get_cards(arr: JsonValue, user: &JsonValue) -> JsonValue {
}
return rv;
}
pub fn get_user(id: i64) -> JsonValue {
pub fn get_user(id: i64, friends: &JsonValue) -> JsonValue {
let user = userdata::get_acc_from_uid(id);
if !user["error"].is_empty() {
return object!{};
@@ -191,5 +191,15 @@ pub fn get_user(id: i64) -> JsonValue {
rv["user"].remove("ss_user_id");
rv["user"].remove("birthday");
rv["status"] = if friends["friend_user_id_list"].contains(id) {
3
} else if friends["pending_user_id_list"].contains(id) {
2
} else if friends["request_user_id_list"].contains(id) {
1
} else {
0
}.into();
rv
}