start server side of list chat room subscription

This commit is contained in:
Benjamin Reis 2018-03-16 17:14:29 +01:00
parent dc05b6821f
commit 164075f4f5
4 changed files with 46 additions and 6 deletions

View file

@ -524,4 +524,10 @@ void LocalConferenceEventHandler::setChatRoomId (const ChatRoomId &chatRoomId) {
d->chatRoomId = chatRoomId;
}
ChatRoomId LocalConferenceEventHandler::getChatRoomId () const {
L_D();
return d->chatRoomId;
}
LINPHONE_END_NAMESPACE

View file

@ -51,6 +51,7 @@ public:
void setLastNotify (unsigned int lastNotify);
void setChatRoomId (const ChatRoomId &chatRoomId);
ChatRoomId getChatRoomId () const;
private:
L_DECLARE_PRIVATE(LocalConferenceEventHandler);

View file

@ -16,7 +16,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
#include "local-conference-event-handler.h"
#include "local-conference-list-event-handler.h"
// =============================================================================
@ -27,5 +28,32 @@ LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
void LocalConferenceListEventHandler::subscribeReceived (const string &xmlBody) {
}
void LocalConferenceListEventHandler::notify () {
}
// -----------------------------------------------------------------------------
void LocalConferenceListEventHandler::addHandler (shared_ptr<LocalConferenceEventHandler> handler) {
handlers.push_back(handler);
}
shared_ptr<LocalConferenceEventHandler> LocalConferenceListEventHandler::findHandler (const ChatRoomId &chatRoomId) const {
for (const auto &handler : handlers) {
if (handler->getChatRoomId() == chatRoomId)
return handler;
}
return nullptr;
}
const list<shared_ptr<LocalConferenceEventHandler>> &LocalConferenceListEventHandler::getHandlers () const {
return handlers;
}
LINPHONE_END_NAMESPACE
*/

View file

@ -16,10 +16,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
#ifndef _L_LOCAL_CONFERENCE_LIST_EVENT_HANDLER_H_
#define _L_LOCAL_CONFERENCE_LIST_EVENT_HANDLER_H_
#include <memory>
#include <list>
#include "chat/chat-room/chat-room-id.h"
#include "linphone/utils/general.h"
// =============================================================================
@ -28,11 +32,12 @@ LINPHONE_BEGIN_NAMESPACE
class LocalConferenceEventHandler;
class LocalConferenceListEventHandler : public Object {
class LocalConferenceListEventHandler {
public:
void subscribeReceived ();
void subscribeReceived (const std::string &xmlBody);
void notify ();
void addHandler (std::shared_ptr<LocalConferenceEventHandler> handler);
std::shared_ptr<LocalConferenceEventHandler> findHandler (const ChatRoomId &chatRoomId) const;
const std::list<std::shared_ptr<LocalConferenceEventHandler>> &getHandlers () const;
private:
@ -43,4 +48,4 @@ private:
LINPHONE_END_NAMESPACE
#endif // ifndef _L_LOCAL_CONFERENCE_LIST_EVENT_HANDLER_H_
*/