nextcloud-desktop/src/gui/ocsshareejob.cpp
Camila San 981a4ee240
Adds parameter to retrieve shares with its reshares.
If the initiator or the recipient is not the current user,
show the list of sharees without any options to edit it.

Minor change: updates api to v2.

Signed-off-by: Camila San <hello@camila.codes>
2019-05-27 19:46:38 +02:00

47 lines
1.3 KiB
C++

/*
* Copyright (C) by Roeland Jago Douma <roeland@owncloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "ocsshareejob.h"
#include <QJsonDocument>
namespace OCC {
OcsShareeJob::OcsShareeJob(AccountPtr account)
: OcsJob(account)
{
setPath("ocs/v2.php/apps/files_sharing/api/v1/sharees");
connect(this, &OcsJob::jobFinished, this, &OcsShareeJob::jobDone);
}
void OcsShareeJob::getSharees(const QString &search,
const QString &itemType,
int page,
int perPage)
{
setVerb("GET");
addParam(QString::fromLatin1("search"), search);
addParam(QString::fromLatin1("itemType"), itemType);
addParam(QString::fromLatin1("page"), QString::number(page));
addParam(QString::fromLatin1("perPage"), QString::number(perPage));
start();
}
void OcsShareeJob::jobDone(const QJsonDocument &reply)
{
emit shareeJobFinished(reply);
}
}