Limit length of comments to 100 characters

This commit is contained in:
jvyden 2022-02-22 16:27:32 -05:00
commit ede6e8f8e4
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -144,6 +144,8 @@ public class Database : DbContext
public async Task<bool> PostComment(User user, int targetId, CommentType type, string message)
{
if (message.Length > 100) return false;
if (type == CommentType.Profile)
{
User? targetUser = await this.Users.FirstOrDefaultAsync(u => u.UserId == targetId);