add: 8 achievements add: larger text setting fix: small infinite
timeline bugs
This commit is contained in:
parent
b860f74124
commit
5dd9fa01cb
19 changed files with 241 additions and 123 deletions
|
@ -22,7 +22,7 @@ pub async fn follow_request(
|
|||
Extension(data): Extension<State>,
|
||||
) -> impl IntoResponse {
|
||||
let data = &(data.read().await).0;
|
||||
let user = match get_user_from_token!(jar, data, oauth::AppScope::UserManageFollowing) {
|
||||
let mut user = match get_user_from_token!(jar, data, oauth::AppScope::UserManageFollowing) {
|
||||
Some(ua) => ua,
|
||||
None => return Json(Error::NotAllowed.into()),
|
||||
};
|
||||
|
@ -40,7 +40,7 @@ pub async fn follow_request(
|
|||
} else {
|
||||
// create
|
||||
match data
|
||||
.create_userfollow(UserFollow::new(user.id, id), false)
|
||||
.create_userfollow(UserFollow::new(user.id, id), &user, false)
|
||||
.await
|
||||
{
|
||||
Ok(r) => {
|
||||
|
@ -59,13 +59,15 @@ pub async fn follow_request(
|
|||
return Json(e.into());
|
||||
};
|
||||
|
||||
// award achievement
|
||||
if let Err(e) = data
|
||||
.add_achievement(&user, AchievementName::FollowUser.into())
|
||||
.add_achievement(&mut user, AchievementName::FollowUser.into())
|
||||
.await
|
||||
{
|
||||
return Json(e.into());
|
||||
}
|
||||
|
||||
// ...
|
||||
Json(ApiReturn {
|
||||
ok: true,
|
||||
message: "User followed".to_string(),
|
||||
|
@ -123,7 +125,7 @@ pub async fn accept_follow_request(
|
|||
|
||||
// create follow
|
||||
match data
|
||||
.create_userfollow(UserFollow::new(id, user.id), true)
|
||||
.create_userfollow(UserFollow::new(id, user.id), &user, true)
|
||||
.await
|
||||
{
|
||||
Ok(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue