more things
All checks were successful
Build and Test / sonic-transformed (push) Successful in 4m3s
Build and Test / mario-tennis (push) Successful in 4m5s
Build and Test / fast-racing-neo (push) Successful in 4m21s
Build and Test / splatoon (push) Successful in 4m30s
Build and Test / wii-u-chat (push) Successful in 4m47s
Build and Test / wii-sports-club (push) Successful in 4m48s
Build and Test / splatoon-testfire (push) Successful in 4m48s
Build and Test / minecraft-wiiu (push) Successful in 4m48s
Build and Test / puyopuyo (push) Successful in 4m48s
Build and Test / super-mario-maker (push) Successful in 4m59s
Build and Test / friends (push) Successful in 5m45s
All checks were successful
Build and Test / sonic-transformed (push) Successful in 4m3s
Build and Test / mario-tennis (push) Successful in 4m5s
Build and Test / fast-racing-neo (push) Successful in 4m21s
Build and Test / splatoon (push) Successful in 4m30s
Build and Test / wii-u-chat (push) Successful in 4m47s
Build and Test / wii-sports-club (push) Successful in 4m48s
Build and Test / splatoon-testfire (push) Successful in 4m48s
Build and Test / minecraft-wiiu (push) Successful in 4m48s
Build and Test / puyopuyo (push) Successful in 4m48s
Build and Test / super-mario-maker (push) Successful in 4m59s
Build and Test / friends (push) Successful in 5m45s
This commit is contained in:
parent
cb9a57bf67
commit
fe48703565
1 changed files with 19 additions and 4 deletions
|
|
@ -944,7 +944,6 @@ impl FriendsWiiU for FriendsUser {
|
||||||
sender: self.pid,
|
sender: self.pid,
|
||||||
data: Any::new(&NintendoNotificationEventGeneral {
|
data: Any::new(&NintendoNotificationEventGeneral {
|
||||||
param1: bytemuck::cast(self.pid),
|
param1: bytemuck::cast(self.pid),
|
||||||
param2: id,
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
.expect("type error"),
|
.expect("type error"),
|
||||||
|
|
@ -1095,7 +1094,6 @@ impl FriendsWiiU for FriendsUser {
|
||||||
sender: self.pid,
|
sender: self.pid,
|
||||||
data: Any::new(&NintendoNotificationEventGeneral {
|
data: Any::new(&NintendoNotificationEventGeneral {
|
||||||
param1: bytemuck::cast(self.pid),
|
param1: bytemuck::cast(self.pid),
|
||||||
param2: id,
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
.expect("type error"),
|
.expect("type error"),
|
||||||
|
|
@ -1108,7 +1106,7 @@ impl FriendsWiiU for FriendsUser {
|
||||||
|
|
||||||
async fn deny_friend_request(&self, id: u64) -> Result<BlacklistedPrincipal, ErrorCode> {
|
async fn deny_friend_request(&self, id: u64) -> Result<BlacklistedPrincipal, ErrorCode> {
|
||||||
let Ok(query) = query!(
|
let Ok(query) = query!(
|
||||||
"delete from friend_requests where id = $1 and recipient = $2 returning sender",
|
"delete from friend_requests where id = $1 and recipient = $2 returning sender, recipient",
|
||||||
bytemuck::cast::<_, i64>(id),
|
bytemuck::cast::<_, i64>(id),
|
||||||
self.pid
|
self.pid
|
||||||
)
|
)
|
||||||
|
|
@ -1118,6 +1116,14 @@ impl FriendsWiiU for FriendsUser {
|
||||||
return Err(ErrorCode::FPD_InvalidMessageID);
|
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);
|
||||||
|
};
|
||||||
|
|
||||||
if let Err(e) = query!(
|
if let Err(e) = query!(
|
||||||
"insert into denylist(initiator, other) VALUES ($1, $2)",
|
"insert into denylist(initiator, other) VALUES ($1, $2)",
|
||||||
self.pid,
|
self.pid,
|
||||||
|
|
@ -1131,7 +1137,7 @@ impl FriendsWiiU for FriendsUser {
|
||||||
};
|
};
|
||||||
|
|
||||||
let users = self.fm.users.read().await;
|
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);
|
drop(users);
|
||||||
|
|
||||||
user.remote
|
user.remote
|
||||||
|
|
@ -1523,6 +1529,15 @@ impl Drop for FriendsUser {
|
||||||
.await;
|
.await;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
tokio::spawn(async move {
|
||||||
|
query!(
|
||||||
|
"update nintendo_network_accounts set last_online = now() where pid = $1",
|
||||||
|
pid
|
||||||
|
)
|
||||||
|
.execute(get_db())
|
||||||
|
.await
|
||||||
|
.ok();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue