Пример #1
0
        private void RouteReceivedMessage(Dictionary <string, object> message)
        {
            // Should add more routing...
            // Potentially, use these routes to update the context, something like
            // case "user_joined" => update the context with new user, etc...
            switch (message.GetValueByKey("type"))
            {
            case EventTypes.ReconnectUrl:
                SlackContext.ReconnectUri = new Uri(message.GetValueByKey("url"));
                break;

            // All messages that should just be given to the user go here
            case EventTypes.Message:
            case EventTypes.UserTyping:
                _msgQueue.AddReceivedMessage(message);
                break;

            // All context related messages should go here
            default:
                break;
            }
        }