Merge pull request #433 from iceljc/features/sync-function-indication
add chat indication
This commit is contained in:
commit
2574523844
|
|
@ -6,6 +6,10 @@ public class ConversationSenderActionModel
|
|||
{
|
||||
[JsonPropertyName("conversation_id")]
|
||||
public string ConversationId { get; set; }
|
||||
|
||||
[JsonPropertyName("sender_action")]
|
||||
public SenderActionEnum SenderAction { get; set; }
|
||||
|
||||
[JsonPropertyName("indication")]
|
||||
public string? Indication { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,20 @@ public class ChatHubConversationHook : ConversationHookBase
|
|||
await base.OnMessageReceived(message);
|
||||
}
|
||||
|
||||
public override async Task OnFunctionExecuting(RoleDialogModel message)
|
||||
{
|
||||
var conv = _services.GetRequiredService<IConversationService>();
|
||||
|
||||
await _chatHub.Clients.User(_user.Id).SendAsync("OnSenderActionGenerated", new ConversationSenderActionModel
|
||||
{
|
||||
ConversationId = conv.ConversationId,
|
||||
SenderAction = SenderActionEnum.TypingOn,
|
||||
Indication = message.Indication
|
||||
});
|
||||
|
||||
await base.OnFunctionExecuting(message);
|
||||
}
|
||||
|
||||
public override async Task OnPostbackMessageReceived(RoleDialogModel message, PostbackMessageModel replyMsg)
|
||||
{
|
||||
await this.OnMessageReceived(message);
|
||||
|
|
|
|||
Loading…
Reference in a new issue