Commit cf7aaf8b authored by Ronan's avatar Ronan

feat(MainDb): deal with participants removed

parent 9a8181ee
......@@ -57,6 +57,8 @@ private:
long long selectChatRoomId (long long peerSipAddressId, long long localSipAddressId) const;
long long selectChatRoomId (const ChatRoomId &chatRoomId) const;
void deleteChatRoomParticipant (long long chatRoomId, long long participantSipAddressId);
// ---------------------------------------------------------------------------
// Events API.
// ---------------------------------------------------------------------------
......
......@@ -303,6 +303,13 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return selectChatRoomId(peerSipAddressId, localSipAddressId);
}
void MainDbPrivate::deleteChatRoomParticipant (long long chatRoomId, long long participantSipAddressId) {
soci::session *session = dbSession.getBackendSession<soci::session>();
*session << "DELETE FROM chat_room_participant"
" WHERE chat_room_id = :chatRoomId AND participant_sip_address_id = :participantSipAddressId",
soci::use(chatRoomId), soci::use(participantSipAddressId);
}
// -----------------------------------------------------------------------------
shared_ptr<EventLog> MainDbPrivate::selectGenericConferenceEvent (
......@@ -695,7 +702,8 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
break;
case EventLog::Type::ConferenceParticipantRemoved:
// TODO: Deal with remove.
deleteChatRoomParticipant(chatRoomId, participantAddressId);
break;
default:
break;
......
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