<commit_before>Template.commentForm.events({
    'submit .ui.comment.form': function (event) {
        event.preventDefault();

        var offerId = FlowRouter.getParam('offerId'),
            $comment = $(event.target).find('.field .input'),
            commentAttributes = {
                offerId: offerId,
                comment: $comment.val()
            };

        Meteor.call('postComment', commentAttributes, function(error) {
           if (error) {
               return console.error(error.reason);
           } else {
               $comment.val('');
           }
        });
    }
});
<commit_msg>added psuedocode for getting receiverId for comment<commit_after>Template.commentForm.events({
    'submit .ui.comment.form': function (event) {
        event.preventDefault();

        var offerId = FlowRouter.getParam('offerId'),
            $comment = $(event.target).find('.field .input'),
            commentAttributes = {
                offerId: offerId,
                comment: $comment.val()
            };

        // @TODO: getReceiver() =>
        // if currentUser !== selectedItemOwner
        //   receiverId = selectedItemOwner
        // else
        //   if currentUser !== offeredItemOwner
        //      receiverId = offeredItemOwner

        Meteor.call('postComment', commentAttributes, function(error) {
           if (error) {
               return console.error(error.reason);
           } else {
               $comment.val('');
           }
        });
    }
});

{'fraction_non_alphanumeric': 0.13138686131386862, 'fraction_numerical': 0.0, 'mean_word_length': 1.697674418604651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5393098', 'n_tokens_mistral': 390, 'n_tokens_neox': 382, 'n_words': 71}