// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_ID = "id";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Image = "image";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Message = "message";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Name = "name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Next_Message = "next_message";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Next_SubName = "next_sub_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Original_ID = "original_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Prev_Message = "prev_message";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Prev_SubName = "prev_sub_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_SubName = "sub_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Time = "time";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Table_Recalled_Messages = "recalls";


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import static com.qsboy.antirecall.db.DBHelper.Column_ID;
import static com.qsboy.antirecall.db.DBHelper.Column_Image;
import static com.qsboy.antirecall.db.DBHelper.Column_Message;
import static com.qsboy.antirecall.db.DBHelper.Column_Name;
import static com.qsboy.antirecall.db.DBHelper.Column_Next_Message;
import static com.qsboy.antirecall.db.DBHelper.Column_Next_SubName;
import static com.qsboy.antirecall.db.DBHelper.Column_Original_ID;
import static com.qsboy.antirecall.db.DBHelper.Column_Prev_Message;
import static com.qsboy.antirecall.db.DBHelper.Column_Prev_SubName;
import static com.qsboy.antirecall.db.DBHelper.Column_SubName;
import static com.qsboy.antirecall.db.DBHelper.Column_Time;
import static com.qsboy.antirecall.db.DBHelper.Table_Recalled_Messages;
    public long addMessage(String name, String subName, String message) {
        return this.addMessage(name, subName, message, new Date().getTime());
    }

    public long addMessage(String name, String subName, String message, long time) {
        if (subName == null || subName.equals(""))
            subName = name;
        createTableIfNotExists(name);
        ContentValues values = new ContentValues();
        values.put(Column_SubName, subName);
        values.put(Column_Message, message);
        values.put(Column_Time, time);
        return db.insert(getSafeName(name), null, values);
    }

    public void addRecall(Messages messages) {
        this.addRecall(messages.getId(), messages.getName(), messages.getSubName(), messages.getText(), messages.getTime(), messages.getImages());
    }

    public void addRecall(int originalID, String name, String subName, String message, long time, String images) {
        Log.d(TAG, "addRecall() called with: originalID = [" + originalID + "], name = [" + name + "], subName = [" + subName + "], message = [" + message + "], time = [" + time + "]");

        ContentValues values = new ContentValues();
        values.put(Column_Original_ID, originalID);
        values.put(Column_Name, name);
        values.put(Column_SubName, subName);
        values.put(Column_Message, message);
        values.put(Column_Time, time);
        values.put(Column_Image, images);

// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_ID = "id";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Image = "image";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Message = "message";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Name = "name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Next_Message = "next_message";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Next_SubName = "next_sub_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Original_ID = "original_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Prev_Message = "prev_message";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Prev_SubName = "prev_sub_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_SubName = "sub_name";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Column_Time = "time";
// 
// Path: app/src/main/java/com/qsboy/antirecall/db/DBHelper.java
// public static final String Table_Recalled_Messages = "recalls";


// Path: app/src/main/java/com/qsboy/antirecall/db/Dao.java
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import static com.qsboy.antirecall.db.DBHelper.Column_ID;
import static com.qsboy.antirecall.db.DBHelper.Column_Image;
import static com.qsboy.antirecall.db.DBHelper.Column_Message;
import static com.qsboy.antirecall.db.DBHelper.Column_Name;
import static com.qsboy.antirecall.db.DBHelper.Column_Next_Message;
import static com.qsboy.antirecall.db.DBHelper.Column_Next_SubName;
import static com.qsboy.antirecall.db.DBHelper.Column_Original_ID;
import static com.qsboy.antirecall.db.DBHelper.Column_Prev_Message;
import static com.qsboy.antirecall.db.DBHelper.Column_Prev_SubName;
import static com.qsboy.antirecall.db.DBHelper.Column_SubName;
import static com.qsboy.antirecall.db.DBHelper.Column_Time;
import static com.qsboy.antirecall.db.DBHelper.Table_Recalled_Messages;

    public long addMessage(String name, String subName, String message) {
        return this.addMessage(name, subName, message, new Date().getTime());
    }

    public long addMessage(String name, String subName, String message, long time) {
        if (subName == null || subName.equals(""))
            subName = name;
        createTableIfNotExists(name);
        ContentValues values = new ContentValues();
        values.put(Column_SubName, subName);
        values.put(Column_Message, message);
        values.put(Column_Time, time);
        return db.insert(getSafeName(name), null, values);
    }

    public void addRecall(Messages messages) {
        this.addRecall(messages.getId(), messages.getName(), messages.getSubName(), messages.getText(), messages.getTime(), messages.getImages());
    }

    public void addRecall(int originalID, String name, String subName, String message, long time, String images) {
        Log.d(TAG, "addRecall() called with: originalID = [" + originalID + "], name = [" + name + "], subName = [" + subName + "], message = [" + message + "], time = [" + time + "]");

        ContentValues values = new ContentValues();
        values.put(Column_Original_ID, originalID);
        values.put(Column_Name, name);
        values.put(Column_SubName, subName);
        values.put(Column_Message, message);
        values.put(Column_Time, time);
        values.put(Column_Image, images);

        db.insert(Table_Recalled_Messages, null, values);