예제 #1
0
        public static void GetUrlProfileOf(string userName, ChatPlatform platform, out bool found, out string url)
        {
            url   = "";
            found = false;
            switch (platform)
            {
            case ChatPlatform.Twitch:
                url = "https://www.twitch.tv/" + userName;


                found = true; break;

            case ChatPlatform.Youtube:
                url = "https://www.youtube.com/results?search_query=" + userName.Replace("+", " ");

                found = true; break;

            case ChatPlatform.Facebook:
                url = "https://www.facebook.com/" + userName;

                found = true; break;

            case ChatPlatform.LinkedIn:
                url = "https://www.linkedin.com/search/results/all/?keywords=" + userName.Replace("+", " ") + "&origin=GLOBAL_SEARCH_HEADER";

                found = true; break;

            case ChatPlatform.Periscope:
                url   = "https://www.periscope.tv/" + userName;
                found = true;
                break;

            case ChatPlatform.DLive:
                url   = "https://dlive.tv/" + userName;
                found = true;

                break;

            case ChatPlatform.RestreamInitMessage:
            case ChatPlatform.Restream:
            case ChatPlatform.Mockup:
            case ChatPlatform.Unknow:
            case ChatPlatform.Discord:
            default:
                found = false;
                break;
            }
        }
예제 #2
0
    public void AddToMessageCount(RestreamChatMessage message)
    {
        ChatPlatform platform = message.Platform;

        switch (platform)
        {
        case ChatPlatform.Twitch:
            m_twitch++;
            if (m_txtTwitch != null)
            {
                m_txtTwitch.text = "" + m_twitch;
            }
            break;

        case ChatPlatform.Youtube:
            m_youtube++;
            if (m_txtYoutube != null)
            {
                m_txtYoutube.text = "" + m_youtube;
            }
            break;

        case ChatPlatform.Facebook:
            m_facebook++;
            if (m_txtFacebook != null)
            {
                m_txtFacebook.text = "" + m_facebook;
            }
            break;

        case ChatPlatform.Discord:
            m_discord++;
            if (m_txtDiscord != null)
            {
                m_txtDiscord.text = "" + m_discord;
            }
            break;

        case ChatPlatform.LinkedIn:
            m_linkedin++;
            if (m_txtLinkedin != null)
            {
                m_txtLinkedin.text = "" + m_linkedin;
            }
            break;

        case ChatPlatform.Periscope:
            m_periscope++;
            if (m_txtPeriscope != null)
            {
                m_txtPeriscope.text = "" + m_periscope;
            }
            break;

        case ChatPlatform.DLive:
            m_dlive++;
            if (m_txtDlive != null)
            {
                m_txtDlive.text = "" + m_dlive;
            }
            break;

        default:
            break;
        }
        m_allCount++;
        if (m_txtAllCount != null)
        {
            m_txtAllCount.text = "" + m_allCount;
        }
    }
 public static RestreamChatMessage[] GetMessagesOfPlatform(ChatPlatform platform)
 {
     return(Memory.Messages.Where(p => p.Platform == platform).OrderBy(p => p.Timestamp).ToArray());
 }
        public static RestreamChatMessage CreateInstance(string pseudo, string message, ChatPlatform platform = ChatPlatform.Mockup)
        {
            RestreamChatMessage msg = new RestreamChatMessage(pseudo, message);

            msg.SetPlatform(platform);
            return(msg);
        }
예제 #5
0
 public void SetPlatform(ChatPlatform platform)
 {
     m_platformId = platform;
 }
예제 #6
0
 public RestreamChatUser(string userName, ChatPlatform platform) : this(userName)
 {
     Platform = platform;
     UserName = userName;
 }
예제 #7
0
 public UserIdentifier(ChatPlatform platform, string userName)
 {
     _platformId = platform;
     _userName   = userName;
 }
 public RestreamChatMessage(string userName, string message, ChatPlatform platform) : this(userName, message)
 {
     Platform = platform;
 }
예제 #9
0
 public static void KeepPlatform(IEnumerable <ChatVote> poll, out IEnumerable <ChatVote> result, ChatPlatform platform)
 {
     result = poll.Where(k => k.m_user.Platform == platform);
 }
예제 #10
0
        public static RestreamChatMessage CreateFakeMessage(string userName, string message, ChatPlatform mockup)
        {
            RestreamChatMessage chatMessage = new RestreamChatMessage(userName, message);

            chatMessage.SetPlatform(mockup);
            chatMessage.SetDateToNow();
            return(chatMessage);
        }