From 45bf766ef87514f9973ad253972c10b0b8572a11 Mon Sep 17 00:00:00 2001 From: Aden <128471249+adenchen123@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:31:20 +0800 Subject: [PATCH 1/2] Update ConversationService.cs --- .../Conversations/Services/ConversationService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs index f6326a7b..55d80c18 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs @@ -173,12 +173,14 @@ public partial class ConversationService : IConversationService var state = _services.GetRequiredService(); var channel = state.GetState("channel"); var channelId = state.GetState("channel_id"); + var userId = state.GetState("current_user_id"); var sess = new Conversation { Id = _conversationId, Channel = channel, ChannelId = channelId, - AgentId = agentId + AgentId = agentId, + UserId = userId, }; converation = await NewConversation(sess); } From da90856638f0e791247355669a271b1f25155494 Mon Sep 17 00:00:00 2001 From: AnonymousDotNet <18776095145@163.com> Date: Fri, 29 Nov 2024 17:08:27 +0800 Subject: [PATCH 2/2] fix: Add regionCode verification --- .../BotSharp.Core/Users/Services/UserService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs index 0cddc5b7..9bc436a7 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs @@ -570,7 +570,7 @@ public class UserService : IUserService if (!string.IsNullOrEmpty(user.Phone)) { - record = db.GetUserByPhone(user.Phone); + record = db.GetUserByPhone(user.Phone, regionCode: user.RegionCode); } if (!string.IsNullOrEmpty(user.Email)) @@ -745,7 +745,7 @@ public class UserService : IUserService await Task.CompletedTask; return true; } - + public async Task RemoveDashboardConversation(string userId, string conversationId) { var db = _services.GetRequiredService();