Merge lp:~boiko/history-service/rtm-store_remote_participant_id into lp:history-service/rtm-14.09

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Bill Filler
Approved revision: 175
Merged at revision: 175
Proposed branch: lp:~boiko/history-service/rtm-store_remote_participant_id
Merge into: lp:history-service/rtm-14.09
Diff against target: 388 lines (+85/-22)
10 files modified
Ubuntu/History/historyeventmodel.cpp (+6/-0)
Ubuntu/History/historyeventmodel.h (+1/-0)
daemon/historydaemon.cpp (+2/-0)
plugins/sqlite/schema/v11.sql (+6/-0)
plugins/sqlite/sqlitehistoryplugin.cpp (+9/-5)
src/tests/VoiceEventTest.cpp (+34/-12)
src/types.h (+1/-0)
src/voiceevent.cpp (+17/-5)
src/voiceevent.h (+7/-0)
src/voiceevent_p.h (+2/-0)
To merge this branch: bzr merge lp:~boiko/history-service/rtm-store_remote_participant_id
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+249226@code.launchpad.net

Commit message

Store the number that was used to call a given voice event.

Description of the change

Store the number that was used to call a given voice event.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Ubuntu/History/historyeventmodel.cpp'
--- Ubuntu/History/historyeventmodel.cpp 2015-01-09 11:59:27 +0000
+++ Ubuntu/History/historyeventmodel.cpp 2015-02-10 17:31:22 +0000
@@ -45,6 +45,7 @@
45 mRoles[TextReadSubjectRole] = "textSubject";45 mRoles[TextReadSubjectRole] = "textSubject";
46 mRoles[CallMissedRole] = "callMissed";46 mRoles[CallMissedRole] = "callMissed";
47 mRoles[CallDurationRole] = "callDuration";47 mRoles[CallDurationRole] = "callDuration";
48 mRoles[RemoteParticipantRole] = "remoteParticipant";
48}49}
4950
50int HistoryEventModel::rowCount(const QModelIndex &parent) const51int HistoryEventModel::rowCount(const QModelIndex &parent) const
@@ -153,6 +154,11 @@
153 result = voiceEvent.duration();154 result = voiceEvent.duration();
154 }155 }
155 break;156 break;
157 case RemoteParticipantRole:
158 if (!voiceEvent.isNull()) {
159 result = voiceEvent.remoteParticipant();
160 }
161 break;
156 }162 }
157163
158 return result;164 return result;
159165
=== modified file 'Ubuntu/History/historyeventmodel.h'
--- Ubuntu/History/historyeventmodel.h 2015-01-09 11:59:27 +0000
+++ Ubuntu/History/historyeventmodel.h 2015-02-10 17:31:22 +0000
@@ -46,6 +46,7 @@
46 TextMessageAttachmentsRole,46 TextMessageAttachmentsRole,
47 CallMissedRole,47 CallMissedRole,
48 CallDurationRole,48 CallDurationRole,
49 RemoteParticipantRole,
49 LastEventRole50 LastEventRole
50 };51 };
5152
5253
=== modified file 'daemon/historydaemon.cpp'
--- daemon/historydaemon.cpp 2014-09-23 12:30:29 +0000
+++ daemon/historydaemon.cpp 2015-02-10 17:31:22 +0000
@@ -363,6 +363,8 @@
363 event[History::FieldNewEvent] = missed; // only mark as a new (unseen) event if it is a missed call363 event[History::FieldNewEvent] = missed; // only mark as a new (unseen) event if it is a missed call
364 event[History::FieldMissed] = missed;364 event[History::FieldMissed] = missed;
365 event[History::FieldDuration] = duration;365 event[History::FieldDuration] = duration;
366 // FIXME: check what to do when there are more than just one remote participant
367 event[History::FieldRemoteParticipant] = participants[0];
366 writeEvents(QList<QVariantMap>() << event);368 writeEvents(QList<QVariantMap>() << event);
367}369}
368370
369371
=== added file 'plugins/sqlite/schema/v11.sql'
--- plugins/sqlite/schema/v11.sql 1970-01-01 00:00:00 +0000
+++ plugins/sqlite/schema/v11.sql 2015-02-10 17:31:22 +0000
@@ -0,0 +1,6 @@
1ALTER TABLE voice_events ADD COLUMN remoteParticipant varchar(255);
2UPDATE voice_events SET remoteParticipant=(SELECT participantId FROM thread_participants
3 WHERE thread_participants.accountId = voice_events.accountId
4 AND thread_participants.threadId = voice_events.threadId
5 AND thread_participants.type = 1
6 LIMIT 1);
07
=== modified file 'plugins/sqlite/sqlitehistoryplugin.cpp'
--- plugins/sqlite/sqlitehistoryplugin.cpp 2015-01-28 23:15:01 +0000
+++ plugins/sqlite/sqlitehistoryplugin.cpp 2015-02-10 17:31:22 +0000
@@ -381,13 +381,14 @@
381 History::EventWriteResult result;381 History::EventWriteResult result;
382 if (existingEvent.isEmpty()) {382 if (existingEvent.isEmpty()) {
383 // create new383 // create new
384 query.prepare("INSERT INTO voice_events (accountId, threadId, eventId, senderId, timestamp, newEvent, duration, missed) "384 query.prepare("INSERT INTO voice_events (accountId, threadId, eventId, senderId, timestamp, newEvent, duration, missed, remoteParticipant) "
385 "VALUES (:accountId, :threadId, :eventId, :senderId, :timestamp, :newEvent, :duration, :missed)");385 "VALUES (:accountId, :threadId, :eventId, :senderId, :timestamp, :newEvent, :duration, :missed, :remoteParticipant)");
386 result = History::EventWriteCreated;386 result = History::EventWriteCreated;
387 } else {387 } else {
388 // update existing event388 // update existing event
389 query.prepare("UPDATE voice_events SET senderId=:senderId, timestamp=:timestamp, newEvent=:newEvent, duration=:duration, "389 query.prepare("UPDATE voice_events SET senderId=:senderId, timestamp=:timestamp, newEvent=:newEvent, duration=:duration, "
390 "missed=:missed WHERE accountId=:accountId AND threadId=:threadId AND eventId=:eventId");390 "missed=:missed, remoteParticipant=:remoteParticipant "
391 "WHERE accountId=:accountId AND threadId=:threadId AND eventId=:eventId");
391392
392 result = History::EventWriteModified;393 result = History::EventWriteModified;
393 }394 }
@@ -400,6 +401,7 @@
400 query.bindValue(":newEvent", event[History::FieldNewEvent]);401 query.bindValue(":newEvent", event[History::FieldNewEvent]);
401 query.bindValue(":duration", event[History::FieldDuration]);402 query.bindValue(":duration", event[History::FieldDuration]);
402 query.bindValue(":missed", event[History::FieldMissed]);403 query.bindValue(":missed", event[History::FieldMissed]);
404 query.bindValue(":remoteParticipant", event[History::FieldRemoteParticipant]);
403405
404 if (!query.exec()) {406 if (!query.exec()) {
405 qCritical() << "Failed to save the voice event: Error:" << query.lastError() << query.lastQuery();407 qCritical() << "Failed to save the voice event: Error:" << query.lastError() << query.lastQuery();
@@ -484,7 +486,7 @@
484 break;486 break;
485 case History::EventTypeVoice:487 case History::EventTypeVoice:
486 table = "voice_events";488 table = "voice_events";
487 extraFields << "voice_events.duration" << "voice_events.missed";489 extraFields << "voice_events.duration" << "voice_events.missed" << "voice_events.remoteParticipant";
488 break;490 break;
489 }491 }
490492
@@ -557,6 +559,7 @@
557 case History::EventTypeVoice:559 case History::EventTypeVoice:
558 thread[History::FieldMissed] = query.value(10);560 thread[History::FieldMissed] = query.value(10);
559 thread[History::FieldDuration] = query.value(9);561 thread[History::FieldDuration] = query.value(9);
562 thread[History::FieldRemoteParticipant] = query.value(11);
560 break;563 break;
561 }564 }
562 threads << thread;565 threads << thread;
@@ -585,7 +588,7 @@
585 case History::EventTypeVoice:588 case History::EventTypeVoice:
586 participantsField = participantsField.arg("voice_events", QString::number(type));589 participantsField = participantsField.arg("voice_events", QString::number(type));
587 queryText = QString("SELECT accountId, threadId, eventId, senderId, timestamp, newEvent, %1, "590 queryText = QString("SELECT accountId, threadId, eventId, senderId, timestamp, newEvent, %1, "
588 "duration, missed FROM voice_events %2 %3").arg(participantsField, modifiedCondition, order);591 "duration, missed, remoteParticipant FROM voice_events %2 %3").arg(participantsField, modifiedCondition, order);
589 break;592 break;
590 }593 }
591594
@@ -649,6 +652,7 @@
649 case History::EventTypeVoice:652 case History::EventTypeVoice:
650 event[History::FieldDuration] = query.value(7).toInt();653 event[History::FieldDuration] = query.value(7).toInt();
651 event[History::FieldMissed] = query.value(8);654 event[History::FieldMissed] = query.value(8);
655 event[History::FieldRemoteParticipant] = query.value(9);
652 break;656 break;
653 }657 }
654658
655659
=== modified file 'src/tests/VoiceEventTest.cpp'
--- src/tests/VoiceEventTest.cpp 2014-09-25 18:27:15 +0000
+++ src/tests/VoiceEventTest.cpp 2015-02-10 17:31:22 +0000
@@ -46,16 +46,21 @@
46 QTest::addColumn<bool>("newEvent");46 QTest::addColumn<bool>("newEvent");
47 QTest::addColumn<bool>("missed");47 QTest::addColumn<bool>("missed");
48 QTest::addColumn<QTime>("duration");48 QTest::addColumn<QTime>("duration");
49 QTest::addColumn<QString>("remoteParticipant");
50 QTest::addColumn<QStringList>("participants");
4951
50 QTest::newRow("unread missed call") << "testAccountId" << "testThreadId" << "testEventId"52 QTest::newRow("unread missed call") << "testAccountId" << "testThreadId" << "testEventId"
51 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)53 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)
52 << true << true << QTime(0, 0, 0);54 << true << true << QTime(0, 0, 0) << QString("remoteParticipant")
55 << (QStringList() << "testSenderId");
53 QTest::newRow("missed call") << "testAccountId2" << "testThreadId2" << "testEventId2"56 QTest::newRow("missed call") << "testAccountId2" << "testThreadId2" << "testEventId2"
54 << "testSenderId2" << QDateTime::currentDateTime().addDays(-5)57 << "testSenderId2" << QDateTime::currentDateTime().addDays(-5)
55 << false << true << QTime(0, 0, 0);58 << false << true << QTime(0, 0, 0) << QString("remoteParticipant2")
59 << (QStringList() << "testSenderId2");
56 QTest::newRow("not missed call") << "testAccountId" << "testThreadId" << "testEventId"60 QTest::newRow("not missed call") << "testAccountId" << "testThreadId" << "testEventId"
57 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)61 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)
58 << false << false << QTime(1, 2, 3);62 << false << false << QTime(1, 2, 3) << QString("remoteParticipant")
63 << (QStringList() << "testSenderId");
59}64}
6065
61void VoiceEventTest::testCreateNewEvent()66void VoiceEventTest::testCreateNewEvent()
@@ -68,8 +73,10 @@
68 QFETCH(bool, newEvent);73 QFETCH(bool, newEvent);
69 QFETCH(bool, missed);74 QFETCH(bool, missed);
70 QFETCH(QTime, duration);75 QFETCH(QTime, duration);
76 QFETCH(QString, remoteParticipant);
77 QFETCH(QStringList, participants);
71 History::VoiceEvent event(accountId, threadId, eventId, senderId, timestamp, newEvent,78 History::VoiceEvent event(accountId, threadId, eventId, senderId, timestamp, newEvent,
72 missed, duration);79 missed, duration, remoteParticipant, participants);
7380
74 // check that the values are properly set81 // check that the values are properly set
75 QCOMPARE(event.accountId(), accountId);82 QCOMPARE(event.accountId(), accountId);
@@ -80,12 +87,14 @@
80 QCOMPARE(event.newEvent(), newEvent);87 QCOMPARE(event.newEvent(), newEvent);
81 QCOMPARE(event.missed(), missed);88 QCOMPARE(event.missed(), missed);
82 QCOMPARE(event.duration(), duration);89 QCOMPARE(event.duration(), duration);
90 QCOMPARE(event.remoteParticipant(), remoteParticipant);
91 QCOMPARE(event.participants(), participants);
83}92}
8493
85void VoiceEventTest::testCastToEventAndBack()94void VoiceEventTest::testCastToEventAndBack()
86{95{
87 History::VoiceEvent voiceEvent("oneAccountId", "oneThreadId", "oneEventId", "oneSender", QDateTime::currentDateTime(),96 History::VoiceEvent voiceEvent("oneAccountId", "oneThreadId", "oneEventId", "oneSender", QDateTime::currentDateTime(),
88 true, true, QTime(1,2,3));97 true, true, QTime(1,2,3), "remoteParticipant", QStringList() << "oneParticipant");
8998
90 // test the copy constructor99 // test the copy constructor
91 History::Event historyEvent(voiceEvent);100 History::Event historyEvent(voiceEvent);
@@ -112,16 +121,17 @@
112 QTest::addColumn<bool>("newEvent");121 QTest::addColumn<bool>("newEvent");
113 QTest::addColumn<bool>("missed");122 QTest::addColumn<bool>("missed");
114 QTest::addColumn<QTime>("duration");123 QTest::addColumn<QTime>("duration");
124 QTest::addColumn<QStringList>("participants");
115125
116 QTest::newRow("unread missed call") << "testAccountId" << "testThreadId" << "testEventId"126 QTest::newRow("unread missed call") << "testAccountId" << "testThreadId" << "testEventId"
117 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)127 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)
118 << true << true << QTime(0, 0, 0);128 << true << true << QTime(0, 0, 0) << (QStringList() << "testParticipant");
119 QTest::newRow("missed call") << "testAccountId2" << "testThreadId2" << "testEventId2"129 QTest::newRow("missed call") << "testAccountId2" << "testThreadId2" << "testEventId2"
120 << "testSenderId2" << QDateTime::currentDateTime().addDays(-5)130 << "testSenderId2" << QDateTime::currentDateTime().addDays(-5)
121 << false << true << QTime(0, 0, 0);131 << false << true << QTime(0, 0, 0) << (QStringList() << "testParticipant2");
122 QTest::newRow("not missed call") << "testAccountId" << "testThreadId" << "testEventId"132 QTest::newRow("not missed call") << "testAccountId" << "testThreadId" << "testEventId"
123 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)133 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)
124 << false << false << QTime(1, 2, 3);134 << false << false << QTime(1, 2, 3) << (QStringList() << "testParticipant");
125}135}
126136
127void VoiceEventTest::testFromProperties()137void VoiceEventTest::testFromProperties()
@@ -134,6 +144,7 @@
134 QFETCH(bool, newEvent);144 QFETCH(bool, newEvent);
135 QFETCH(bool, missed);145 QFETCH(bool, missed);
136 QFETCH(QTime, duration);146 QFETCH(QTime, duration);
147 QFETCH(QStringList, participants);
137148
138 QVariantMap properties;149 QVariantMap properties;
139 properties[History::FieldAccountId] = accountId;150 properties[History::FieldAccountId] = accountId;
@@ -144,6 +155,7 @@
144 properties[History::FieldNewEvent] = newEvent;155 properties[History::FieldNewEvent] = newEvent;
145 properties[History::FieldMissed] = missed;156 properties[History::FieldMissed] = missed;
146 properties[History::FieldDuration] = QTime(0,0,0,0).secsTo(duration);157 properties[History::FieldDuration] = QTime(0,0,0,0).secsTo(duration);
158 properties[History::FieldParticipants] = participants;
147159
148 History::VoiceEvent voiceEvent = History::VoiceEvent::fromProperties(properties);160 History::VoiceEvent voiceEvent = History::VoiceEvent::fromProperties(properties);
149 QCOMPARE(voiceEvent.accountId(), accountId);161 QCOMPARE(voiceEvent.accountId(), accountId);
@@ -154,6 +166,7 @@
154 QCOMPARE(voiceEvent.newEvent(), newEvent);166 QCOMPARE(voiceEvent.newEvent(), newEvent);
155 QCOMPARE(voiceEvent.missed(), missed);167 QCOMPARE(voiceEvent.missed(), missed);
156 QCOMPARE(voiceEvent.duration(), duration);168 QCOMPARE(voiceEvent.duration(), duration);
169 QCOMPARE(voiceEvent.participants(), participants);
157}170}
158171
159void VoiceEventTest::testFromNullProperties()172void VoiceEventTest::testFromNullProperties()
@@ -174,16 +187,21 @@
174 QTest::addColumn<bool>("newEvent");187 QTest::addColumn<bool>("newEvent");
175 QTest::addColumn<bool>("missed");188 QTest::addColumn<bool>("missed");
176 QTest::addColumn<QTime>("duration");189 QTest::addColumn<QTime>("duration");
190 QTest::addColumn<QString>("remoteParticipant");
191 QTest::addColumn<QStringList>("participants");
177192
178 QTest::newRow("unread missed call") << "testAccountId" << "testThreadId" << "testEventId"193 QTest::newRow("unread missed call") << "testAccountId" << "testThreadId" << "testEventId"
179 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)194 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)
180 << true << true << QTime(0, 0, 0);195 << true << true << QTime(0, 0, 0) << QString("remoteParticipant")
196 << (QStringList() << "testParticipant");
181 QTest::newRow("missed call") << "testAccountId2" << "testThreadId2" << "testEventId2"197 QTest::newRow("missed call") << "testAccountId2" << "testThreadId2" << "testEventId2"
182 << "testSenderId2" << QDateTime::currentDateTime().addDays(-5)198 << "testSenderId2" << QDateTime::currentDateTime().addDays(-5)
183 << false << true << QTime(0, 0, 0);199 << false << true << QTime(0, 0, 0) << QString("remoteParticipant2")
200 << (QStringList() << "testParticipant2");
184 QTest::newRow("not missed call") << "testAccountId" << "testThreadId" << "testEventId"201 QTest::newRow("not missed call") << "testAccountId" << "testThreadId" << "testEventId"
185 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)202 << "testSenderId" << QDateTime::currentDateTime().addDays(-10)
186 << false << false << QTime(1, 2, 3);203 << false << false << QTime(1, 2, 3) << QString("remoteParticipant3")
204 << (QStringList() << "testParticipant3");
187}205}
188206
189void VoiceEventTest::testProperties()207void VoiceEventTest::testProperties()
@@ -196,8 +214,10 @@
196 QFETCH(bool, newEvent);214 QFETCH(bool, newEvent);
197 QFETCH(bool, missed);215 QFETCH(bool, missed);
198 QFETCH(QTime, duration);216 QFETCH(QTime, duration);
217 QFETCH(QString, remoteParticipant);
218 QFETCH(QStringList, participants);
199 History::VoiceEvent event(accountId, threadId, eventId, senderId, timestamp, newEvent,219 History::VoiceEvent event(accountId, threadId, eventId, senderId, timestamp, newEvent,
200 missed, duration);220 missed, duration, remoteParticipant, participants);
201221
202 // check that the values are properly set222 // check that the values are properly set
203 QVariantMap properties = event.properties();223 QVariantMap properties = event.properties();
@@ -209,6 +229,8 @@
209 QCOMPARE(properties[History::FieldNewEvent].toBool(), newEvent);229 QCOMPARE(properties[History::FieldNewEvent].toBool(), newEvent);
210 QCOMPARE(properties[History::FieldMissed].toBool(), missed);230 QCOMPARE(properties[History::FieldMissed].toBool(), missed);
211 QCOMPARE(QTime(0,0).addSecs(properties[History::FieldDuration].toInt()), duration);231 QCOMPARE(QTime(0,0).addSecs(properties[History::FieldDuration].toInt()), duration);
232 QCOMPARE(properties[History::FieldRemoteParticipant].toString(), remoteParticipant);
233 QCOMPARE(properties[History::FieldParticipants].toStringList(), participants);
212}234}
213235
214QTEST_MAIN(VoiceEventTest)236QTEST_MAIN(VoiceEventTest)
215237
=== modified file 'src/types.h'
--- src/types.h 2014-09-22 13:27:29 +0000
+++ src/types.h 2015-02-10 17:31:22 +0000
@@ -132,6 +132,7 @@
132// voice event fields132// voice event fields
133static const char* FieldMissed = "missed";133static const char* FieldMissed = "missed";
134static const char* FieldDuration = "duration";134static const char* FieldDuration = "duration";
135static const char* FieldRemoteParticipant = "remoteParticipant";
135136
136// sort stuff137// sort stuff
137static const char* FieldSortField = "sortField";138static const char* FieldSortField = "sortField";
138139
=== modified file 'src/voiceevent.cpp'
--- src/voiceevent.cpp 2013-10-08 21:06:20 +0000
+++ src/voiceevent.cpp 2015-02-10 17:31:22 +0000
@@ -38,9 +38,11 @@
38 const QDateTime &theTimestamp,38 const QDateTime &theTimestamp,
39 bool theNewEvent,39 bool theNewEvent,
40 bool theMissed,40 bool theMissed,
41 const QTime &theDuration, const QStringList &theParticipants)41 const QTime &theDuration,
42 const QString &theRemoteParticipant,
43 const QStringList &theParticipants)
42 : EventPrivate(theAccountId, theThreadId, theEventId, theSender, theTimestamp, theNewEvent, theParticipants),44 : EventPrivate(theAccountId, theThreadId, theEventId, theSender, theTimestamp, theNewEvent, theParticipants),
43 missed(theMissed), duration(theDuration)45 missed(theMissed), duration(theDuration), remoteParticipant(theRemoteParticipant)
44{46{
45}47}
4648
@@ -59,6 +61,7 @@
5961
60 map[FieldMissed] = missed;62 map[FieldMissed] = missed;
61 map[FieldDuration] = QTime(0,0,0,0).secsTo(duration);63 map[FieldDuration] = QTime(0,0,0,0).secsTo(duration);
64 map[FieldRemoteParticipant] = remoteParticipant;
6265
63 return map;66 return map;
64}67}
@@ -81,8 +84,10 @@
81 const QDateTime &timestamp,84 const QDateTime &timestamp,
82 bool newEvent,85 bool newEvent,
83 bool missed,86 bool missed,
84 const QTime &duration, const QStringList &participants)87 const QTime &duration,
85 : Event(*new VoiceEventPrivate(accountId, threadId, eventId, sender, timestamp, newEvent, missed, duration, participants))88 const QString &remoteParticipant,
89 const QStringList &participants)
90 : Event(*new VoiceEventPrivate(accountId, threadId, eventId, sender, timestamp, newEvent, missed, duration, remoteParticipant, participants))
86{91{
87}92}
8893
@@ -102,6 +107,12 @@
102 return d->duration;107 return d->duration;
103}108}
104109
110QString VoiceEvent::remoteParticipant() const
111{
112 Q_D(const VoiceEvent);
113 return d->remoteParticipant;
114}
115
105Event VoiceEvent::fromProperties(const QVariantMap &properties)116Event VoiceEvent::fromProperties(const QVariantMap &properties)
106{117{
107 Event event;118 Event event;
@@ -117,8 +128,9 @@
117 QStringList participants = properties[FieldParticipants].toStringList();128 QStringList participants = properties[FieldParticipants].toStringList();
118 bool missed = properties[FieldMissed].toBool();129 bool missed = properties[FieldMissed].toBool();
119 QTime duration = QTime(0,0,0).addSecs(properties[FieldDuration].toInt());130 QTime duration = QTime(0,0,0).addSecs(properties[FieldDuration].toInt());
131 QString remoteParticipant = properties[FieldRemoteParticipant].toString();
120 event = VoiceEvent(accountId, threadId, eventId, senderId, timestamp, newEvent,132 event = VoiceEvent(accountId, threadId, eventId, senderId, timestamp, newEvent,
121 missed, duration, participants);133 missed, duration, remoteParticipant, participants);
122 return event;134 return event;
123}135}
124136
125137
=== modified file 'src/voiceevent.h'
--- src/voiceevent.h 2013-09-26 21:06:50 +0000
+++ src/voiceevent.h 2015-02-10 17:31:22 +0000
@@ -45,6 +45,7 @@
45 bool newEvent,45 bool newEvent,
46 bool missed,46 bool missed,
47 const QTime &duration = QTime(),47 const QTime &duration = QTime(),
48 const QString &remoteParticipant = QString::null,
48 const QStringList &participants = QStringList());49 const QStringList &participants = QStringList());
49 ~VoiceEvent();50 ~VoiceEvent();
5051
@@ -55,6 +56,12 @@
55 bool missed() const;56 bool missed() const;
56 QTime duration() const;57 QTime duration() const;
5758
59 /***
60 * Returns the ID of the remote participant.
61 * On incoming calls that's the same as the sender() property
62 */
63 QString remoteParticipant() const;
64
58 static Event fromProperties(const QVariantMap &properties);65 static Event fromProperties(const QVariantMap &properties);
59};66};
6067
6168
=== modified file 'src/voiceevent_p.h'
--- src/voiceevent_p.h 2013-09-26 21:06:50 +0000
+++ src/voiceevent_p.h 2015-02-10 17:31:22 +0000
@@ -39,10 +39,12 @@
39 bool theNewEvent,39 bool theNewEvent,
40 bool theMissed,40 bool theMissed,
41 const QTime &theDuration,41 const QTime &theDuration,
42 const QString &theRemoteParticipant,
42 const QStringList &theParticipants);43 const QStringList &theParticipants);
43 ~VoiceEventPrivate();44 ~VoiceEventPrivate();
44 bool missed;45 bool missed;
45 QTime duration;46 QTime duration;
47 QString remoteParticipant;
4648
47 EventType type() const;49 EventType type() const;
48 QVariantMap properties() const;50 QVariantMap properties() const;

Subscribers

People subscribed via source and target branches