From fea02c354c98a03e044a81478abb29c8322f024f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2017 11:01:48 +0200 Subject: [PATCH] feat(MainDb): fetch ConferenceParticipantDeviceEvent => OK --- src/db/main-db.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index 0991adb06..b90190adb 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -312,8 +312,27 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {} time_t date, const string &peerAddress ) const { - // TODO. - return nullptr; + unsigned int notifyId; + string participantAddress; + string gruuAddress; + + soci::session *session = dbSession.getBackendSession(); + *session << "SELECT notify_id, participant_address_id, gruu_address_id" + " FROM conference_notified_event, conference_participant_event, conference_participant_device_event" + " WHERE conference_participant_device_event.event_id = :eventId" + " AND conference_participant_event.event_id = conference_participant_device_event.event_id" + " AND conference_notified_event.event_id = conference_participant_event.event_id", + soci::into(notifyId), soci::into(participantAddress), soci::into(gruuAddress), soci::use(eventId); + + // TODO: Use cache. + return make_shared( + type, + date, + Address(peerAddress), + notifyId, + Address(participantAddress), + Address(gruuAddress) + ); } shared_ptr MainDbPrivate::selectConferenceSubjectEvent (