public async Task MergeSession(SocketMessage socketMessage) { var session = await GetThisRoomChatSession(socketMessage); if (session == null) { return; } if (!Userhelper.IsAdmin(socketMessage)) { await SessionMessages.CannotMergeBcsPermission(socketMessage, session); return; } if (session.RoboChat.NumberOfMessagesInCurrentSession == 0) { await SessionMessages.CannotMergeBcsEmptySession(socketMessage, session); return; } session.RoboChat.MergeSession(); await SessionMessages.MergedSession(socketMessage, session); }
public async Task ReadyToMerge(SocketMessage socketMessage, IMessageChannel messageChannel) { var session = await GetThisRoomChatSession(socketMessage); if (session == null) { return; } if (session.SessionOwner != Userhelper.GetFullUsername(socketMessage) && !Userhelper.IsAdmin(socketMessage)) { await SessionMessages.CannotSetAsReadyToMerge(socketMessage, session); return; } await SessionMessages.ReadyToMergeSession(socketMessage, session, messageChannel); }
public async Task DeleteSession(SocketMessage socketMessage) { var session = await GetThisRoomChatSession(socketMessage); if (session == null) { return; } if (session.SessionOwner != Userhelper.GetFullUsername(socketMessage) && !Userhelper.IsAdmin(socketMessage)) { await SessionMessages.CannotDeleteSessionBcsPermission(socketMessage, session); return; } session.RoboChat.DeleteSession(); chatSessions.Remove(session); await SessionMessages.DeletedSession(socketMessage, session); }