Added missed call property to phone calls.
authorJamie Thompson <jamie@.(none)>
Sun, 2 Oct 2011 22:07:07 +0000 (23:07 +0100)
committerJamie Thompson <jamie@.(none)>
Sun, 2 Oct 2011 22:07:07 +0000 (23:07 +0100)
EventTypes/PhoneCall.cpp
EventTypes/PhoneCall.h

index be07b32..df8387a 100644 (file)
@@ -75,9 +75,9 @@ PhoneCall::PhoneCall(const Settings &settings, const RTComElEvent &event, const
        qDebug() << "Created new Phone Call from RtCom:\n" << *this;
 }
 
-PhoneCall::PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime &timestamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments) :
+PhoneCall::PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime &timestamp, const QString &tel, const int durationInSeconds, const bool isMissedCall, const AttachmentCollection &attachments) :
        m_Settings(settings), m_Destination(destination), m_Timestamp(timestamp), m_Tel(tel),
-       m_DurationInSeconds(durationInSeconds), m_Attachments(attachments)
+       m_DurationInSeconds(durationInSeconds), m_IsMissedCall(isMissedCall), m_Attachments(attachments)
 {
        if(Tel().indexOf("0") == 0)
                Tel(QString(Tel()).replace(QRegExp("^0"), "+44"));
@@ -123,6 +123,8 @@ RTComElEvent * PhoneCall::toRTComEvent(const NumberToNameLookup &numberToNameLoo
        RTCOM_EL_EVENT_SET_FIELD (event, service, g_strdup("RTCOM_EL_SERVICE_CALL"));
        if(voiceMailList.contains(Tel()))
                RTCOM_EL_EVENT_SET_FIELD (event, event_type, g_strdup("RTCOM_EL_EVENTTYPE_CALL_VOICEMAIL"));
+       else if(IsMissedCall())
+               RTCOM_EL_EVENT_SET_FIELD (event, event_type, g_strdup("RTCOM_EL_EVENTTYPE_CALL_MISSED"));
        else
                RTCOM_EL_EVENT_SET_FIELD (event, event_type, g_strdup("RTCOM_EL_EVENTTYPE_CALL"));
        RTCOM_EL_EVENT_SET_FIELD (event, start_time, Timestamp().toUTC().toTime_t());
index e805927..8fea880 100644 (file)
@@ -40,7 +40,7 @@ namespace EventTypes
                virtual const DBBackends::iDBBackend &DB() const;
 
                PhoneCall(const Settings &settings);
-               PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime &timestamp, const QString &tel, int durationInSeconds, const AttachmentCollection &attachments = AttachmentCollection());
+               PhoneCall(const Settings &settings, const Settings::eDirection destination, const QDateTime &timestamp, const QString &tel, const int durationInSeconds, const bool isMissedCall, const AttachmentCollection &attachments = AttachmentCollection());
                ~PhoneCall();
 
                virtual const uint HashCode() const;
@@ -60,6 +60,9 @@ namespace EventTypes
                virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
                virtual AttachmentCollection & Attachments() { return m_Attachments; }
 
+               const bool IsMissedCall() const { return m_IsMissedCall; }
+               void IsMissedCall(const bool isMissedCall) { m_IsMissedCall = isMissedCall; }
+
        public:
                virtual void Export(const QString &baseDirectory, const NumberToNameLookup &numberToNameLookup) const;
                PhoneCall(const Settings &settings, const RTComElEvent& event, const QList<RTComElAttachment*> attachments = QList<RTComElAttachment*>());
@@ -74,6 +77,7 @@ namespace EventTypes
                QDateTime m_Timestamp;
                QString m_Tel;
                int m_DurationInSeconds;
+               bool m_IsMissedCall;
                AttachmentCollection m_Attachments;
        };
 }