diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index de9dceb79..45869585d 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -99,7 +99,11 @@ void GxsForumMsgItem::setup() /* clear ui */ ui->titleLabel->setText(tr("Loading...")); + ui->titleLabel->setOpenExternalLinks(false); //To get linkActivated working + connect(ui->titleLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_linkActivated(QString))); ui->subjectLabel->clear(); + ui->subjectLabel->setOpenExternalLinks(false); //To get linkActivated working + connect(ui->subjectLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_linkActivated(QString))); ui->timestamplabel->clear(); ui->parentNameLabel->clear(); ui->nameLabel->clear(); @@ -506,3 +510,16 @@ void GxsForumMsgItem::setAsRead() setReadStatus(false, false); } + +void GxsForumMsgItem::on_linkActivated(QString link) +{ + RetroShareLink rsLink(link); + + if (rsLink.valid() ) { + QList rsLinks; + rsLinks.append(rsLink); + RetroShareLink::process(rsLinks); + removeItem(); + return; + } +} diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h index 35872ab9c..410a97931 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h @@ -46,20 +46,20 @@ public: uint64_t uniqueIdentifier() const override { return hash_64bits("GxsForumMsgItem " + messageId().toStdString()) ; } protected: /* FeedItem */ - virtual void doExpand(bool open); - virtual void expandFill(bool first); + virtual void doExpand(bool open) override; + virtual void expandFill(bool first) override; /* load message data */ virtual void loadParentMessage(const RsGxsMessageId &parent_msg); /* GxsGroupFeedItem */ - virtual QString groupName(); + virtual QString groupName() override; virtual void loadGroup() override; - virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_FORUM; } + virtual RetroShareLink::enumType getLinkType() override { return RetroShareLink::TYPE_FORUM; } //virtual bool isLoading(); /* GxsFeedItem */ - virtual QString messageName(); + virtual QString messageName() override; virtual void loadMessage() override; virtual void loadComment() override { return; } @@ -70,6 +70,8 @@ private slots: void unsubscribeForum(); + void on_linkActivated(QString link); + signals: void vote(const RsGxsGrpMsgIdPair& msgId, bool up);