diff --git a/loolwsd/ChildSession.cpp b/loolwsd/ChildSession.cpp index 93a231232..2e44eeba1 100644 --- a/loolwsd/ChildSession.cpp +++ b/loolwsd/ChildSession.cpp @@ -326,7 +326,6 @@ bool ChildSession::loadDocument(const char * /*buffer*/, int /*length*/, StringT if (_multiView) { std::ostringstream ossViewInfo; - _viewId = _loKitDocument->getView(); const auto viewId = std::to_string(_viewId); // Create a message object diff --git a/loolwsd/ChildSession.hpp b/loolwsd/ChildSession.hpp index e0b9df51a..4cb79703d 100644 --- a/loolwsd/ChildSession.hpp +++ b/loolwsd/ChildSession.hpp @@ -69,6 +69,7 @@ public: bool getStatus(const char *buffer, int length); bool getPartPageRectangles(const char *buffer, int length); int getViewId() const { return _viewId; } + void setViewId(const int viewId) { _viewId = viewId; } const std::string getViewUserName() const { return _userName; } void loKitCallback(const int nType, const std::string& rPayload); diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index 65cab3655..b8ae37c04 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -1175,7 +1175,7 @@ private: if (_multiView) { - viewId = _loKitDocument->getView(); + session->setViewId((viewId = _loKitDocument->getView())); _viewIdToCallbackDescr.emplace(viewId, std::unique_ptr(new CallbackDescriptor({ this, viewId }))); _loKitDocument->registerCallback(ViewCallback, _viewIdToCallbackDescr[viewId].get());