make chat message author optional
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using TorchRemote.Models.Shared;
|
using TorchRemote.Models.Shared;
|
||||||
namespace TorchRemote.Models.Requests;
|
namespace TorchRemote.Models.Requests;
|
||||||
|
|
||||||
public record ChatMessageRequest(string Author, string Message, ChatChannel Channel, long? TargetId = null);
|
public record ChatMessageRequest(string? Author, string Message, ChatChannel Channel, long? TargetId = null);
|
@@ -40,7 +40,7 @@ public class ChatController : WebApiController, IChatController
|
|||||||
|
|
||||||
var msg = new ChatMsg
|
var msg = new ChatMsg
|
||||||
{
|
{
|
||||||
CustomAuthorName = request.Author,
|
CustomAuthorName = request.Author ?? Statics.Torch.Config.ChatName,
|
||||||
Text = request.Message,
|
Text = request.Message,
|
||||||
Channel = (byte)request.Channel,
|
Channel = (byte)request.Channel,
|
||||||
TargetId = request.TargetId.GetValueOrDefault()
|
TargetId = request.TargetId.GetValueOrDefault()
|
||||||
|
Reference in New Issue
Block a user