diff --git a/libretroshare/src/chat/distantchat.cc b/libretroshare/src/chat/distantchat.cc index 113dd21c5..03acb6ff8 100644 --- a/libretroshare/src/chat/distantchat.cc +++ b/libretroshare/src/chat/distantchat.cc @@ -124,10 +124,13 @@ void DistantChatService::handleRecvChatStatusItem(RsChatStatusItem *cs) std::cerr << "DistantChatService::handleRecvChatStatusItem(): received keep alive packet for inactive chat! peerId=" << cs->PeerId() << std::endl; } -bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id) +bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id,bool is_client_side) { bool res = true ; + if(is_client_side) // always accept distant chat when we're the client side. + return true ; + if(mDistantChatPermissions & RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS) res = (rsIdentity!=NULL) && rsIdentity->isARegularContact(gxs_id) ; diff --git a/libretroshare/src/chat/distantchat.h b/libretroshare/src/chat/distantchat.h index 8b159c56a..5dc21e1d6 100644 --- a/libretroshare/src/chat/distantchat.h +++ b/libretroshare/src/chat/distantchat.h @@ -89,7 +89,7 @@ public: virtual void connectToGxsTunnelService(RsGxsTunnelService *tunnel_service) ; private: - virtual bool acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelService::RsGxsTunnelId& tunnel_id) ; + virtual bool acceptDataFromPeer(const RsGxsId& gxs_id, const RsGxsTunnelService::RsGxsTunnelId& tunnel_id, bool is_client_side) ; virtual void notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunnelId& tunnel_id,uint32_t tunnel_status) ; virtual void receiveData(const RsGxsTunnelService::RsGxsTunnelId& id,unsigned char *data,uint32_t data_size) ; diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 4539c0847..eb0c32812 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -349,6 +349,7 @@ void p3GxsTunnelService::handleRecvTunnelDataItem(const RsGxsTunnelId& tunnel_id RsGxsTunnelClientService *service = NULL ; RsGxsId peer_from ; + bool is_client_side = false ; { RS_STACK_MUTEX(mGxsTunnelMtx); /********** STACK LOCKED MTX ******/ @@ -367,6 +368,7 @@ void p3GxsTunnelService::handleRecvTunnelDataItem(const RsGxsTunnelId& tunnel_id { it2->second.client_services.insert(item->service_id) ; peer_from = it2->second.to_gxs_id ; + is_client_side = (it2->second.direction == RsTurtleGenericDataItem::DIRECTION_CLIENT); } // Check if the item has already been received. This is necessary because we actually re-send items until an ACK is received. If the ACK gets lost (connection interrupted) the @@ -380,7 +382,7 @@ void p3GxsTunnelService::handleRecvTunnelDataItem(const RsGxsTunnelId& tunnel_id it2->second.received_data_prints[item->unique_item_counter] = time(NULL) ; } - if(service->acceptDataFromPeer(peer_from,tunnel_id)) + if(service->acceptDataFromPeer(peer_from,tunnel_id,is_client_side)) service->receiveData(tunnel_id,item->data,item->data_size) ; item->data = NULL ; // avoids deletion, since the client has the memory now @@ -1474,6 +1476,7 @@ bool p3GxsTunnelService::getTunnelInfo(const RsGxsTunnelId& tunnel_id,GxsTunnelI info.tunnel_status = it->second.status; info.total_size_sent = it->second.total_sent; info.total_size_received= it->second.total_received; + info.is_client_side = (it->second.direction == RsTurtleGenericTunnelItem::DIRECTION_CLIENT); // Data packets diff --git a/libretroshare/src/pqi/pqistreamer.cc b/libretroshare/src/pqi/pqistreamer.cc index b4d2c1f40..f60e21d45 100644 --- a/libretroshare/src/pqi/pqistreamer.cc +++ b/libretroshare/src/pqi/pqistreamer.cc @@ -183,8 +183,10 @@ void pqistreamer::updateRates() if (t > mAvgLastUpdate + PQISTREAM_AVG_PERIOD) { - float avgReadpSec = getRate(true) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgReadCount/(1000.0 * (t - mAvgLastUpdate)); - float avgSentpSec = getRate(false) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgSentCount/(1000.0 * (t - mAvgLastUpdate)); + int64_t diff = int64_t(t) - int64_t(mAvgLastUpdate) ; + + float avgReadpSec = getRate(true) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgReadCount/(1000.0 * float(diff)); + float avgSentpSec = getRate(false) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgSentCount/(1000.0 * float(diff)); #ifdef DEBUG_PQISTREAMER std::cerr << "Peer " << PeerId() << ": Current speed estimates: " << avgReadpSec << " / " << avgSentpSec << std::endl; diff --git a/libretroshare/src/retroshare/rsgxstunnel.h b/libretroshare/src/retroshare/rsgxstunnel.h index 94f4c79fe..4d3588c9f 100644 --- a/libretroshare/src/retroshare/rsgxstunnel.h +++ b/libretroshare/src/retroshare/rsgxstunnel.h @@ -66,7 +66,7 @@ public: // Gives feedback about type of data that is allowed in. For security reasons, this always needs to be re-derived (Clients can return true on default) - virtual bool acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id) = 0 ; + virtual bool acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTunnelId& tunnel_id,bool is_client_side) = 0 ; }; class GxsTunnelInfo @@ -80,6 +80,7 @@ public: uint32_t tunnel_status ; // active, requested, DH pending, etc. uint32_t total_size_sent ; // total bytes sent through that tunnel since openned (including management). uint32_t total_size_received ; // total bytes received through that tunnel since openned (including management). + bool is_client_side ; // specifiec wether we are client(managing the tunnel) or server. // Data packets diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 6f991aa6d..6d0536b0e 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1017,8 +1017,6 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) // Is this result's target actually ours ? - ++(item->depth) ; // increase depth - if(it->second.origin == _own_id) returnSearchResult(item) ; // Yes, so send upward. else @@ -1032,7 +1030,7 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) // of the files found can be further reached by a tunnel. fwd_item->PeerId(it->second.origin) ; - fwd_item->depth = 2 + (rand() % 256) ; // obfuscate the depth for non immediate friends. + fwd_item->depth = 0 ; // obfuscate the depth for non immediate friends. Result will always be 0. This effectively removes the information. sendItem(fwd_item) ; } diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp index 2fc458752..0918c898e 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp @@ -624,12 +624,12 @@ void CreateCircleDialog::updateCircleGUI() } else { - std::set ids ; - ids.insert(mCircleGroup.mMeta.mAuthorId) ; + //std::set ids ; + //ids.insert(mCircleGroup.mMeta.mAuthorId) ; ui.idChooser->setDefaultId(mCircleGroup.mMeta.mAuthorId) ; ui.idChooser->setChosenId(mCircleGroup.mMeta.mAuthorId) ; - ui.idChooser->setIdConstraintSet(ids) ; - ui.idChooser->setFlags(IDCHOOSER_ID_REQUIRED | IDCHOOSER_NO_CREATE) ; + //ui.idChooser->setIdConstraintSet(ids) ; + ui.idChooser->setFlags(IDCHOOSER_NO_CREATE) ; ui.circleAdminLabel->setVisible(false) ; } } diff --git a/retroshare-gui/src/gui/Identity/IdDialog.ui b/retroshare-gui/src/gui/Identity/IdDialog.ui index cff96f3cd..01ec60018 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.ui +++ b/retroshare-gui/src/gui/Identity/IdDialog.ui @@ -20,7 +20,16 @@ - + + 0 + + + 0 + + + 0 + + 0 @@ -38,7 +47,16 @@ QFrame::Sunken - + + 2 + + + 2 + + + 2 + + 2 @@ -129,6 +147,18 @@ QFrame::Sunken + + 1 + + + 1 + + + 1 + + + 1 + @@ -254,7 +284,7 @@ Reputation - AlignLeft|AlignVCenter + AlignLeading|AlignVCenter @@ -331,7 +361,16 @@ - + + 6 + + + 6 + + + 6 + + 6 @@ -505,7 +544,16 @@ - + + 6 + + + 6 + + + 6 + + 6 diff --git a/retroshare-gui/src/gui/Posted/PostedDialog.h b/retroshare-gui/src/gui/Posted/PostedDialog.h index c0744723b..a90ac6ea7 100644 --- a/retroshare-gui/src/gui/Posted/PostedDialog.h +++ b/retroshare-gui/src/gui/Posted/PostedDialog.h @@ -46,7 +46,7 @@ public: protected: virtual QString getHelpString() const ; - virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_UNKNOWN; } + virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_POSTED; } virtual GroupFrameSettings::Type groupFrameSettingsType() { return GroupFrameSettings::Posted; } virtual void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata); diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index 384976bef..0f1902b6f 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -38,6 +38,7 @@ #include "MainWindow.h" #include "gui/gxsforums/GxsForumsDialog.h" #include "gui/gxschannels/GxsChannelDialog.h" +#include "gui/Posted/PostedDialog.h" #include "gui/FileTransfer/SearchDialog.h" #include "msgs/MessageComposer.h" #include "util/misc.h" @@ -61,11 +62,12 @@ #define HOST_PERSON "person" #define HOST_FORUM "forum" #define HOST_CHANNEL "channel" +#define HOST_POSTED "posted" #define HOST_MESSAGE "message" #define HOST_SEARCH "search" #define HOST_CERTIFICATE "certificate" #define HOST_PUBLIC_MSG "public_msg" -#define HOST_REGEXP "file|extra|person|forum|channel|search|message|certificate|private_chat|public_msg" +#define HOST_REGEXP "file|extra|person|forum|channel|posted|search|message|certificate|private_chat|public_msg" #define FILE_NAME "name" #define FILE_SIZE "size" @@ -83,6 +85,11 @@ #define CHANNEL_ID "id" #define CHANNEL_MSGID "msgid" +#define POSTED_NAME "name" +#define POSTED_ID "id" +#define POSTED_MSGID "msgid" + + #define MESSAGE_ID "id" #define MESSAGE_SUBJECT "subject" @@ -280,6 +287,15 @@ void RetroShareLink::fromUrl(const QUrl& url) return; } + if (url.host() == HOST_POSTED) { + _type = TYPE_POSTED; + _name = decodedQueryItemValue(urlQuery, POSTED_NAME); + _hash = urlQuery.queryItemValue(POSTED_ID); + _msgId = urlQuery.queryItemValue(POSTED_MSGID); + check(); + return; + } + if (url.host() == HOST_SEARCH) { _type = TYPE_SEARCH; _name = decodedQueryItemValue(urlQuery, SEARCH_KEYWORDS); @@ -579,6 +595,16 @@ void RetroShareLink::check() if(_hash.isEmpty()) _valid = false; break; + case TYPE_POSTED: + if(_size != 0) + _valid = false; + + if(_name.isEmpty()) + _valid = false; + + if(_hash.isEmpty()) + _valid = false; + break; case TYPE_SEARCH: if(_size != 0) _valid = false; @@ -629,6 +655,7 @@ QString RetroShareLink::title() const return PeerDefs::rsidFromId(RsPgpId(hash().toStdString())); case TYPE_FORUM: case TYPE_CHANNEL: + case TYPE_POSTED: case TYPE_SEARCH: break; case TYPE_MESSAGE: @@ -724,6 +751,17 @@ QString RetroShareLink::toString() const break; + case TYPE_POSTED: + url.setScheme(RSLINK_SCHEME); + url.setHost(HOST_POSTED); + urlQuery.addQueryItem(POSTED_NAME, encodeItem(_name)); + urlQuery.addQueryItem(POSTED_ID, _hash); + if (!_msgId.isEmpty()) { + urlQuery.addQueryItem(POSTED_MSGID, _msgId); + } + + break; + case TYPE_SEARCH: url.setScheme(RSLINK_SCHEME); url.setHost(HOST_SEARCH); @@ -969,6 +1007,7 @@ static void processList(const QStringList &list, const QString &textSingular, co case TYPE_UNKNOWN: case TYPE_FORUM: case TYPE_CHANNEL: + case TYPE_POSTED: case TYPE_SEARCH: case TYPE_MESSAGE: case TYPE_CERTIFICATE: @@ -1040,6 +1079,12 @@ static void processList(const QStringList &list, const QString &textSingular, co QStringList channelUnknown; QStringList channelMsgUnknown; + // forum + QStringList postedFound; + QStringList postedMsgFound; + QStringList postedUnknown; + QStringList postedMsgUnknown; + // search QStringList searchStarted; @@ -1056,8 +1101,8 @@ static void processList(const QStringList &list, const QString &textSingular, co QList processedList; QList errorList; - processedList << &fileAdded << &personAdded << &forumFound << &channelFound << &searchStarted << &messageStarted; - errorList << &fileExist << &personExist << &personFailed << &personNotFound << &forumUnknown << &forumMsgUnknown << &channelUnknown << &channelMsgUnknown << &messageReceipientNotAccepted << &messageReceipientUnknown; + processedList << &fileAdded << &personAdded << &forumFound << &channelFound << &postedFound << &searchStarted << &messageStarted; + errorList << &fileExist << &personExist << &personFailed << &personNotFound << &forumUnknown << &forumMsgUnknown << &channelUnknown << &channelMsgUnknown << &postedUnknown << &postedMsgUnknown << &messageReceipientNotAccepted << &messageReceipientUnknown; // not needed: forumFound, channelFound, messageStarted for (linkIt = links.begin(); linkIt != links.end(); ++linkIt) { @@ -1289,6 +1334,36 @@ static void processList(const QStringList &list, const QString &textSingular, co } break; + + case TYPE_POSTED: + { +#ifdef DEBUG_RSLINK + std::cerr << " RetroShareLink::process PostedRequest : name : " << link.name().toStdString() << ". id : " << link.hash().toStdString() << ". msgId : " << link.msgId().toStdString() << std::endl; +#endif + + MainWindow::showWindow(MainWindow::Posted); + PostedDialog *postedDialog = dynamic_cast(MainWindow::getPage(MainWindow::Posted)); + + if (!postedDialog) { + return false; + } + + if (postedDialog->navigate(RsGxsGroupId(link.id().toStdString()), RsGxsMessageId(link.msgId().toStdString()))) { + if (link.msgId().isEmpty()) { + postedFound.append(link.name()); + } else { + postedMsgFound.append(link.name()); + } + } else { + if (link.msgId().isEmpty()) { + postedUnknown.append(link.name()); + } else { + postedMsgUnknown.append(link.name()); + } + } + } + break; + case TYPE_SEARCH: { #ifdef DEBUG_RSLINK @@ -1438,6 +1513,16 @@ static void processList(const QStringList &list, const QString &textSingular, co } } + // posted + if (flag & RSLINK_PROCESS_NOTIFY_ERROR) { + if (!postedUnknown.isEmpty()) { + processList(postedUnknown, QObject::tr("Posted not found"), QObject::tr("Posted not found"), result); + } + if (!postedMsgUnknown.isEmpty()) { + processList(postedMsgUnknown, QObject::tr("Posted message not found"), QObject::tr("Posted messages not found"), result); + } + } + // message if (flag & RSLINK_PROCESS_NOTIFY_ERROR) { if (!messageReceipientNotAccepted.isEmpty()) { diff --git a/retroshare-gui/src/gui/RetroShareLink.h b/retroshare-gui/src/gui/RetroShareLink.h index c36b9ff4d..4020f8fcd 100644 --- a/retroshare-gui/src/gui/RetroShareLink.h +++ b/retroshare-gui/src/gui/RetroShareLink.h @@ -67,7 +67,8 @@ class RetroShareLink TYPE_CERTIFICATE = 0x07, TYPE_EXTRAFILE = 0x08, TYPE_PRIVATE_CHAT = 0x09, - TYPE_PUBLIC_MSG = 0x0a + TYPE_PUBLIC_MSG = 0x0a, + TYPE_POSTED = 0x0b }; public: diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 5874e8243..d3613a3c5 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -62,6 +62,8 @@ #include +#define FMM 2//fontMetricsMultiplicator + /***** * #define CHAT_DEBUG 1 *****/ @@ -71,6 +73,10 @@ ChatWidget::ChatWidget(QWidget *parent) : { ui->setupUi(this); + int iconHeight = FMM*QFontMetricsF(font()).height() ; + QSize iconSize = QSize(iconHeight,iconHeight); + QSize buttonSize = QSize(iconSize + QSize(FMM,FMM)); + newMessages = false; typing = false; peerStatus = 0; @@ -82,6 +88,29 @@ ChatWidget::ChatWidget(QWidget *parent) : lastStatusSendTime = 0 ; + //Resize Tool buttons + ui->emoteiconButton->setFixedSize(buttonSize); + ui->emoteiconButton->setIconSize(iconSize); + ui->fontButton->setFixedSize(buttonSize); + ui->fontButton->setIconSize(iconSize); + ui->attachPictureButton->setFixedSize(buttonSize); + ui->attachPictureButton->setIconSize(iconSize); + ui->addFileButton->setFixedSize(buttonSize); + ui->addFileButton->setIconSize(iconSize); + ui->pushtoolsButton->setFixedSize(buttonSize); + ui->pushtoolsButton->setIconSize(iconSize); + ui->notifyButton->setFixedSize(buttonSize); + ui->notifyButton->setIconSize(iconSize); + ui->markButton->setFixedSize(buttonSize); + ui->markButton->setIconSize(iconSize); + ui->leSearch->setFixedHeight(iconHeight); + ui->searchBefore->setFixedHeight(iconHeight); + ui->searchAfter->setFixedHeight(iconHeight); + ui->searchButton->setFixedSize(buttonSize); + ui->searchButton->setIconSize(iconSize); + ui->sendButton->setFixedHeight(iconHeight); + + //Initialize search iCharToStartSearch=Settings->getChatSearchCharToStartSearch(); bFindCaseSensitively=Settings->getChatSearchCaseSensitively(); bFindWholeWords=Settings->getChatSearchWholeWords(); @@ -90,7 +119,6 @@ ChatWidget::ChatWidget(QWidget *parent) : uiMaxSearchLimitColor=Settings->getChatSearchMaxSearchLimitColor(); cFoundColor=Settings->getChatSearchFoundColor(); - ui->actionSearchWithoutLimit->setText(tr("Don't stop to color after")+" "+QString::number(uiMaxSearchLimitColor)+" "+tr("items found (need more CPU)")); ui->leSearch->setVisible(false); @@ -102,23 +130,23 @@ ChatWidget::ChatWidget(QWidget *parent) : ui->searchButton->setChecked(false); ui->searchButton->setToolTip(tr("Find
Ctrl+F")); ui->leSearch->installEventFilter(this); + connect(ui->actionFindCaseSensitively, SIGNAL(triggered()), this, SLOT(toogle_FindCaseSensitively())); connect(ui->actionFindWholeWords, SIGNAL(triggered()), this, SLOT(toogle_FindWholeWords())); connect(ui->actionMoveToCursor, SIGNAL(triggered()), this, SLOT(toogle_MoveToCursor())); connect(ui->actionSearchWithoutLimit, SIGNAL(triggered()), this, SLOT(toogle_SeachWithoutLimit())); connect(ui->searchButton, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuSearchButton(QPoint))); - connect(ui->actionSearch_History, SIGNAL(triggered()), this, SLOT(searchHistory())); notify=NULL; ui->notifyButton->setVisible(false); ui->markButton->setToolTip(tr("Mark this selected text
Ctrl+M")); - connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendChat())); - connect(ui->addFileButton, SIGNAL(clicked()), this , SLOT(addExtraFile())); - - connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture())); connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget())); + connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture())); + connect(ui->addFileButton, SIGNAL(clicked()), this , SLOT(addExtraFile())); + connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(sendChat())); + connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory())); connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory())); @@ -146,9 +174,6 @@ ChatWidget::ChatWidget(QWidget *parent) : ui->infoFrame->setVisible(false); ui->statusMessageLabel->hide(); - ui->actionSearch_History->setChecked(Settings->getChatSearchShowBarByDefault()); - searchHistory(); - setAcceptDrops(true); ui->chatTextEdit->setAcceptDrops(false); ui->hashBox->setDropWidget(this); @@ -165,7 +190,6 @@ ChatWidget::ChatWidget(QWidget *parent) : menu->addAction(ui->actionDeleteChatHistory); menu->addAction(ui->actionSaveChatHistory); menu->addAction(ui->actionMessageHistory); - menu->addAction(ui->actionSearch_History); ui->pushtoolsButton->setMenu(menu); ui->textBrowser->installEventFilter(this); @@ -218,12 +242,16 @@ void ChatWidget::setDefaultExtraFileFlags(TransferRequestFlags fl) void ChatWidget::addChatHorizontalWidget(QWidget *w) { - ui->vl_Plugins->addWidget(w) ; + ui->pluginsVLayout->addWidget(w) ; update() ; } void ChatWidget::addChatBarWidget(QWidget *w) { + int iconHeight = FMM*QFontMetricsF(font()).height() ; + QSize iconSize = QSize(iconHeight,iconHeight); + QSize buttonSize = QSize(iconSize + QSize(FMM,FMM)); + w->setFixedSize(buttonSize); ui->pluginButtonFrame->layout()->addWidget(w) ; } @@ -234,8 +262,7 @@ void ChatWidget::addTitleBarWidget(QWidget *w) void ChatWidget::hideChatText(bool hidden) { - ui->frame_ChatText->setHidden(hidden); ; - ui->searchframe->setVisible(ui->actionSearch_History->isChecked() && !hidden); ; + ui->chatTextFrame->setHidden(hidden); ; } RSButtonOnText* ChatWidget::getNewButtonOnTextBrowser() @@ -316,7 +343,6 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title) messageCount = Settings->getPublicChatHistoryCount(); ui->titleBarFrame->setVisible(false); - ui->actionSearch_History->setVisible(false); } if (rsHistory->getEnable(hist_chat_type)) @@ -400,12 +426,12 @@ void ChatWidget::processSettings(bool load) // load settings // state of splitter - ui->chatsplitter->restoreState(Settings->value("ChatSplitter").toByteArray()); + ui->chatVSplitter->restoreState(Settings->value("ChatSplitter").toByteArray()); } else { // save settings // state of splitter - Settings->setValue("ChatSplitter", ui->chatsplitter->saveState()); + Settings->setValue("ChatSplitter", ui->chatVSplitter->saveState()); } Settings->endGroup(); @@ -835,7 +861,7 @@ void ChatWidget::on_notifyButton_clicked() QIcon icoLobby=(ui->notifyButton->icon()); notify->makeSubMenu(menu, icoLobby, title, chatId.toLobbyId()); - menu->exec(ui->notifyButton->mapToGlobal(ui->notifyButton->geometry().bottomLeft())); + menu->exec(ui->notifyButton->mapToGlobal(QPoint(0,ui->notifyButton->geometry().height()))); } @@ -1031,7 +1057,7 @@ void ChatWidget::chatCharFormatChanged() void ChatWidget::resetStatusBar() { ui->typingLabel->clear(); - ui->typingpixmapLabel->clear(); + ui->typingPixmapLabel->clear(); typing = false; @@ -1076,15 +1102,21 @@ void ChatWidget::updateLenOfChatTextEdit() break; } - bool msgToLarge = false; + int charRemains = 0; if (maxMessageSize > 0) { - msgToLarge = (msg.length() >= maxMessageSize); + charRemains = maxMessageSize - msg.length(); } - ui->sendButton->setEnabled(!msgToLarge); - text = tr("%1This message consists of %2 characters.").arg(msgToLarge ? tr("Warning:")+" " : "").arg(msg.length()); + ui->sendButton->setEnabled(charRemains>=0); + if (charRemains>0) + text = tr("It remains %1 characters\nafter HTML conversion.").arg(charRemains); + else if(charRemains<0) + text = tr("Warning: This message is too big of %1 characters\nafter HTML conversion.").arg((0-charRemains)); + else + text = ""; + ui->sendButton->setToolTip(text); - ui->chatTextEdit->setToolTip(msgToLarge?text:""); + ui->chatTextEdit->setToolTip(text); } void ChatWidget::sendChat() @@ -1427,16 +1459,6 @@ void ChatWidget::messageHistory() imBrowser.exec(); } -void ChatWidget::searchHistory() -{ - if(ui->actionSearch_History->isChecked()){ - ui->searchframe->show(); - }else { - ui->searchframe->hide(); - } - -} - void ChatWidget::addExtraFile() { QStringList files; @@ -1660,8 +1682,8 @@ void ChatWidget::updatePeersCustomStateString(const QString& /*peer_id*/, const void ChatWidget::updateStatusString(const QString &statusMask, const QString &statusString, bool permanent) { - ui->typingLabel->setText(QString(statusMask).arg(tr(statusString.toUtf8()))); // displays info for 5 secs. - ui->typingpixmapLabel->setPixmap(QPixmap(":images/typing.png") ); + ui->typingLabel->setText(QString(statusMask).arg(tr(statusString.toUtf8()))); // displays info for 5 secs. + ui->typingPixmapLabel->setPixmap(QPixmap(":images/typing.png") ); if (statusString == "is typing...") { typing = true; diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index 1aa2d9e4a..af4dab505 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -132,8 +132,6 @@ private slots: void deleteChatHistory(); void messageHistory(); void resetStatusBar() ; - void searchHistory(); - signals: void infoChanged(ChatWidget*); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index c2f4e2504..4ac16a057 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.ui +++ b/retroshare-gui/src/gui/chat/ChatWidget.ui @@ -10,7 +10,7 @@ 323
- + 0 @@ -27,12 +27,12 @@ 2
- + 2 - + 20 @@ -45,7 +45,7 @@ QFrame::Raised - + 0 @@ -130,7 +130,7 @@ QFrame::Box - + 6 @@ -207,7 +207,7 @@ border-image: url(:/images/closepressed.png) - + Qt::Vertical @@ -235,14 +235,14 @@ border-image: url(:/images/closepressed.png)
- + 0 - + - + 18 @@ -280,7 +280,7 @@ border-image: url(:/images/closepressed.png) - + Qt::Horizontal @@ -308,7 +308,7 @@ border-image: url(:/images/closepressed.png) 30 - + Type a message here @@ -325,7 +325,7 @@ border-image: url(:/images/closepressed.png) QFrame::Sunken - + 2 @@ -521,7 +521,7 @@ border-image: url(:/images/closepressed.png) QFrame::Plain - + 2 @@ -538,7 +538,179 @@ border-image: url(:/images/closepressed.png)
- + + + + 28 + 28 + + + + + 28 + 28 + + + + Qt::NoFocus + + + + :/images/chat_red24.png:/images/chat_red24.png + + + + 24 + 24 + + + + true + + + + + + + + 0 + 0 + + + + + 28 + 28 + + + + + 28 + 28 + + + + Qt::NoFocus + + + + :/images/highlight.png:/images/highlight.png + + + + 24 + 24 + + + + true + + + true + + + + + + + + + + + 14 + 28 + + + + + 14 + 28 + + + + Qt::NoFocus + + + + :/images/arrow-left.png:/images/arrow-left.png + + + true + + + + + + + + 14 + 28 + + + + + 14 + 28 + + + + Qt::NoFocus + + + + :/images/arrow-right.png:/images/arrow-right.png + + + true + + + + + + + + 0 + 0 + + + + + 28 + 28 + + + + + 28 + 28 + + + + Qt::NoFocus + + + Qt::CustomContextMenu + + + + :/images/find.png:/images/find.png + + + + 24 + 24 + + + + true + + + true + + + + + Qt::Horizontal @@ -571,12 +743,12 @@ border-image: url(:/images/closepressed.png) - +
- + QLayout::SetMaximumSize @@ -600,7 +772,7 @@ border-image: url(:/images/closepressed.png) QFrame::Sunken - + 2 @@ -670,7 +842,7 @@ border-image: url(:/images/closepressed.png) - + Qt::Horizontal @@ -690,7 +862,7 @@ border-image: url(:/images/closepressed.png) QFrame::Plain - + 2 @@ -706,202 +878,6 @@ border-image: url(:/images/closepressed.png) - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 28 - 28 - - - - - 28 - 28 - - - - Qt::NoFocus - - - Qt::CustomContextMenu - - - - :/images/find.png:/images/find.png - - - - 24 - 24 - - - - true - - - true - - - - - - - - 28 - 28 - - - - - 28 - 28 - - - - Qt::NoFocus - - - - :/images/chat_red24.png:/images/chat_red24.png - - - - 24 - 24 - - - - true - - - - - - - - 14 - 28 - - - - - 14 - 28 - - - - Qt::NoFocus - - - - :/images/arrow-right.png:/images/arrow-right.png - - - true - - - - - - - - - - - 14 - 28 - - - - - 14 - 28 - - - - Qt::NoFocus - - - - :/images/arrow-left.png:/images/arrow-left.png - - - true - - - - - - - - 0 - 0 - - - - - 28 - 28 - - - - - 28 - 28 - - - - Qt::NoFocus - - - - :/images/highlight.png:/images/highlight.png - - - - 24 - 24 - - - - true - - - true - - - - - -
@@ -1033,17 +1009,6 @@ border-image: url(:/images/closepressed.png) Choose color - - - true - - - Display Search Box - - - Search Box - - Quote @@ -1099,8 +1064,8 @@ border-image: url(:/images/closepressed.png) - + diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp index 421566fa5..336073317 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp @@ -71,7 +71,7 @@ void PostedGroupItem::setup() connect(ui->subscribeButton, SIGNAL(clicked()), this, SLOT(subscribePosted())); connect(ui->copyLinkButton, SIGNAL(clicked()), this, SLOT(copyGroupLink())); - ui->copyLinkButton->hide(); // No link type at this moment + //ui->copyLinkButton->hide(); // No link type at this moment ui->expandFrame->hide(); } @@ -130,10 +130,10 @@ void PostedGroupItem::fill() #endif // No link type at this moment -// RetroShareLink link; -// link.createGxsGroupLink(RetroShareLink::TYPE_POSTED, mGroup.mMeta.mGroupId, groupName()); -// ui->nameLabel->setText(link.toHtml()); - ui->nameLabel->setText(groupName()); + RetroShareLink link; + link.createGxsGroupLink(RetroShareLink::TYPE_POSTED, mGroup.mMeta.mGroupId, groupName()); + ui->nameLabel->setText(link.toHtml()); +// ui->nameLabel->setText(groupName()); ui->descLabel->setText(QString::fromUtf8(mGroup.mDescription.c_str())); diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index 5666a35b7..7458e0406 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -69,6 +69,7 @@ GxsIdDetails::GxsIdDetails() { mCheckTimerId = 0; mProcessDisableCount = 0; + mPendingDataIterator = mPendingData.end() ; connect(this, SIGNAL(startTimerFromThread()), this, SLOT(doStartTimer())); } @@ -106,16 +107,16 @@ void GxsIdDetails::objectDestroyed(QObject *object) /* Object is about to be destroyed, remove it from pending list */ QList::iterator dataIt; - for (dataIt = mPendingData.begin(); dataIt != mPendingData.end(); ) { - CallbackData &pendingData = *dataIt; - - if (pendingData.mObject == object) { - dataIt = mPendingData.erase(dataIt); - continue; - } - - ++dataIt; - } + + QMap::iterator it = mPendingData.find(object) ; + + if(it != mPendingData.end()) + { + if(it == mPendingDataIterator) + mPendingDataIterator = mPendingData.erase(it) ; + else + mPendingData.erase(it) ; + } } void GxsIdDetails::connectObject_locked(QObject *object, bool doConnect) @@ -125,13 +126,9 @@ void GxsIdDetails::connectObject_locked(QObject *object, bool doConnect) } /* Search Object in pending list */ - QList::iterator dataIt; - for (dataIt = mPendingData.begin(); dataIt != mPendingData.end(); ++dataIt) { - if (dataIt->mObject == object) { - /* Object still/already in pending list */ - return; - } - } + + if(mPendingData.find(object) == mPendingData.end()) // force disconnect when not in the list + doConnect = false ; if (doConnect) { connect(object, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*))); @@ -155,12 +152,16 @@ void GxsIdDetails::timerEvent(QTimerEvent *event) if (!mPendingData.empty()) { /* Check pending id's */ int processed = qMin(MAX_PROCESS_COUNT_PER_TIMER, mPendingData.size()); + while (!mPendingData.isEmpty()) { if (processed-- <= 0) { break; } + + if(mPendingDataIterator == mPendingData.end()) + mPendingDataIterator = mPendingData.begin() ; - CallbackData &pendingData = mPendingData.front(); + CallbackData &pendingData = *mPendingDataIterator; RsIdentityDetails details; if (rsIdentity->getIdDetails(pendingData.mId, details)) { @@ -168,9 +169,10 @@ void GxsIdDetails::timerEvent(QTimerEvent *event) pendingData.mCallback(GXS_ID_DETAILS_TYPE_DONE, details, pendingData.mObject, pendingData.mData); QObject *object = pendingData.mObject; - mPendingData.pop_front(); connectObject_locked(object, false); + mPendingDataIterator = mPendingData.erase(mPendingDataIterator); + continue; } @@ -180,13 +182,16 @@ void GxsIdDetails::timerEvent(QTimerEvent *event) pendingData.mCallback(GXS_ID_DETAILS_TYPE_FAILED, details, pendingData.mObject, pendingData.mData); QObject *object = pendingData.mObject; - mPendingData.pop_front(); connectObject_locked(object, false); + mPendingDataIterator = mPendingData.erase(mPendingDataIterator); + continue; } - - mPendingData.move(0, mPendingData.size() - 1); + + ++mPendingDataIterator ; + + //mPendingData.move(0, mPendingData.size() - 1); } } } @@ -246,6 +251,26 @@ bool GxsIdDetails::process(const RsGxsId &id, GxsIdDetailsCallbackFunction callb return true; } + // remove any existing call for this object. This is needed for when the same widget is used to display IDs that vary in time. + { + QMutexLocker lock(&mInstance->mMutex); + + // check if a pending request is not already on its way. If so, replace it. + + QMap::iterator it = mInstance->mPendingData.find(object) ; + + if(it != mInstance->mPendingData.end()) + { + mInstance->connectObject_locked(object, false); + + if(mInstance->mPendingDataIterator == it) + mInstance->mPendingDataIterator = mInstance->mPendingData.erase(it) ; + else + mInstance->mPendingData.erase(it) ; + } + + /* Connect signal "destroy" */ + } /* Try to get the information */ // the idea behind this was, to call the callback directly when the identity is already loaded in librs // without one timer tick, but it causes the use of Pixmap in avatars within a threat that is different than @@ -277,10 +302,12 @@ bool GxsIdDetails::process(const RsGxsId &id, GxsIdDetailsCallbackFunction callb { QMutexLocker lock(&mInstance->mMutex); + // check if a pending request is not already on its way. If so, replace it. + + mInstance->mPendingData[object] = pendingData; + /* Connect signal "destroy" */ mInstance->connectObject_locked(object, true); - - mInstance->mPendingData.push_back(pendingData); } /* Start timer */ diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.h b/retroshare-gui/src/gui/gxs/GxsIdDetails.h index 3c9259ff3..ef15c5fdd 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.h +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.h @@ -132,7 +132,8 @@ protected: static GxsIdDetails *mInstance; /* Pending data */ - QList mPendingData; + QMap mPendingData; + QMap::iterator mPendingDataIterator; int mCheckTimerId; int mProcessDisableCount; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index 15cb71092..648de299e 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -22,6 +22,8 @@ #include #include +#include "retroshare/rsgxscircles.h" + #include "GxsChannelPostsWidget.h" #include "ui_GxsChannelPostsWidget.h" #include "gui/feeds/GxsChannelPostItem.h" @@ -265,6 +267,36 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group) } else { ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount)); ui->infoDescription->setText(QString::fromUtf8(group.mDescription.c_str())); + + ui->infoAdministrator->setId(group.mMeta.mAuthorId) ; + + QString distrib_string ( "[unknown]" ); + + switch(group.mMeta.mCircleType) + { + case GXS_CIRCLE_TYPE_PUBLIC: distrib_string = tr("Public") ; + break ; + case GXS_CIRCLE_TYPE_EXTERNAL: + { + RsGxsCircleDetails det ; + + // !! What we need here is some sort of CircleLabel, which loads the circle and updates the label when done. + + if(rsGxsCircles->getCircleDetails(group.mMeta.mCircleId,det)) + distrib_string = tr("Restricted to members of circle \"")+QString::fromUtf8(det.mCircleName.c_str()) +"\""; + else + distrib_string = tr("Restricted to members of circle ")+QString::fromStdString(group.mMeta.mCircleId.toStdString()) ; + } + break ; + case GXS_CIRCLE_TYPE_YOUREYESONLY: distrib_string = tr("Your eyes only"); + break ; + case GXS_CIRCLE_TYPE_LOCAL: distrib_string = tr("You and your friend nodes"); + break ; + default: + std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl; + } + + ui->infoDistribution->setText(distrib_string); ui->infoWidget->show(); ui->feedWidget->hide(); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui index d91812fca..bdb6ca5d2 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.ui @@ -6,7 +6,7 @@ 0 0 - 681 + 793 465 @@ -14,7 +14,16 @@ 4 - + + 0 + + + 0 + + + 0 + + 0 @@ -26,7 +35,16 @@ QFrame::Sunken - + + 4 + + + 4 + + + 4 + + 4 @@ -289,7 +307,16 @@ - + + 3 + + + 3 + + + 3 + + 3 @@ -370,15 +397,8 @@ - - - - 0 - - - - + 75 @@ -386,7 +406,7 @@ - Description: + Administrator: @@ -409,14 +429,14 @@ - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Description</p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html>
Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse @@ -426,6 +446,53 @@ p, li { white-space: pre-wrap; } + + + + + 75 + true + + + + Description: + + + + + + + unknown + + + + + + + 0 + + + + + + + + 75 + true + + + + Distribution: + + + + + + + unknown + + + @@ -485,6 +552,11 @@ p, li { white-space: pre-wrap; } infoWidget + + GxsIdLabel + QLabel +
gui/gxs/GxsIdLabel.h
+
StyledElidedLabel QLabel diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index da7168f7d..3c515be49 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -130,7 +130,6 @@ ChatPage::save(QString &/*errmsg*/) Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked()); - Settings->setChatSearchShowBarByDefault(ui.cbSearch_ShowBar->isChecked()); Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value()); Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked()); Settings->setChatSearchWholeWords(ui.cbSearch_WholeWords->isChecked()); @@ -238,7 +237,6 @@ ChatPage::load() ui.sendMessageWithCtrlReturn->setChecked(Settings->getChatSendMessageWithCtrlReturn()); - ui.cbSearch_ShowBar->setChecked(Settings->getChatSearchShowBarByDefault()); ui.sbSearch_CharToStart->setValue(Settings->getChatSearchCharToStartSearch()); ui.cbSearch_CaseSensitively->setChecked(Settings->getChatSearchCaseSensitively()); ui.cbSearch_WholeWords->setChecked(Settings->getChatSearchWholeWords()); diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp index 0dfc713f9..8c7220186 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.cpp +++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp @@ -512,16 +512,6 @@ void RshareSettings::setChatSendMessageWithCtrlReturn(bool bValue) setValueToGroup("Chat", "SendMessageWithCtrlReturn", bValue); } -bool RshareSettings::getChatSearchShowBarByDefault() -{ - return valueFromGroup("Chat", "SearchShowBarByDefault", false).toBool(); -} - -void RshareSettings::setChatSearchShowBarByDefault(bool bValue) -{ - setValueToGroup("Chat", "SearchShowBarByDefault", bValue); -} - void RshareSettings::setChatSearchCharToStartSearch(int iValue) { setValueToGroup("Chat", "SearchCharToStartSearch", iValue); diff --git a/retroshare-gui/src/gui/settings/rsharesettings.h b/retroshare-gui/src/gui/settings/rsharesettings.h index 52963ce92..2f344b3a9 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.h +++ b/retroshare-gui/src/gui/settings/rsharesettings.h @@ -209,9 +209,6 @@ public: bool getChatSendMessageWithCtrlReturn(); void setChatSendMessageWithCtrlReturn(bool bValue); - bool getChatSearchShowBarByDefault(); - void setChatSearchShowBarByDefault(bool bValue); - void setChatSearchCharToStartSearch(int iValue); int getChatSearchCharToStartSearch(); diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index d3adda36b..0c059f048 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -145,6 +145,7 @@ bool RsHtml::canReplaceAnchor(QDomDocument &/*doc*/, QDomElement &/*element*/, c case RetroShareLink::TYPE_PERSON: case RetroShareLink::TYPE_FORUM: case RetroShareLink::TYPE_CHANNEL: + case RetroShareLink::TYPE_POSTED: case RetroShareLink::TYPE_SEARCH: case RetroShareLink::TYPE_MESSAGE: case RetroShareLink::TYPE_EXTRAFILE: @@ -173,6 +174,7 @@ void RsHtml::anchorStylesheetForImg(QDomDocument &/*doc*/, QDomElement &/*elemen case RetroShareLink::TYPE_PERSON: case RetroShareLink::TYPE_FORUM: case RetroShareLink::TYPE_CHANNEL: + case RetroShareLink::TYPE_POSTED: case RetroShareLink::TYPE_SEARCH: case RetroShareLink::TYPE_MESSAGE: case RetroShareLink::TYPE_EXTRAFILE: