Commit 46a194d5 authored by Ronan's avatar Ronan

feat(core): add findChatRooms impl

parent b133c589
......@@ -170,8 +170,18 @@ shared_ptr<ChatRoom> Core::findChatRoom (const ChatRoomId &chatRoomId) const {
}
list<shared_ptr<ChatRoom>> Core::findChatRooms (const IdentityAddress &peerAddress) const {
// TODO: DEV GROUP CHAT.
return list<shared_ptr<ChatRoom>>();
L_D();
// TODO: Improve performance if necessary.
list<shared_ptr<ChatRoom>> output;
copy_if(
d->chatRooms.begin(), d->chatRooms.end(),
back_inserter(output), [&peerAddress](const shared_ptr<ChatRoom> &chatRoom) {
return chatRoom->getPeerAddress() == peerAddress;
}
);
return output;
}
shared_ptr<ChatRoom> Core::createClientGroupChatRoom (const string &subject) {
......
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