<commit_before>package com.google.codeu.chatme.presenter;

import android.util.Log;

import com.google.codeu.chatme.model.Conversation;
import com.google.codeu.chatme.view.adapter.UserListAdapter;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

public class CreateConversationPresenter implements CreateConversationInteractor {

    private static final String TAG = ConversationsPresenter.class.getName();

    private DatabaseReference mRootRef = FirebaseDatabase.getInstance().getReference();
    private FirebaseAuth mAuth = FirebaseAuth.getInstance();
    /**
     * {@link UserListAdapter} reference to update list of conversations
     */
    private final UserListAdapter view;

    /**
     * Constructor to accept a reference to a recycler view adapter to bind
     * conversation data to views
     *
     * @param view {@link UserListAdapter} reference
     */
    public CreateConversationPresenter(UserListAdapter view) {
        this.view = view;
    }

    /**
     * Adds conversation to Firebase DB
     *
     * @param conversation
     */
    public void addConversation(Conversation conversation) {
        /* TODO: Check for existing conversation with same participants before adding to DB */

        mRootRef.child("conversations").child(conversation.getId()).setValue(conversation);
        Log.i(TAG, "addConversation:success");
    }

    /**
     * Generates a new conversation ID
     *
     * @return conversationId
     */
    public String newConversationId() {
        String conversationId = mRootRef.child("conversations").push().getKey();
        return conversationId;
    }

    /**
     * Gets the current user's ID
     *
     * @return userId
     */
    public String getUserId() {
        String userId = mAuth.getCurrentUser().getUid();
        return userId;

    }
}<commit_msg>extra space removed in CreateConversationPresenter<commit_after>package com.google.codeu.chatme.presenter;

import android.util.Log;

import com.google.codeu.chatme.model.Conversation;
import com.google.codeu.chatme.view.adapter.UserListAdapter;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

public class CreateConversationPresenter implements CreateConversationInteractor {

    private static final String TAG = ConversationsPresenter.class.getName();

    private DatabaseReference mRootRef = FirebaseDatabase.getInstance().getReference();
    private FirebaseAuth mAuth = FirebaseAuth.getInstance();
    /**
     * {@link UserListAdapter} reference to update list of conversations
     */
    private final UserListAdapter view;

    /**
     * Constructor to accept a reference to a recycler view adapter to bind
     * conversation data to views
     *
     * @param view {@link UserListAdapter} reference
     */
    public CreateConversationPresenter(UserListAdapter view) {
        this.view = view;
    }

    /**
     * Adds conversation to Firebase DB
     *
     * @param conversation
     */
    public void addConversation(Conversation conversation) {
        /* TODO: Check for existing conversation with same participants before adding to DB */

        mRootRef.child("conversations").child(conversation.getId()).setValue(conversation);
        Log.i(TAG, "addConversation:success");
    }

    /**
     * Generates a new conversation ID
     *
     * @return conversationId
     */
    public String newConversationId() {
        String conversationId = mRootRef.child("conversations").push().getKey();
        return conversationId;
    }

    /**
     * Gets the current user's ID
     *
     * @return userId
     */
    public String getUserId() {
        String userId = mAuth.getCurrentUser().getUid();
        return userId;
    }
}
{'fraction_non_alphanumeric': 0.09282051282051282, 'fraction_numerical': 0.0, 'mean_word_length': 3.1946236559139787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2658636', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1023, 'n_words': 258}