diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 6fad7e1b2..2996921ed 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -357,6 +357,17 @@ void ChatWidget::pasteLink() ui->chattextEdit->insertHtml(RSLinkClipboard::toHtml()); } +void ChatWidget::pasteOwnCertificateLink() +{ + std::cerr << "In paste own certificate link" << std::endl; + RetroShareLink link ; + std::string ownId = rsPeers->getOwnId() ; + + if( link.createCertificate(ownId) ) { + ui->chattextEdit->insertHtml(link.toHtml() + " "); + } +} + void ChatWidget::contextMenu(QPoint /*point*/) { std::cerr << "In context menu" << std::endl; @@ -366,6 +377,7 @@ void ChatWidget::contextMenu(QPoint /*point*/) contextMnu->addSeparator(); QAction *action = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink())); action->setDisabled(RSLinkClipboard::empty()); + contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste own certificate link"), this, SLOT(pasteOwnCertificateLink())); contextMnu->exec(QCursor::pos()); delete(contextMnu); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index 4276e9b7e..4a23998f8 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -97,6 +97,7 @@ protected: private slots: void pasteLink(); + void pasteOwnCertificateLink(); void contextMenu(QPoint); void chatCharFormatChanged(); diff --git a/retroshare-gui/src/gui/forums/CreateForumMsg.cpp b/retroshare-gui/src/gui/forums/CreateForumMsg.cpp index 71b5c628a..8f81a80c3 100644 --- a/retroshare-gui/src/gui/forums/CreateForumMsg.cpp +++ b/retroshare-gui/src/gui/forums/CreateForumMsg.cpp @@ -29,6 +29,7 @@ #include #include +#include #include "gui/settings/rsharesettings.h" #include "gui/RetroShareLink.h" @@ -75,6 +76,7 @@ void CreateForumMsg::forumMessageCostumPopupMenu( QPoint /*point*/ ) contextMnu->addSeparator(); QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink())); QAction *pasteLinkFullAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste full RetroShare Link"), this, SLOT(pasteLinkFull())); + contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste own certificate link"), this, SLOT(pasteOwnCertificateLink())); if (RSLinkClipboard::empty()) { pasteLinkAct->setDisabled (true); @@ -245,3 +247,12 @@ void CreateForumMsg::pasteLinkFull() { ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ; } + +void CreateForumMsg::pasteOwnCertificateLink() +{ + RetroShareLink link ; + std::string ownId = rsPeers->getOwnId() ; + if( link.createCertificate(ownId) ) { + ui.forumMessage->insertHtml(link.toHtml() + " "); + } +} diff --git a/retroshare-gui/src/gui/forums/CreateForumMsg.h b/retroshare-gui/src/gui/forums/CreateForumMsg.h index b42e66434..630b397cb 100644 --- a/retroshare-gui/src/gui/forums/CreateForumMsg.h +++ b/retroshare-gui/src/gui/forums/CreateForumMsg.h @@ -44,6 +44,7 @@ private slots: void cancelMsg(); void pasteLink(); void pasteLinkFull(); + void pasteOwnCertificateLink(); void smileyWidgetForums(); void addSmileys();