#include "SMSMessage.h"
#include <QDataStream>



CSMSMessage::CSMSMessage()
{
    this->mContact = "INVALID";
    this->mDateTime = QDateTime::currentDateTime();
    this->mDID = "INVALID";
    this->mMessageText = "INVALID";
    this->mType = SMS_INVALID_TYPE;
    this->mVOIPMSDatabaseID = "INVALID";
}

QDataStream &operator<<(QDataStream &out, const CSMSMessage &source)
{

    out << source.mDID
        << source.mDateTime
        << source.mMessageText
        << source.mContact
        << (qint32)source.mType
        << source.mVOIPMSDatabaseID;


    return out;
}

QDataStream &operator>>(QDataStream &in, CSMSMessage &dest)
{
    qint32 temp;
    in >> dest.mDID
       >> dest.mDateTime
       >> dest.mMessageText
       >> dest.mContact
       >> temp
       >> dest.mVOIPMSDatabaseID;

    dest.mType = (eSMSType)temp;

    return in;
}
