mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-22 20:59:45 -04:00
added private groups option to forums
fix for grp edit in p3distrib git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4579 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
35a059c44c
commit
3ff69a1be5
12 changed files with 578 additions and 268 deletions
|
@ -25,12 +25,14 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include <retroshare/rschannels.h>
|
||||
#include <retroshare/rsforums.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
#include "gui/common/PeerDefs.h"
|
||||
|
||||
ShareKey::ShareKey(QWidget *parent, Qt::WFlags flags, std::string chanId) :
|
||||
QDialog(parent, flags), mChannelId(chanId)
|
||||
ShareKey::ShareKey(QWidget *parent, Qt::WFlags flags, std::string grpId,
|
||||
int grpType) :
|
||||
QDialog(parent, flags), mGrpId(grpId), mGrpType(grpType)
|
||||
{
|
||||
ui = new Ui::ShareKey();
|
||||
ui->setupUi(this);
|
||||
|
@ -72,8 +74,7 @@ void ShareKey::changeEvent(QEvent *e)
|
|||
void ShareKey::shareKey()
|
||||
{
|
||||
|
||||
if(!rsChannels)
|
||||
return;
|
||||
|
||||
|
||||
if(mShareList.empty())
|
||||
{
|
||||
|
@ -83,12 +84,37 @@ void ShareKey::shareKey()
|
|||
return;
|
||||
}
|
||||
|
||||
if(!rsChannels->channelShareKeys(mChannelId, mShareList)){
|
||||
if(mGrpType & CHANNEL_KEY_SHARE)
|
||||
{
|
||||
if(!rsChannels)
|
||||
return;
|
||||
|
||||
if(!rsChannels->channelShareKeys(mGrpId, mShareList)){
|
||||
|
||||
std::cerr << "Failed to share keys!" << std::endl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}else if(mGrpType & FORUM_KEY_SHARE)
|
||||
{
|
||||
if(!rsForums)
|
||||
return;
|
||||
|
||||
if(!rsForums->forumShareKeys(mGrpId, mShareList)){
|
||||
|
||||
std::cerr << "Failed to share keys!" << std::endl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
// incorrect type
|
||||
return;
|
||||
}
|
||||
|
||||
std::cerr << "Failed to share keys!" << std::endl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
close();
|
||||
return;
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include "ui_ShareKey.h"
|
||||
|
||||
#define CHANNEL_KEY_SHARE 0x00000001
|
||||
#define FORUM_KEY_SHARE 0x00000002
|
||||
|
||||
class ShareKey : public QDialog {
|
||||
Q_OBJECT
|
||||
|
@ -12,7 +14,8 @@ public:
|
|||
/*
|
||||
*@param chanId The channel id to send request for
|
||||
*/
|
||||
ShareKey(QWidget *parent = 0, Qt::WFlags flags = 0, std::string chanId = "");
|
||||
ShareKey(QWidget *parent = 0, Qt::WFlags flags = 0,
|
||||
std::string grpId = "", int grpType = 0);
|
||||
~ShareKey();
|
||||
|
||||
|
||||
|
@ -27,9 +30,9 @@ private:
|
|||
|
||||
Ui::ShareKey *ui;
|
||||
|
||||
std::string mChannelId;
|
||||
std::string mGrpId;
|
||||
std::list<std::string> mShareList;
|
||||
|
||||
int mGrpType;
|
||||
|
||||
private slots:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue