mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-15 14:12:27 +00:00
Implement basic privacy settings (#392)
* Add ability for clients to submit and retrieve privacy settings data * Make slot pages and user pages respect user's privacy settings * Prevent webhook from publishing new levels if user's privacy settings disallow it * Hide levels/profiles from respective pages depending on privacy settings * Apply suggestions from review
This commit is contained in:
parent
5a3439e634
commit
2ab1e72037
12 changed files with 210 additions and 12 deletions
|
@ -234,13 +234,13 @@ public class PublishController : ControllerBase
|
|||
|
||||
this.database.Slots.Add(slot);
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
await WebhookHelper.SendWebhook
|
||||
(
|
||||
"New level published!",
|
||||
$"**{user.Username}** just published a new level: [**{slot.Name}**]({ServerConfiguration.Instance.ExternalUrl}/slot/{slot.SlotId})\n{slot.Description}"
|
||||
);
|
||||
|
||||
if (user.LevelVisibility == PrivacyType.All)
|
||||
{
|
||||
await WebhookHelper.SendWebhook("New level published!",
|
||||
$"**{user.Username}** just published a new level: [**{slot.Name}**]({ServerConfiguration.Instance.ExternalUrl}/slot/{slot.SlotId})\n{slot.Description}");
|
||||
}
|
||||
|
||||
Logger.Success($"Successfully published level {slot.Name} (id: {slot.SlotId}) by {user.Username} (id: {user.UserId})", LogArea.Publish);
|
||||
|
||||
return this.Ok(slot.Serialize(gameToken.GameVersion));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue