mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-03 13:43:03 -04:00
support for retroshare links in gxs forums
- only group can link at the moment added more nxs tests and better cleanup - test ability sync with a delayed circle load git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7384 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
838e263ba3
commit
0dabe4b8a1
25 changed files with 343 additions and 126 deletions
retroshare-gui/src/gui
|
@ -36,8 +36,7 @@
|
|||
|
||||
#include "RetroShareLink.h"
|
||||
#include "MainWindow.h"
|
||||
//#include "ForumsDialog.h"
|
||||
//#include "ChannelFeed.h"
|
||||
#include "gui/gxsforums/GxsForumsDialog.h"
|
||||
#include "SearchDialog.h"
|
||||
#include "msgs/MessageComposer.h"
|
||||
#include "util/misc.h"
|
||||
|
@ -51,7 +50,7 @@
|
|||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsidentity.h>
|
||||
//#include <retroshare/rschannels.h>
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
|
||||
//#define DEBUG_RSLINK 1
|
||||
|
||||
|
@ -543,6 +542,33 @@ bool RetroShareLink::createChannel(const std::string &id, const std::string &msg
|
|||
return valid();
|
||||
}
|
||||
|
||||
bool RetroShareLink::createGxsLink(const RsGxsGroupId &id, const RsGxsMessageId &msgId,
|
||||
const std::string& groupName, const std::string& msgSubject,
|
||||
const RetroShareLink::enumType &linkType)
|
||||
{
|
||||
clear();
|
||||
|
||||
if (!id.isNull()) {
|
||||
_hash = QString::fromStdString(id.toStdString());
|
||||
|
||||
if(!msgId.isNull())
|
||||
_msgId = QString::fromStdString(msgId.toStdString());
|
||||
|
||||
_type = linkType;
|
||||
|
||||
if (msgId.isNull()) {
|
||||
_name = QString::fromStdString(groupName);
|
||||
} else {
|
||||
_name = QString::fromStdString(msgSubject);
|
||||
}
|
||||
}
|
||||
|
||||
check();
|
||||
|
||||
return valid();
|
||||
}
|
||||
|
||||
|
||||
bool RetroShareLink::createSearch(const QString& keywords)
|
||||
{
|
||||
clear();
|
||||
|
@ -1402,38 +1428,21 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
case TYPE_FORUM:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process ForumRequest : name : " << link.name().toStdString() << ". id : " << link.hash().toStdString() << ". msgId : " << link.msgId().toStdString() << std::endl;
|
||||
#endif
|
||||
|
||||
ForumInfo fi;
|
||||
if (!rsForums->getForumInfo(link.id().toStdString(), fi)) {
|
||||
if (link.msgId().isEmpty()) {
|
||||
forumUnknown.append(link.name());
|
||||
} else {
|
||||
forumMsgUnknown.append(link.name());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ForumMsgInfo msg;
|
||||
if (!link.msgId().isEmpty()) {
|
||||
if (!rsForums->getForumMessage(fi.forumId, link.msgId().toStdString(), msg)) {
|
||||
forumMsgUnknown.append(link.name());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::showWindow(MainWindow::Forums);
|
||||
ForumsDialog *forumsDialog = dynamic_cast<ForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
MainWindow::showWindow(MainWindow::Forums);
|
||||
GxsForumsDialog *forumsDialog = dynamic_cast<GxsForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
if (!forumsDialog) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (forumsDialog->navigate(fi.forumId, msg.msgId)) {
|
||||
if (forumsDialog->navigate(RsGxsGroupId(link.id().toStdString()), RsGxsMessageId(link.msgId().toStdString()))) {
|
||||
if (link.msgId().isEmpty()) {
|
||||
forumFound.append(link.name());
|
||||
} else {
|
||||
|
@ -1448,7 +1457,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
case TYPE_CHANNEL:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue