<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows;
using System.Net;
using System.Web;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Cloudsdale.actions;
using Cloudsdale.actions.MessageController;
using Cloudsdale.connection;
using Cloudsdale.lib;

namespace Cloudsdale
{
    public partial class Main : Form
    {

        public bool SettingsVisible;
        public static Main Instance;
        public static JObject User;
        public static JToken CurrentCloud;
        public static Regex LinkRegex = new Regex(@"(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'"".,<>?«»“”‘’]))", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        public bool DirectedToHome;
        

        public Main()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {


            this.Width = 695;
            LoginPanel.BringToFront();
            LoginPanel.Dock = DockStyle.Fill;
            if (LoginPanel.Visible == true) { this.MaximizeBox = false; }
            Subscriber.Visible = true;

        }
        private void ActivateMenuHover(object sender, EventArgs e)
        {
            ViewTimer.Start();
            
        }
        private void SettingsLeft(object sender, EventArgs e)
        {
            if (SettingsVisible == false) { SettingsPanel.Height = 0; }
        }
        private void SettingsHover(object sender, EventArgs e)
        {
            SettingsVisible = true;
            SettingsPanel.Height = 230;
        }
        private void ShowSettings(object sender, EventArgs e)
        {
            var SettingsNewSize = SettingsPanel.Height;
            if (SettingsNewSize >= 230)
            {
                SettingsPanel.Height = 230;
                ViewTimer.Stop();
            }
            else
            {
                SettingsNewSize += 5 * ((SettingsNewSize + 4/3) / 2);
                SettingsPanel.Height = SettingsNewSize;
            }
        }
        private async void button1_Click(object sender, EventArgs e)
        {
            try
            {
                this.Text = "Logging in...";
                Login.Enabled = false;
                Register.Enabled = false;
                Email.ReadOnly = true;
                Password.ReadOnly = true;
                await LoginRequest();
                this.Text = "Login succesful.";
                this.AcceptButton = m_SendMessage;
                this.MaximizeBox = true;
                Connection.MessageReceived += o =>
                {
                    if (o["data"] == null) return;
                    var cloudId = ((string)o["channel"]).Split('/')[2];
                    LogMessage(o["data"], cloudId);
                    var source = MessageSource.GetSource(cloudId);
                    LoadMessageToSource(source, o["data"], cloudId);
                };
                await Connection.InitializeAsync();
                this.Text = "Loading clouds...";
                await PreloadMessages((JArray)Main.User["user"]["clouds"]);
                h_avatar.ImageLocation = User["user"]["avatar"]["normal"].ToString();
                h_avatar.SizeMode = PictureBoxSizeMode.Zoom;
                Login.Enabled = true;
                Register.Enabled = true;
                Email.ReadOnly = false;
                Password.ReadOnly = false;
                LoginPanel.Visible = false;
                //UserCheck.Authorize(User["user"]["name"].ToString());
                //Discord's fault.
                MessageGroup.Text = "Welcome back, " + User["user"]["name"] + "!";
                var calDate = User["user"]["member_since"].ToString();
                var newDate = calDate.Replace("+0000", "");
                h_memberSince.Text = "Member since " + newDate;
                h_message.Text = h_message.Text.Replace("[:user:]", User["user"]["name"].ToString());
                RedirectHome(true);

                
            }<commit_msg>Slight change.<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows;
using System.Net;
using System.Web;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Cloudsdale.actions;
using Cloudsdale.actions.MessageController;
using Cloudsdale.connection;
using Cloudsdale.lib;

namespace Cloudsdale
{
    public partial class Main : Form
    {

        public bool SettingsVisible;
        public static Main Instance;
        public static JObject User;
        public static JToken CurrentCloud;
        public static Regex LinkRegex = new Regex(@"(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'"".,<>?«»“”‘’]))", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        public bool DirectedToHome;
        

        public Main()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {


            this.Width = 695;
            LoginPanel.BringToFront();
            LoginPanel.Dock = DockStyle.Fill;
            if (LoginPanel.Visible == true) { this.MaximizeBox = false; }
            Subscriber.Visible = true;

        }
        private void ActivateMenuHover(object sender, EventArgs e)
        {
            ViewTimer.Start();
            
        }
        private void SettingsLeft(object sender, EventArgs e)
        {
            if (SettingsVisible == false) { SettingsPanel.Height = 0; }
        }
        private void SettingsHover(object sender, EventArgs e)
        {
            SettingsVisible = true;
            SettingsPanel.Height = 230;
        }
        private void ShowSettings(object sender, EventArgs e)
        {
            var SettingsNewSize = SettingsPanel.Height;
            if (SettingsNewSize >= 230)
            {
                SettingsPanel.Height = 230;
                ViewTimer.Stop();
            }
            else
            {
                SettingsNewSize += 5 * ((SettingsNewSize + 4/3) / 2);
                SettingsPanel.Height = SettingsNewSize;
            }
        }
        private async void button1_Click(object sender, EventArgs e)
        {
            try
            {
                this.Text = "Logging in...";
                Login.Enabled = false;
                Register.Enabled = false;
                Email.ReadOnly = true;
                Password.ReadOnly = true;
                await LoginRequest();
                this.Text = "Login succesful!";
                this.AcceptButton = m_SendMessage;
                this.MaximizeBox = true;
                Connection.MessageReceived += o =>
                {
                    if (o["data"] == null) return;
                    var cloudId = ((string)o["channel"]).Split('/')[2];
                    LogMessage(o["data"], cloudId);
                    var source = MessageSource.GetSource(cloudId);
                    LoadMessageToSource(source, o["data"], cloudId);
                };
                await Connection.InitializeAsync();
                this.Text = "Loading clouds...";
                await PreloadMessages((JArray)Main.User["user"]["clouds"]);
                h_avatar.ImageLocation = User["user"]["avatar"]["normal"].ToString();
                h_avatar.SizeMode = PictureBoxSizeMode.Zoom;
                Login.Enabled = true;
                Register.Enabled = true;
                Email.ReadOnly = false;
                Password.ReadOnly = false;
                LoginPanel.Visible = false;
                //UserCheck.Authorize(User["user"]["name"].ToString());
                //Discord's fault.
                MessageGroup.Text = "Welcome back, " + User["user"]["name"] + "!";
                var calDate = User["user"]["member_since"].ToString();
                var newDate = calDate.Replace("+0000", "");
                h_memberSince.Text = "Member since " + newDate;
                h_message.Text = h_message.Text.Replace("[:user:]", User["user"]["name"].ToString());
                RedirectHome(true);

                
            }
{'fraction_non_alphanumeric': 0.13836406833352188, 'fraction_numerical': 0.0076931779613078404, 'mean_word_length': 1.783375314861461, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6967853', 'n_tokens_mistral': 2462, 'n_tokens_neox': 2366, 'n_words': 477}