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 (