<commit_before>Controllers.controller("LoginCtrl",
    ["$scope", "$http", "$rootScope", "$location", "$timeout", "$filter",
    "$cookies", "Connection", "User", "Channel", "Parser",
    function ($scope, $http, $rootScope, $location, $timeout, $filter,
    $cookies, Connection, User, Channel, Parser)
    {
        var mustKill = false;
        Connection.close();
        $scope.displayModal = false;
        $scope.modalOpts =
            {
                backdropFade: true,
                dialogFade: true
            };
        $scope.user = User.get("~");
        $scope.user.nickName = $cookies.nickName;
        if ($cookies.color)
        {
            $scope.user.color = $cookies.color;
        }

        $location.hash("");

        $http.jsonp("http://freegeoip.net/json/?callback=JSON_CALLBACK")
        .success(function (data)
        {
            $scope.user.country = data.country_name;
            $scope.user.flag = data.country_code;
        });

        $scope.openModal = function ()
        {
            $scope.displayModal = true;
        }

        $scope.closeModal = function ()
        {
            $scope.displayModal = false;
        }

        $rootScope.$on("err_nicknameinuse", function (evt)
        {
            if ($scope.user.password)
            {
               Connection.send("NICK " + $scope.user.nickName + "_");

                mustKill = true;

                return;
            }

            Connection.close();
            $scope.connecting = false;
            $scope.openModal();
        });

        $scope.connecting = false;

        $scope.login = function ()
        {
            User.register($scope.user.nickName);
            User.alias("~", $scope.user.nickName);
            if ($scope.connecting === false)
            {
                $scope.connecting = true;
                var hostToken = "";

                $http.jsonp("http://kaslai.us/coldstorm/fixip.php?nick=" +
                    encodeURI($scope.user.nickName) + "&random=" +
                    Math.floor(Math.random() * 10000000));

                $cookies.nickName = $scope.user.nickName;
                $cookies.color = $scope.user.color;

                hostToken = md5($scope.user.nickName);

                if (VERSION == "local")
                {
                    Connection.connect("ws://frogbox.es:82");
                } else
                {
                    Connection.connect("ws://frogbox.es:81");
                }

                Connection.onOpen(function ()
                {
                    Connection.send("NICK " + $scope.user.nickName);
                    Connection.send("USER " +
                        $scope.user.color.substring(1).toUpperCase() +
                        $scope.user.flag + " - - :New coldstormer");

                    Connection.onWelcome(function ()
                    {
                        if (mustKill)
                        {
                            Connection.send("PRIVMSG NickServ :GHOST " +
                                $scope.user.nickName + " " +
                                $scope.user.password);
                        }

                        if ($scope.user.password)
                        {
                            Connection.send("PRIVMSG NickServ :identify " +
                                $scope.user.password);
                        }

                        if (hostToken)
                        {
                            Connection.send("PRIVMSG Jessica :~fixmyip " +
                                hostToken);
                        }
                    });
                });

                Connection.onMessage(function (message)
                {
                    if (message.indexOf("NOTICE " + $scope.user.nickName +
                        " :Tada") > -1 && $scope.connecting == true)
                    {
                        if (VERSION == "local")
                        {
                            var test = Channel.register("#test");

                            test.join();

                            $location.path("/channels/#test");
                        } else
                        {
                            var cs = Channel.register("#Coldstorm");<commit_msg>Fixed bug after confirming token<commit_after>Controllers.controller("LoginCtrl",
    ["$scope", "$http", "$rootScope", "$location", "$timeout", "$filter",
    "$cookies", "Connection", "User", "Channel", "Parser",
    function ($scope, $http, $rootScope, $location, $timeout, $filter,
    $cookies, Connection, User, Channel, Parser)
    {
        var mustKill = false;
        Connection.close();
        $scope.displayModal = false;
        $scope.modalOpts =
            {
                backdropFade: true,
                dialogFade: true
            };
        $scope.user = User.get("~");
        $scope.user.nickName = $cookies.nickName;
        if ($cookies.color)
        {
            $scope.user.color = $cookies.color;
        }

        $location.hash("");

        $http.jsonp("http://freegeoip.net/json/?callback=JSON_CALLBACK")
        .success(function (data)
        {
            $scope.user.country = data.country_name;
            $scope.user.flag = data.country_code;
        });

        $scope.openModal = function ()
        {
            $scope.displayModal = true;
        }

        $scope.closeModal = function ()
        {
            $scope.displayModal = false;
        }

        $rootScope.$on("err_nicknameinuse", function (evt)
        {
            if ($scope.user.password)
            {
               Connection.send("NICK " + $scope.user.nickName + "_");

                mustKill = true;

                return;
            }

            Connection.close();
            $scope.connecting = false;
            $scope.openModal();
        });

        $scope.connecting = false;

        $scope.login = function ()
        {
            User.register($scope.user.nickName);
            User.alias("~", $scope.user.nickName);
            if ($scope.connecting === false)
            {
                $scope.connecting = true;
                var hostToken = "";

                $http.jsonp("http://kaslai.us/coldstorm/fixip.php?nick=" +
                    encodeURI($scope.user.nickName) + "&random=" +
                    Math.floor(Math.random() * 10000000));

                $cookies.nickName = $scope.user.nickName;
                $cookies.color = $scope.user.color;

                hostToken = md5($scope.user.nickName);

                if (VERSION == "local")
                {
                    Connection.connect("ws://frogbox.es:82");
                } else
                {
                    Connection.connect("ws://frogbox.es:81");
                }

                Connection.onOpen(function ()
                {
                    Connection.send("NICK " + $scope.user.nickName);
                    Connection.send("USER " +
                        $scope.user.color.substring(1).toUpperCase() +
                        $scope.user.flag + " - - :New coldstormer");

                    Connection.onWelcome(function ()
                    {
                        if (mustKill)
                        {
                            Connection.send("PRIVMSG NickServ :GHOST " +
                                $scope.user.nickName + " " +
                                $scope.user.password);
                        }

                        if ($scope.user.password)
                        {
                            Connection.send("PRIVMSG NickServ :identify " +
                                $scope.user.password);
                        }

                        if (hostToken)
                        {
                            Connection.send("PRIVMSG Jessica :~fixmyip " +
                                hostToken);
                        }
                    });
                });

                Connection.onMessage(function (message)
                {
                    if (message.indexOf("NOTICE " + $scope.user.nickName +
                        " :Tada") > -1)
                    {
                        if (VERSION == "local")
                        {
                            var test = Channel.register("#test");

                            test.join();

                            $location.path("/channels/#test");
                        } else
                        {
                            var cs = Channel.register("#Coldstorm");
{'fraction_non_alphanumeric': 0.12459016393442623, 'fraction_numerical': 0.00351288056206089, 'mean_word_length': 1.0491842610364683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '95608', 'n_tokens_mistral': 2216, 'n_tokens_neox': 2052, 'n_words': 307}