PhoneCall::PhoneCall(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
m_Settings(settings)
{
- setDestination(event.fld_outgoing ? OUTGOING : INCOMING);
+ setDestination(event.fld_outgoing ? Settings::OUTGOING : Settings::INCOMING);
setTimestamp(QDateTime::fromTime_t(event.fld_start_time).toUTC());
setDurationInSeconds(QDateTime::fromTime_t(event.fld_start_time).toUTC().secsTo(QDateTime::fromTime_t(event.fld_end_time).toUTC()));
setTel(event.fld_remote_uid);
qDebug() << "Created new Phone Call from RtCom:\n" << *this;
}
-PhoneCall::PhoneCall(const Settings &settings, const eDestination destination, const QDateTime ×tamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments) :
+PhoneCall::PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime ×tamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments) :
m_Settings(settings), m_Destination(destination), m_Timestamp(timestamp), m_Tel(tel),
m_DurationInSeconds(durationInSeconds), m_Attachments(attachments)
{
RTCOM_EL_EVENT_SET_FIELD (event, end_time, Timestamp().addSecs(DurationInSeconds()).toUTC().toTime_t());
RTCOM_EL_EVENT_SET_FIELD (event, storage_time, Timestamp().addSecs(DurationInSeconds()).toUTC().toTime_t());
//RTCOM_EL_EVENT_SET_FIELD (event, is_read, 0);
- RTCOM_EL_EVENT_SET_FIELD (event, outgoing, Destination() == PhoneCall::OUTGOING ? 1 : 0);
+ RTCOM_EL_EVENT_SET_FIELD (event, outgoing, Destination() == Settings::OUTGOING ? 1 : 0);
//if(local_uid) // Voicemail local_uid transform needed here
RTCOM_EL_EVENT_SET_FIELD (event, local_uid, g_strdup("ring/tel/ring"));
//RTCOM_EL_EVENT_SET_FIELD (&event, local_name, g_strdup("<SelfHandle>"));
QDebug operator<<(QDebug dbg, PhoneCall& event)
{
- dbg.nospace() << "\tDirection:\t\t" << (event.Destination() == PhoneCall::OUTGOING ? "Made" : "Recieved") << "\n";
+ dbg.nospace() << "\tHash:\t\t" << event.HashCode() << "\n";
+ dbg.nospace() << "\tDirection:\t\t" << (event.Destination() == Settings::OUTGOING ? "Made" : "Recieved") << "\n";
dbg.nospace() << "\tTimestamp:\t" << event.Timestamp().toUTC() << "\n";
dbg.nospace() << "\tDuration:\t\t" << event.DurationInSeconds() << " seconds\n";
dbg.nospace() << "\tRemote-Tel:\t" << event.Tel() << "\n";