From 303e9805e2b6e168e2b444bbe483593200df19ad Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2017 11:16:53 +0200 Subject: [PATCH] fix(MainDb): fetch correctly addresses, not ids --- src/db/main-db.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index b90190adb..f5e4a5af4 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -290,10 +290,11 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {} string participantAddress; soci::session *session = dbSession.getBackendSession(); - *session << "SELECT notify_id, participant_address_id" - " FROM conference_notified_event, conference_participant_event" + *session << "SELECT notify_id, participant_address.value" + " FROM conference_notified_event, conference_participant_event, sip_address as participant_address" " WHERE conference_participant_event.event_id = :eventId" " AND conference_notified_event.event_id = conference_participant_event.event_id", + " AND participant_address.id = participant_address_id" soci::into(notifyId), soci::into(participantAddress), soci::use(eventId); // TODO: Use cache. @@ -317,11 +318,14 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {} 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" + *session << "SELECT notify_id, participant_address.value, gruu_address.value" + " FROM conference_notified_event, conference_participant_event, conference_participant_device_event," + " sip_address AS participant_address, sip_address AS gruu_address" " 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", + " AND conference_notified_event.event_id = conference_participant_event.event_id" + " AND participant_address.id = participant_address_id" + " AND gruu_address.id = gruu_address_id", soci::into(notifyId), soci::into(participantAddress), soci::into(gruuAddress), soci::use(eventId); // TODO: Use cache.