Commit 6627f330 authored by Ronan's avatar Ronan
Browse files

feat(MainDb): fetch ConferenceEvent => OK

parent be19ba1a
...@@ -50,7 +50,7 @@ private: ...@@ -50,7 +50,7 @@ private:
// Events API. // Events API.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
std::shared_ptr<EventLog> selectEventFromPeerAddress ( std::shared_ptr<EventLog> selectGenericConferenceEvent (
long eventId, long eventId,
EventLog::Type type, EventLog::Type type,
time_t date, time_t date,
......
...@@ -205,7 +205,7 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {} ...@@ -205,7 +205,7 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
shared_ptr<EventLog> MainDbPrivate::selectEventFromPeerAddress ( shared_ptr<EventLog> MainDbPrivate::selectGenericConferenceEvent (
long eventId, long eventId,
EventLog::Type type, EventLog::Type type,
time_t date, time_t date,
...@@ -249,8 +249,15 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {} ...@@ -249,8 +249,15 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {}
time_t date, time_t date,
const string &peerAddress const string &peerAddress
) const { ) const {
// TODO. // Useless here.
return nullptr; (void)eventId;
// TODO: Use cache.
return make_shared<ConferenceEvent>(
type,
date,
Address(peerAddress)
);
} }
shared_ptr<EventLog> MainDbPrivate::selectConferenceCallEvent ( shared_ptr<EventLog> MainDbPrivate::selectConferenceCallEvent (
...@@ -907,7 +914,7 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {} ...@@ -907,7 +914,7 @@ MainDb::MainDb () : AbstractDb(*new MainDbPrivate) {}
soci::rowset<soci::row> rows = (session->prepare << query, soci::use(peerAddress)); soci::rowset<soci::row> rows = (session->prepare << query, soci::use(peerAddress));
for (const auto &row : rows) { for (const auto &row : rows) {
tm date = row.get<tm>(2); tm date = row.get<tm>(2);
events.push_back(d->selectConferenceEvent( events.push_back(d->selectGenericConferenceEvent(
row.get<long>(0), row.get<long>(0),
static_cast<EventLog::Type>(row.get<int>(1)), static_cast<EventLog::Type>(row.get<int>(1)),
mktime(&date), mktime(&date),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment