My scenario is to send an event or message to user's session to check if he is active or not. I have the conversationId, Bot Channel Account and user connection details already. I followed the same steps as mentioned here.
The issue that see is, irrespective of whether user is active or not, i always get ConversationId as the response, which does'nt help me to determine the session availability. I think, my event or message is getting ignored if session is not available.
Can somebody help me here please?
Adding more information :
My requirement is to update the status of all the inactive users. I have all the respective conversationIds of the sessions that these users were part of. To determine whether user is still active on web chat(meaning, he has'nt closed the webchat window), I am sending an event activity from bot to that user's session by providing the conversationId that we have for that session. Below is the sample code snippet.
var eventActivity = Activity.CreateEventActivity();
eventActivity.From = user.Bot.ChannelAccount;
eventActivity.Recipient = user.Connection.ChannelAccount;
eventActivity.Conversation = user.Connection.ConversationAccount;
eventActivity.Value = userSession;
eventActivity.Name = message.Name;
var connector = new ConnectorClient(new Uri(user.Connection.ServiceLink));
var response = await connector.Conversations.SendToConversationAsync((Activity)eventActivity).ConfigureAwait(false);
userSession here contains two properties UPN and ConversationId that uniquely identifies the session. Also, This UserSession's ConversationId is same as user.Connection.ConversationAccount.ConversationId. Below image contains the User.Bot and user.Connection objects.