fix more things
All checks were successful
Build and Test / splatoon (push) Successful in 4m37s
Build and Test / minecraft-wiiu (push) Successful in 4m37s
Build and Test / mario-tennis (push) Successful in 4m38s
Build and Test / fast-racing-neo (push) Successful in 4m37s
Build and Test / splatoon-testfire (push) Successful in 4m37s
Build and Test / sonic-transformed (push) Successful in 4m38s
Build and Test / wii-sports-club (push) Successful in 4m38s
Build and Test / wii-u-chat (push) Successful in 3m48s
Build and Test / puyopuyo (push) Successful in 3m49s
Build and Test / friends (push) Successful in 5m1s
Build and Test / super-mario-maker (push) Successful in 5m4s
All checks were successful
Build and Test / splatoon (push) Successful in 4m37s
Build and Test / minecraft-wiiu (push) Successful in 4m37s
Build and Test / mario-tennis (push) Successful in 4m38s
Build and Test / fast-racing-neo (push) Successful in 4m37s
Build and Test / splatoon-testfire (push) Successful in 4m37s
Build and Test / sonic-transformed (push) Successful in 4m38s
Build and Test / wii-sports-club (push) Successful in 4m38s
Build and Test / wii-u-chat (push) Successful in 3m48s
Build and Test / puyopuyo (push) Successful in 3m49s
Build and Test / friends (push) Successful in 5m1s
Build and Test / super-mario-maker (push) Successful in 5m4s
This commit is contained in:
parent
976643c8f4
commit
fcc6ca6ee9
1 changed files with 11 additions and 4 deletions
|
|
@ -593,7 +593,7 @@ impl FriendsWiiU for FriendsUser {
|
|||
current_friends.push(friend.pid);
|
||||
drop(current_friends);
|
||||
|
||||
let mut users = self.fm.users.read().await;
|
||||
let users = self.fm.users.read().await;
|
||||
let user = users.get(&friend.pid).cloned();
|
||||
drop(users);
|
||||
if let Some(user) = user {
|
||||
|
|
@ -1067,9 +1067,8 @@ impl FriendsWiiU for FriendsUser {
|
|||
|
||||
async fn delete_friend_request(&self, id: u64) -> Result<(), ErrorCode> {
|
||||
let Ok(query) = query!(
|
||||
"delete from friend_requests where id = $1 and recipient = $2 returning sender",
|
||||
"delete from friend_requests where id = $1 returning sender, recipient",
|
||||
bytemuck::cast::<_, i64>(id),
|
||||
self.pid
|
||||
)
|
||||
.fetch_one(get_db())
|
||||
.await
|
||||
|
|
@ -1077,8 +1076,16 @@ impl FriendsWiiU for FriendsUser {
|
|||
return Err(ErrorCode::FPD_InvalidMessageID);
|
||||
};
|
||||
|
||||
let other = if query.recipient == self.pid {
|
||||
query.sender
|
||||
} else if query.sender == self.pid {
|
||||
query.recipient
|
||||
} else {
|
||||
return Err(ErrorCode::FPD_InvalidMessageID);
|
||||
};
|
||||
|
||||
let users = self.fm.users.read().await;
|
||||
if let Some(user) = users.get(&query.sender).and_then(|v| v.upgrade()) {
|
||||
if let Some(user) = users.get(&other).and_then(|v| v.upgrade()) {
|
||||
drop(users);
|
||||
|
||||
user.remote
|
||||
|
|
|
|||
Loading…
Reference in a new issue