<commit_before>    var user_id = Titanium.App.Properties.getString('currentUser'),
    userFound = false;

    TT.log('Loading Profile Data: ' + user_id);
    TT.ping('show.profile');

    TT.showLoading('Fetching Statuses');

    TT.fetchURL('statuses/user_timeline/' + user_id + '.json', {
        onload: function() {
            TT.log('Fetched user Statuses');
            TT.showLoading('Parsing Statuses...');
            var json = eval('(' + this.responseText + ')'),
                set = true, c = 0, row, info,
                data = [],
                ul = Y.one('#status ul');

            for (c = 0; c < json.length; c++) {
                info = TT.formatTimelineRow(json[c]);
                if (!userFound) {
                    userFound = json[c].user;
                    TT.formatProfileHeader(json[c].user);
                    document.title += ': ' + json[c].user.name;

                    if (json[c].geo) {
                        var geo = Y.one('#status a.geo');
                        geo.set('href', geo.get('href') + json[c].geo.coordinates[0] + ',' + json[c].geo.coordinates[1]);
                        geo.removeClass('hidden');
                    }
                    
                }
                var txt = TT.filterStatus(info.message);
                
                ul.append('<li id="' + info.id + '" class="status"><h4>' + info.header + '</h4>' + txt + '</li>');
            }
            
            TT.hideLoading();
        }
    });

    var menu = Titanium.UI.createMenu();

    menu.addItem("Reply", function() {
        
        Titanium.App.Properties.setString('replyTo', userFound.screen_name);
        TT.log('Reply to: ' + userFound.screen_name);
        
        TT.openWindow('post.html');
    }/*, Titanium.UI.Android.SystemIcon.REPLY*/);
    
    if (userFound.following) {
        menu.addItem("Direct Message", function() {
            TT.log('Menu: Direct Message');
            Titanium.App.Properties.setString('directTo', userFound.screen_name);
            TT.log('Direct Message To: ' + userFound.screen_name);
            
            TT.openWindow('post.html');
        }/*, Titanium.UI.Android.SystemIcon.SEND*/);
        menu.addItem("Unfollow", function() {
            TT.log('Menu: Unfollow');
            TT.showLoading('Unfollowing ' + userFound.name);
            TT.fetchURL('friendships/destroy/' + userFound.id + '.json', {
                type: 'POST',
                onload: function() {
                    TT.hideLoading();
                }
            });
        }/*, Titanium.UI.Android.SystemIcon.SEND*/);
    } else {
        var followMenu = menu.addItem("Follow", function() {
            TT.log('Menu: Follow');
            TT.showLoading('Following ' + userFound.name);
            TT.fetchURL('friendships/create.json?user_id=' + userFound.id + '&follow=true', {
                type: 'POST',
                data: {
                    user_id: userFound.id,
                    follow: true
                },
                onload: function() {
                    TT.hideLoading();
                    //TODO
                    followMenu.setLabel('Unfollow');
                }
            });
        }/*, Titanium.UI.Android.SystemIcon.SEND*/);
    }
    
    menu.addItem("Report Spam", function() {
        TT.log('Menu: Report Spam');
        TT.not('Spam reporting');
    }/*, Titanium.UI.Android.SystemIcon.SEND*/);


    var creds = TT.getCreds();
    if (creds.login !== userFound.screen_name) {
        Titanium.UI.setMenu(menu);
    }
<commit_msg>Added status menu to profile page. closes #23<commit_after>    var user_id = Titanium.App.Properties.getString('currentUser'),
    userFound = false;

    TT.log('Loading Profile Data: ' + user_id);
    TT.ping('show.profile');

    TT.showLoading('Fetching Statuses');

    TT.fetchURL('statuses/user_timeline/' + user_id + '.json', {
        onload: function() {
            TT.log('Fetched user Statuses');
            TT.showLoading('Parsing Statuses...');
            var json = eval('(' + this.responseText + ')'),
                set = true, c = 0, row, info,
                data = [],
                ul = Y.one('#status ul');

            for (c = 0; c < json.length; c++) {
                info = TT.formatTimelineRow(json[c]);
                if (!userFound) {
                    userFound = json[c].user;
                    fetchMenu();
                    TT.formatProfileHeader(json[c].user);
                    document.title += ': ' + json[c].user.name;

                    if (json[c].geo) {
                        var geo = Y.one('#status a.geo');
                        geo.set('href', geo.get('href') + json[c].geo.coordinates[0] + ',' + json[c].geo.coordinates[1]);
                        geo.removeClass('hidden');
                    }
                    
                }
                var txt = TT.filterStatus(info.message);
                
                ul.append('<li id="' + info.id + '" class="status"><h4>' + info.header + '</h4>' + txt + '</li>');
            }
            
            TT.hideLoading();
        }
    });

    var menu = Titanium.UI.createMenu();

    menu.addItem("Reply", function() {
        
        Titanium.App.Properties.setString('replyTo', userFound.screen_name);
        TT.log('Reply to: ' + userFound.screen_name);
        
        TT.openWindow('post.html');
    });
    
    var createMenu = function(data) {
        TT.log('create status menu');
        var rel = data.relationship,
            tar = rel.target, src = rel.source;
        
        if (src.following && src.followed_by) {
            var title = 'Direct Message';
            menu.addItem(title, function() {
                TT.log('Menu: Direct Message');
                Titanium.App.Properties.setString('directTo', userFound.screen_name);
                TT.log('Direct Message To: ' + userFound.screen_name);
                
                TT.openWindow('post.html');   
            });
        }

        if (src.following) {
            menu.addItem("Unfollow", function() {
                TT.log('Menu: Unfollow');
                TT.showLoading('Unfollowing ' + userFound.name);
                TT.fetchURL('friendships/destroy/' + userFound.id + '.json', {
                    type: 'POST',
                    onload: function() {
                        TT.hideLoading();
                    }
                });
            });
        } else {
            menu.addItem("Follow", function() {
                TT.log('Menu: Follow');
                TT.showLoading('Following ' + userFound.name);
                TT.fetchURL('friendships/create/' + userFound.id + '.json?follow=true', {
                    type: 'POST',
                    data: {
                        follow: true
                    },
                    onload: function() {
                        TT.hideLoading();
                    }
                });
                
            });
        }
        
    };


    
    var fetchMenu = function() {
        var creds = TT.getCreds();
        if (creds.login !== userFound.screen_name) {
            Titanium.UI.setMenu(menu);
        }
        TT.log('Fetching Friendship Status');
        TT.log(Y.JSON.stringify(userFound));
        TT.fetchURL('friendships/show.json?target_id=' + userFound.id + '&source_id=' + creds.userid, {
            type: 'GET',
            onload: function() {
                var json = eval('(' + this.responseText + ')');
                createMenu(json);
            }
        });
    }
{'fraction_non_alphanumeric': 0.15050079072219294, 'fraction_numerical': 0.0018450184501845018, 'mean_word_length': 1.3947617544966866, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7021984', 'n_tokens_mistral': 2242, 'n_tokens_neox': 2060, 'n_words': 346}