Gui modifications to support authenticated forums.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@868 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-12-06 00:30:56 +00:00
parent 1efe8a2cb1
commit 3d4920f73f
4 changed files with 46 additions and 8 deletions

View File

@ -295,7 +295,7 @@ void ForumsDialog::insertForums()
for(it = forumList.begin(); it != forumList.end(); it++)
{
/* sort it into Publish (Own), Subscribed, Popular and Other */
uint32_t flags = it->forumFlags;
uint32_t flags = it->subscribeFlags;
if (flags & RS_DISTRIB_ADMIN)
{
@ -310,7 +310,13 @@ void ForumsDialog::insertForums()
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
item -> setText(0, QString::fromStdWString(it->forumName));
QString name = QString::fromStdWString(it->forumName);
if (it->forumFlags & RS_DISTRIB_AUTHEN_REQ)
{
name += " (AUTHD)";
}
item -> setText(0, name);
/* (1) Popularity */
{
std::ostringstream out;
@ -344,7 +350,13 @@ void ForumsDialog::insertForums()
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
item -> setText(0, QString::fromStdWString(it->forumName));
QString name = QString::fromStdWString(it->forumName);
if (it->forumFlags & RS_DISTRIB_AUTHEN_REQ)
{
name += " (AUTHD)";
}
item -> setText(0, name);
/* (1) Popularity */
{
std::ostringstream out;
@ -391,7 +403,7 @@ void ForumsDialog::insertForums()
for(it = forumList.begin(); it != forumList.end(); it++)
{
/* ignore the ones we've done already */
uint32_t flags = it->forumFlags;
uint32_t flags = it->subscribeFlags;
if (flags & RS_DISTRIB_ADMIN)
{
@ -412,7 +424,13 @@ void ForumsDialog::insertForums()
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
item -> setText(0, QString::fromStdWString(it->forumName));
QString name = QString::fromStdWString(it->forumName);
if (it->forumFlags & RS_DISTRIB_AUTHEN_REQ)
{
name += " (AUTHD)";
}
item -> setText(0, name);
/* (1) Popularity */
{
std::ostringstream out;
@ -577,7 +595,7 @@ void ForumsDialog::insertThreads()
rsForums->getForumMessage(fId,tit->msgId,msginfo) ;
item->setText(1, QString::fromStdWString(tit->title));
item->setText(2, QString::fromStdString(msginfo.srcId));
item->setText(2, QString::fromStdString(rsPeers->getPeerName(msginfo.srcId)));
item->setText(3, "signed");
item->setText(4, QString::fromStdString(tit->parentId));
item->setText(5, QString::fromStdString(tit->msgId));
@ -629,7 +647,8 @@ void ForumsDialog::insertThreads()
rsForums->getForumMessage(fId,mit->msgId,msginfo) ;
child->setText(1, QString::fromStdWString(mit->title));
child->setText(2, QString::fromStdString(msginfo.srcId));
//child->setText(2, QString::fromStdString(msginfo.srcId));
child->setText(2, QString::fromStdString(rsPeers->getPeerName(msginfo.srcId)));
child->setText(3, "signed");
child->setText(4, QString::fromStdString(mit->parentId));
child->setText(5, QString::fromStdString(mit->msgId));

View File

@ -63,7 +63,7 @@ void CreateForum::newForum()
ui.typeEncrypted->setEnabled(false);
ui.msgAnon->setChecked(true);
ui.msgAuth->setEnabled(false);
//ui.msgAuth->setEnabled(false);
}
else
{

View File

@ -65,6 +65,18 @@ void CreateForumMsg::newMsg()
ui.forumName->setText(name);
ui.forumSubject->setText(subj);
if (fi.forumFlags & RS_DISTRIB_AUTHEN_REQ)
{
ui.signBox->setChecked(true);
//ui.signBox->setEnabled(false);
// For Testing.
ui.signBox->setEnabled(true);
}
else
{
ui.signBox->setEnabled(true);
}
}
ui.forumMessage->setText("");
@ -86,6 +98,11 @@ void CreateForumMsg::createMsg()
msgInfo.title = name.toStdWString();
msgInfo.msg = desc.toStdWString();
if (ui.signBox->isChecked())
{
msgInfo.msgflags = RS_DISTRIB_AUTHEN_REQ;
}
if ((msgInfo.msg == L"") && (msgInfo.title == L""))
return; /* do nothing */

View File

@ -43,6 +43,8 @@ class ForumInfo
std::wstring forumDesc;
uint32_t forumFlags;
uint32_t subscribeFlags;
uint32_t pop;
time_t lastPost;