Add callback logic for LOK_CALLBACK_EXPORT_FILE
Signed-off-by: NickWingate <nick.wingate@collabora.com> Change-Id: I3ca6be3ff26c5f847abc64f1c38b67d131191143
This commit is contained in:
parent
c5aadfc4d1
commit
cc508630e5
1 changed files with 11 additions and 0 deletions
|
@ -3144,6 +3144,17 @@ void ChildSession::loKitCallback(const int type, const std::string& payload)
|
|||
}
|
||||
#endif
|
||||
break;
|
||||
case LOK_CALLBACK_EXPORT_FILE:
|
||||
{
|
||||
// Register download id -> URL mapping in the DocumentBroker
|
||||
auto url = payload.substr(strlen("file:///tmp/"));
|
||||
auto downloadId = Util::rng::getFilename(64);
|
||||
std::string docBrokerMessage = "registerdownload: downloadid=" + downloadId + " url=" + url + " clientid=" + getId();
|
||||
_docManager->sendFrame(docBrokerMessage.c_str(), docBrokerMessage.length());
|
||||
std::string message = "downloadas: downloadid=" + downloadId + " port=" + std::to_string(ClientPortNumber) + " id=export";
|
||||
sendTextFrame(message);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_ERR("Unknown callback event (" << lokCallbackTypeToString(type) << "): " << payload);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue