diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index f2fae0210..bd6b350ef 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -71,9 +71,7 @@ static NewsFeed *instance = NULL; /** Constructor */ -NewsFeed::NewsFeed(QWidget *parent) : - RsAutoUpdatePage(1000,parent), - ui(new Ui::NewsFeed) +NewsFeed::NewsFeed(QWidget *parent) : MainPage(parent), ui(new Ui::NewsFeed) { mEventHandlerId =0; // needed to force intialization by registerEventsHandler() rsEvents->registerEventsHandler( [this](std::shared_ptr event) { handleEvent(event); }, mEventHandlerId ); @@ -81,8 +79,6 @@ NewsFeed::NewsFeed(QWidget *parent) : /* Invoke the Qt Designer generated object setup routine */ ui->setupUi(this); - setUpdateWhenInvisible(true); - if (!instance) { instance = this; } @@ -395,185 +391,9 @@ void NewsFeed::handleSecurityEvent(std::shared_ptr event) MessageComposer::addConnectAttemptMsg(e.mPgpId, e.mSslId, QString::fromStdString(det.name + "(" + det.location + ")")); } -void NewsFeed::updateDisplay() -{ - if (!rsNotify) - return; - - uint flags = Settings->getNewsFeedFlags(); - - /* check for new messages */ - RsFeedItem fi; - if (rsNotify->GetFeedItem(fi)) - { - switch(fi.mType) - { -#ifdef TO_REMOVE - case RS_FEED_ITEM_PEER_HELLO: - if (flags & RS_FEED_TYPE_PEER) - addFeedItemPeerHello(fi); - break; - case RS_FEED_ITEM_PEER_NEW: - if (flags & RS_FEED_TYPE_PEER) - addFeedItemPeerNew(fi); - break; - case RS_FEED_ITEM_PEER_OFFSET: - //if (flags & RS_FEED_TYPE_PEER) //Always allow this feed even if Friend notify is disabled. - addFeedItemPeerOffset(fi); - break; - - if (flags & RS_FEED_TYPE_SECURITY) - addFeedItemSecurityConnectAttempt(fi); - break; - case RS_FEED_ITEM_SEC_UNKNOWN_IN: - if (flags & RS_FEED_TYPE_SECURITY) - addFeedItemSecurityUnknownIn(fi); - break; - case RS_FEED_ITEM_SEC_UNKNOWN_OUT: - if (flags & RS_FEED_TYPE_SECURITY) - addFeedItemSecurityUnknownOut(fi); - break; - - case RS_FEED_ITEM_SEC_IP_WRONG_EXTERNAL_IP_REPORTED: - if (flags & RS_FEED_TYPE_SECURITY_IP) - addFeedItemSecurityWrongExternalIpReported(fi, false); - break; - - case RS_FEED_ITEM_CHANNEL_NEW: - if (flags & RS_FEED_TYPE_CHANNEL) - addFeedItemChannelNew(fi); - break; -// case RS_FEED_ITEM_CHANNEL_UPDATE: -// if (flags & RS_FEED_TYPE_CHANNEL) -// addFeedItemChannelUpdate(fi); -// break; - case RS_FEED_ITEM_CHANNEL_MSG: - if (flags & RS_FEED_TYPE_CHANNEL) - addFeedItemChannelMsg(fi); - break; - case RS_FEED_ITEM_CHANNEL_PUBLISHKEY: - { - if (!mTokenQueueChannel) { - mTokenQueueChannel = new TokenQueue(rsGxsChannels->getTokenService(), instance); - } - - addFeedItemChannelPublishKey(fi); - -// RsGxsGroupId grpId(fi.mId1); -// if (!grpId.isNull()) { -// RsTokReqOptions opts; -// opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; -// -// std::list grpIds; -// grpIds.push_back(grpId); -// -// uint32_t token; -// mTokenQueueChannel->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, grpIds, TOKEN_TYPE_PUBLISHKEY); -// } - } - break; - - case RS_FEED_ITEM_FORUM_NEW: - if (flags & RS_FEED_TYPE_FORUM) - addFeedItemForumNew(fi); - break; -// case RS_FEED_ITEM_FORUM_UPDATE: -// if (flags & RS_FEED_TYPE_FORUM) -// addFeedItemForumUpdate(fi); -// break; - case RS_FEED_ITEM_FORUM_MSG: - if (flags & RS_FEED_TYPE_FORUM) - addFeedItemForumMsg(fi); - break; - case RS_FEED_ITEM_FORUM_PUBLISHKEY: - { - if (!mTokenQueueForum) { - mTokenQueueForum = new TokenQueue(rsGxsForums->getTokenService(), instance); - } - - RsGxsGroupId grpId(fi.mId1); - if (!grpId.isNull()) { - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - - std::list grpIds; - grpIds.push_back(grpId); - - uint32_t token; - mTokenQueueForum->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, grpIds, TOKEN_TYPE_PUBLISHKEY); - } - } -// if (flags & RS_FEED_TYPE_FORUM) -// addFeedItemForumPublishKey(fi); - break; - - case RS_FEED_ITEM_POSTED_NEW: - if (flags & RS_FEED_TYPE_POSTED) - addFeedItemPostedNew(fi); - break; -// case RS_FEED_ITEM_POSTED_UPDATE: -// if (flags & RS_FEED_TYPE_POSTED) -// addFeedItemPostedUpdate(fi); -// break; - case RS_FEED_ITEM_POSTED_MSG: - if (flags & RS_FEED_TYPE_POSTED) - addFeedItemPostedMsg(fi); - break; -#endif - -#if 0 - case RS_FEED_ITEM_BLOG_NEW: - if (flags & RS_FEED_TYPE_BLOG) - addFeedItemBlogNew(fi); - break; - case RS_FEED_ITEM_BLOG_MSG: - if (flags & RS_FEED_TYPE_BLOG) - addFeedItemBlogMsg(fi); - break; -#endif - -#ifdef TO_REMOVE - case RS_FEED_ITEM_CHAT_NEW: - if (flags & RS_FEED_TYPE_CHAT) - addFeedItemChatNew(fi, false); - break; - - case RS_FEED_ITEM_MESSAGE: - if (flags & RS_FEED_TYPE_MSG) - addFeedItemMessage(fi); - break; - - case RS_FEED_ITEM_FILES_NEW: - if (flags & RS_FEED_TYPE_FILES) - addFeedItemFilesNew(fi); - break; -#endif - - default: - std::cerr << "(EE) Unknown type " << std::hex << fi.mType << std::dec << " in news feed." << std::endl; - break; - } - } else { - /* process plugin feeds */ - int pluginCount = rsPlugins->nbPlugins(); - for (int i = 0; i < pluginCount; ++i) { - RsPlugin *rsPlugin = rsPlugins->plugin(i); - if (rsPlugin) { - FeedNotify *feedNotify = rsPlugin->qt_feedNotify(); - if (feedNotify && feedNotify->notifyEnabled()) { - FeedItem *item = feedNotify->feedItem(this); - if (item) { - addFeedItem(item); - break; - } - } - } - } - } -} - void NewsFeed::testFeeds(uint notifyFlags) { +#ifdef TO_REMOVE if (!instance) { return; } @@ -588,548 +408,13 @@ void NewsFeed::testFeeds(uint notifyFlags) ++pos; RsFeedItem fi; - -#ifdef TODO - switch(type) { - case RS_FEED_TYPE_PEER: - fi.mId1 = rsPeers->getOwnId().toStdString(); - - instance->addFeedItemPeerConnect(fi); - instance->addFeedItemPeerDisconnect(fi); - instance->addFeedItemPeerHello(fi); - instance->addFeedItemPeerNew(fi); - break; - - case RS_FEED_TYPE_SECURITY: - fi.mId1 = rsPeers->getGPGOwnId().toStdString(); - fi.mId2 = rsPeers->getOwnId().toStdString(); - - instance->addFeedItemSecurityConnectAttempt(fi); - instance->addFeedItemSecurityAuthDenied(fi); - instance->addFeedItemSecurityUnknownIn(fi); - instance->addFeedItemSecurityUnknownOut(fi); - - break; - - case RS_FEED_TYPE_SECURITY_IP: - fi.mId1 = rsPeers->getOwnId().toStdString(); - fi.mId2 = "0.0.0.0"; - fi.mResult1 = RSBANLIST_CHECK_RESULT_BLACKLISTED; - instance->addFeedItemSecurityIpBlacklisted(fi, true); - - //fi.mId1 = rsPeers->getOwnId().toStdString(); - fi.mId2 = "0.0.0.1"; - fi.mId3 = "0.0.0.2"; - fi.mResult1 = 0; - instance->addFeedItemSecurityWrongExternalIpReported(fi, true); - - break; - - case RS_FEED_TYPE_CHANNEL: - { - if (!instance->mTokenQueueChannel) { - instance->mTokenQueueChannel = new TokenQueue(rsGxsChannels->getTokenService(), instance); - } - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - instance->mTokenQueueChannel->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, TOKEN_TYPE_GROUP); - - break; - } - - case RS_FEED_TYPE_FORUM: - { - if (!instance->mTokenQueueForum) { - instance->mTokenQueueForum = new TokenQueue(rsGxsForums->getTokenService(), instance); - } - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - instance->mTokenQueueForum->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, TOKEN_TYPE_GROUP); - - break; - } - - case RS_FEED_TYPE_POSTED: - { - if (!instance->mTokenQueuePosted) { - instance->mTokenQueuePosted = new TokenQueue(rsPosted->getTokenService(), instance); - } - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - instance->mTokenQueuePosted->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, TOKEN_TYPE_GROUP); - - break; - } - -#if 0 - case RS_FEED_TYPE_BLOG: -// not used -// instance->addFeedItemBlogNew(fi); -// instance->addFeedItemBlogMsg(fi); - break; -#endif - - case RS_FEED_TYPE_CHAT: - fi.mId1 = rsPeers->getOwnId().toStdString(); - fi.mId2 = tr("This is a test.").toUtf8().constData(); - - instance->addFeedItemChatNew(fi, true); - break; - - case RS_FEED_TYPE_MSG: - { - std::list msgList; - rsMail->getMessageSummaries(msgList); - - std::list::const_iterator msgIt; - for (msgIt = msgList.begin(); msgIt != msgList.end(); ++msgIt) { - if (fi.mId1.empty()) { - /* store first message */ - fi.mId1 = msgIt->msgId; - } - - if (msgIt->msgflags & RS_MSG_TRASH) { - continue; - } - - if ((msgIt->msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX) { - /* take message from inbox */ - fi.mId1 = msgIt->msgId; - break; - } - } - - instance->addFeedItemMessage(fi); - break; - } - - case RS_FEED_TYPE_FILES: -// not used -// instance->addFeedItemFilesNew(fi); - break; - - case RS_FEED_TYPE_CIRCLE: - { - if (!instance->mTokenQueueCircle) { - instance->mTokenQueueCircle = new TokenQueue(rsGxsCircles->getTokenService(), instance); - } - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - uint32_t token; - instance->mTokenQueueCircle->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, TOKEN_TYPE_GROUP); - - break; - } -// instance->addFeedItemCircleMembReq(fi); -// instance->addFeedItemCircleInvitRec(fi); - break; - - } -#endif } instance->ui->feedWidget->enableCountChangedSignal(true); instance->sendNewsFeedChanged(); -} - -#ifdef TO_REMOVE -void NewsFeed::loadCircleGroup(const uint32_t &token) -{ - std::vector groups; - if (!rsGxsCircles->getGroupData(token, groups)) { - std::cerr << "NewsFeed::loadCircleGroup() ERROR getting data"; - std::cerr << std::endl; - return; - } - - std::list own_identities; - rsIdentity->getOwnIds(own_identities); - - std::vector::const_iterator circleIt; - for (circleIt = groups.begin(); circleIt != groups.end(); ++circleIt) { - RsGxsCircleGroup group = *(circleIt); - RsGxsCircleDetails details; - if(rsGxsCircles->getCircleDetails(group.mMeta.mCircleId,details)) - { - for(std::list::const_iterator it(own_identities.begin());it!=own_identities.end();++it) { - std::map::const_iterator vit = details.mSubscriptionFlags.find(*it); - uint32_t subscribe_flags = (vit == details.mSubscriptionFlags.end())?0:(vit->second); - - if( !(subscribe_flags & GXS_EXTERNAL_CIRCLE_FLAGS_SUBSCRIBED) - && (subscribe_flags & GXS_EXTERNAL_CIRCLE_FLAGS_IN_ADMIN_LIST) ) { - - RsFeedItem fi; - fi.mId1 = group.mMeta.mGroupId.toStdString(); - fi.mId2 = it->toStdString(); - - instance->addFeedItemCircleInvitRec(fi); - - } - } - } - } -} - -void NewsFeed::loadChannelGroup(const uint32_t &token) -{ - std::vector groups; - if (!rsGxsChannels->getGroupData(token, groups)) { - std::cerr << "NewsFeed::loadChannelGroup() ERROR getting data"; - std::cerr << std::endl; - return; - } - - RsFeedItem fi; - std::vector::iterator channelIt; - for (channelIt = groups.begin(); channelIt != groups.end(); ++channelIt) { - if (fi.mId1.empty()) { - /* store first channel */ - fi.mId1 = channelIt->mMeta.mGroupId.toStdString(); - } - - if (!channelIt->mDescription.empty()) { - /* take channel with description */ - fi.mId1 = channelIt->mMeta.mGroupId.toStdString(); - break; - } - } - - if (fi.mId1.empty()) { - return; - } - - instance->addFeedItemChannelNew(fi); -// instance->addFeedItemChanUpdate(fi); - - /* Prepare group ids for message request */ - std::list grpIds; - for (channelIt = groups.begin(); channelIt != groups.end(); ++channelIt) { - grpIds.push_back(channelIt->mMeta.mGroupId); - } - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - opts.mOptions = RS_TOKREQOPT_MSG_THREAD; - uint32_t msgToken; - instance->mTokenQueueChannel->requestMsgInfo(msgToken, RS_TOKREQ_ANSTYPE_SUMMARY, opts, grpIds, TOKEN_TYPE_MESSAGE); -} - -void NewsFeed::loadChannelPost(const uint32_t &token) -{ - std::vector posts; - if (!rsGxsChannels->getPostData(token, posts)) { - std::cerr << "NewsFeed::loadChannelPost() ERROR getting data"; - std::cerr << std::endl; - return; - } - - RsFeedItem fi; - std::vector::iterator postIt; - for (postIt = posts.begin(); postIt != posts.end(); ++postIt) { - if (fi.mId2.empty()) { - /* store first channel message */ - fi.mId1 = postIt->mMeta.mGroupId.toStdString(); - fi.mId2 = postIt->mMeta.mMsgId.toStdString(); - } - - if (!postIt->mMsg.empty()) { - /* take channel message with description */ - fi.mId1 = postIt->mMeta.mGroupId.toStdString(); - fi.mId2 = postIt->mMeta.mMsgId.toStdString(); - break; - } - } - - if (!fi.mId1.empty()) { - instance->addFeedItemChannelMsg(fi); - } -} - -void NewsFeed::loadChannelPublishKey(const uint32_t &token) -{ - std::vector groups; - if (!rsGxsChannels->getGroupData(token, groups)) { - std::cerr << "NewsFeed::loadChannelPublishKey() ERROR getting data"; - std::cerr << std::endl; - return; - } - - if (groups.size() != 1) - { - std::cerr << "NewsFeed::loadChannelPublishKey() Wrong number of Items"; - std::cerr << std::endl; - return; - } -#ifdef UNUSED_CODE - MessageComposer::sendChannelPublishKey(groups[0]); -#endif - - RsGxsChannelGroup& grp = *groups.begin(); - - RsFeedItem fi; - fi.mId1 = grp.mMeta.mGroupId.toStdString(); - - - addFeedItemChannelPublishKey(fi); -} - -void NewsFeed::loadForumGroup(const uint32_t &token) -{ - std::vector forums; - if (!rsGxsForums->getGroupData(token, forums)) { - std::cerr << "NewsFeed::loadForumGroup() ERROR getting data"; - std::cerr << std::endl; - return; - } - - RsFeedItem fi; - std::vector::iterator forumIt; - for (forumIt = forums.begin(); forumIt != forums.end(); ++forumIt) { - if (fi.mId1.empty()) { - /* store first forum */ - fi.mId1 = forumIt->mMeta.mGroupId.toStdString(); - } - - if (!forumIt->mDescription.empty()) { - /* take forum with description */ - fi.mId1 = forumIt->mMeta.mGroupId.toStdString(); - break; - } - } - - if (fi.mId1.empty()) { - return; - } - - instance->addFeedItemForumNew(fi); -// instance->addFeedItemForumUpdate(fi); - - /* Prepare group ids for message request */ - std::list grpIds; - for (forumIt = forums.begin(); forumIt != forums.end(); ++forumIt) { - grpIds.push_back(forumIt->mMeta.mGroupId); - } - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - opts.mOptions = RS_TOKREQOPT_MSG_THREAD; - uint32_t msgToken; - instance->mTokenQueueForum->requestMsgInfo(msgToken, RS_TOKREQ_ANSTYPE_SUMMARY, opts, grpIds, TOKEN_TYPE_MESSAGE); -} - -void NewsFeed::loadForumMessage(const uint32_t &token) -{ - std::vector msgs; - if (!rsGxsForums->getMsgData(token, msgs)) { - std::cerr << "NewsFeed::loadForumPost() ERROR getting data"; - std::cerr << std::endl; - return; - } - - RsFeedItem fi; - std::vector::iterator msgIt; - for (msgIt = msgs.begin(); msgIt != msgs.end(); ++msgIt) { - if (fi.mId2.empty()) { - /* store first forum message */ - fi.mId1 = msgIt->mMeta.mGroupId.toStdString(); - fi.mId2 = msgIt->mMeta.mMsgId.toStdString(); - } - - if (!msgIt->mMsg.empty()) { - /* take forum message with description */ - fi.mId1 = msgIt->mMeta.mGroupId.toStdString(); - fi.mId2 = msgIt->mMeta.mMsgId.toStdString(); - break; - } - } - - if (!fi.mId1.empty()) { - instance->addFeedItemForumMsg(fi); - } -} - -void NewsFeed::loadForumPublishKey(const uint32_t &token) -{ - std::vector groups; - if (!rsGxsForums->getGroupData(token, groups)) { - std::cerr << "NewsFeed::loadForumPublishKey() ERROR getting data"; - std::cerr << std::endl; - return; - } - - if (groups.size() != 1) - { - std::cerr << "NewsFeed::loadForumPublishKey() Wrong number of Items"; - std::cerr << std::endl; - return; - } -#ifdef UNUSED_CODE - MessageComposer::sendForumPublishKey(groups[0]); -#endif - - std::cerr << "(EE) Unimplemented code: received an order to load/display item for received forum publish key, but the implementation is missing." << std::endl; -} - -void NewsFeed::loadPostedGroup(const uint32_t &token) -{ - std::vector posted; - if (!rsPosted->getGroupData(token, posted)) { - std::cerr << "NewsFeed::loadPostedGroup() ERROR getting data"; - std::cerr << std::endl; - return; - } - - RsFeedItem fi; - std::vector::iterator postedIt; - for (postedIt = posted.begin(); postedIt != posted.end(); ++postedIt) { - if (fi.mId1.empty()) { - /* store first posted */ - fi.mId1 = postedIt->mMeta.mGroupId.toStdString(); - } - - if (!postedIt->mDescription.empty()) { - /* take posted with description */ - fi.mId1 = postedIt->mMeta.mGroupId.toStdString(); - break; - } - } - - if (fi.mId1.empty()) { - return; - } - - instance->addFeedItemPostedNew(fi); -// instance->addFeedItemPostedUpdate(fi); - - /* Prepare group ids for message request */ - std::list grpIds; - for (postedIt = posted.begin(); postedIt != posted.end(); ++postedIt) { - grpIds.push_back(postedIt->mMeta.mGroupId); - } - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - opts.mOptions = RS_TOKREQOPT_MSG_THREAD; - uint32_t msgToken; - instance->mTokenQueuePosted->requestMsgInfo(msgToken, RS_TOKREQ_ANSTYPE_SUMMARY, opts, grpIds, TOKEN_TYPE_MESSAGE); -} - -void NewsFeed::loadPostedMessage(const uint32_t &token) -{ - std::vector msgs; - if (!rsPosted->getPostData(token, msgs)) { - std::cerr << "NewsFeed::loadPostedPost() ERROR getting data"; - std::cerr << std::endl; - return; - } - - RsFeedItem fi; - std::vector::iterator msgIt; - for (msgIt = msgs.begin(); msgIt != msgs.end(); ++msgIt) { - if (fi.mId2.empty()) { - /* store first posted message */ - fi.mId1 = msgIt->mMeta.mGroupId.toStdString(); - fi.mId2 = msgIt->mMeta.mMsgId.toStdString(); - } - - if (!msgIt->mLink.empty()) { - /* take posted message with description */ - fi.mId1 = msgIt->mMeta.mGroupId.toStdString(); - fi.mId2 = msgIt->mMeta.mMsgId.toStdString(); - break; - } - } - - if (!fi.mId1.empty()) { - instance->addFeedItemPostedMsg(fi); - } -} -#endif - -void NewsFeed::loadRequest(const TokenQueue *queue, const TokenRequest &req) -{ -#ifdef TO_REMOVE - if (queue == mTokenQueueChannel) { - switch (req.mUserType) { - case TOKEN_TYPE_GROUP: - loadChannelGroup(req.mToken); - break; - - case TOKEN_TYPE_MESSAGE: - loadChannelPost(req.mToken); - break; - - case TOKEN_TYPE_PUBLISHKEY: - loadChannelPublishKey(req.mToken); - break; - - default: - std::cerr << "NewsFeed::loadRequest() ERROR: INVALID CHANNEL TYPE"; - std::cerr << std::endl; - break; - } - } - - if (queue == mTokenQueueCircle) { - switch (req.mUserType) { - case TOKEN_TYPE_GROUP: - loadCircleGroup(req.mToken); - break; - - case TOKEN_TYPE_MESSAGE: - loadCircleMessage(req.mToken); - break; - - default: - std::cerr << "NewsFeed::loadRequest() ERROR: INVALID CIRCLE TYPE"; - std::cerr << std::endl; - break; - } - } - - if (queue == mTokenQueueForum) { - switch (req.mUserType) { - case TOKEN_TYPE_GROUP: - loadForumGroup(req.mToken); - break; - - case TOKEN_TYPE_MESSAGE: - loadForumMessage(req.mToken); - break; - - case TOKEN_TYPE_PUBLISHKEY: - loadForumPublishKey(req.mToken); - break; - - default: - std::cerr << "NewsFeed::loadRequest() ERROR: INVALID FORUM TYPE"; - std::cerr << std::endl; - break; - } - } - - if (queue == mTokenQueuePosted) { - switch (req.mUserType) { - case TOKEN_TYPE_GROUP: - loadPostedGroup(req.mToken); - break; - - case TOKEN_TYPE_MESSAGE: - loadPostedMessage(req.mToken); - break; - - default: - std::cerr << "NewsFeed::loadRequest() ERROR: INVALID POSTED TYPE"; - std::cerr << std::endl; - break; - } - } #endif + std::cerr << "(EE) testFeeds() is currently disabled" << std::endl; } void NewsFeed::testFeed(FeedNotify *feedNotify) @@ -1205,470 +490,6 @@ void NewsFeed::remUniqueFeedItem(FeedItem *item) } } -#ifdef TO_REMOVE -void NewsFeed::addFeedItemPeerConnect(const RsFeedItem &fi) -{ - /* make new widget */ - PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_CONNECT, false); - - /* add to layout */ - addFeedItem(pi); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemPeerConnect()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemPeerDisconnect(const RsFeedItem &fi) -{ - /* make new widget */ - PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_STD, false); - - /* add to layout */ - addFeedItem(pi); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemPeerDisconnect()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemPeerHello(const RsFeedItem &fi) -{ - /* make new widget */ - PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_HELLO, false); - - /* add to layout */ - addFeedItem(pi); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemPeerHello()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemPeerNew(const RsFeedItem &fi) -{ - /* make new widget */ - PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_NEW_FOF, false); - - /* add to layout */ - addFeedItem(pi); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemPeerNew()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemPeerOffset(const RsFeedItem &fi) -{ - /* make new widget */ - PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_OFFSET, false); - - /* add to layout */ - addFeedItemIfUnique(pi, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemPeerOffset()"; - std::cerr << std::endl; -#endif -} - - -void NewsFeed::addFeedItemSecurityConnectAttempt(const RsFeedItem &fi) -{ - /* make new widget */ - SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, fi.mType, false); - - /* add to layout */ - addFeedItemIfUnique(pi, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemSecurityConnectAttempt()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemSecurityAuthDenied(const RsFeedItem &fi) -{ - /* make new widget */ - SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, fi.mType, false); - - /* add to layout */ - addFeedItemIfUnique(pi, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemSecurityAuthDenied()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemSecurityUnknownIn(const RsFeedItem &fi) -{ - /* make new widget */ - SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, RS_FEED_ITEM_SEC_UNKNOWN_IN, false); - - /* add to layout */ - addFeedItemIfUnique(pi, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemSecurityUnknownIn()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemSecurityUnknownOut(const RsFeedItem &fi) -{ - /* make new widget */ - SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, RS_FEED_ITEM_SEC_UNKNOWN_OUT, false); - - /* add to layout */ - addFeedItemIfUnique(pi, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemSecurityUnknownOut()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemSecurityIpBlacklisted(const RsFeedItem &fi, bool isTest) -{ - /* make new widget */ - SecurityIpItem *pi = new SecurityIpItem(this, RsPeerId(fi.mId1), fi.mId2, fi.mResult1, RS_FEED_ITEM_SEC_IP_BLACKLISTED, isTest); - - /* add to layout */ - addFeedItemIfUnique(pi, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemSecurityIpBlacklisted()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemSecurityWrongExternalIpReported(const RsFeedItem &fi, bool isTest) -{ - /* make new widget */ - SecurityIpItem *pi = new SecurityIpItem(this, RsPeerId(fi.mId1), fi.mId2, fi.mId3, RS_FEED_ITEM_SEC_IP_WRONG_EXTERNAL_IP_REPORTED, isTest); - - /* add to layout */ - addFeedItemIfUnique(pi, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemSecurityWrongExternalIpReported()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemChannelNew(const RsFeedItem &fi) -{ - RsGxsGroupId grpId(fi.mId1); - - if (grpId.isNull()) { - return; - } - - /* make new widget */ - GxsChannelGroupItem *item = new GxsChannelGroupItem(this, NEWSFEED_CHANNELNEWLIST, grpId, false, true); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemChanNew()"; - std::cerr << std::endl; -#endif -} - -//void NewsFeed::addFeedItemChannelUpdate(const RsFeedItem &fi) -//{ -// /* make new widget */ -// ChanNewItem *cni = new ChanNewItem(this, NEWSFEED_CHANNEWLIST, fi.mId1, false, false); - -// /* add to layout */ -// addFeedItem(cni); - -//#ifdef NEWS_DEBUG -// std::cerr << "NewsFeed::addFeedItemChanUpdate()"; -// std::cerr << std::endl; -//#endif -//} - -void NewsFeed::addFeedItemChannelMsg(const RsFeedItem &fi) -{ - RsGxsGroupId grpId(fi.mId1); - RsGxsMessageId msgId(fi.mId2); - - if (grpId.isNull() || msgId.isNull()) { - return; - } - - /* make new widget */ - GxsChannelPostItem *item = new GxsChannelPostItem(this, NEWSFEED_CHANNELNEWLIST, grpId, msgId, false, true); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemChanMsg()"; - std::cerr << std::endl; -#endif -} -void NewsFeed::addFeedItemChannelPublishKey(const RsFeedItem &fi) -{ - RsGxsGroupId grpId(fi.mId1); - - if (grpId.isNull()) - return; - - /* make new widget */ - GxsChannelGroupItem *item = new GxsChannelGroupItem(this, NEWSFEED_CHANNELPUBKEYLIST, grpId, false, true); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemChanMsg()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemForumNew(const RsFeedItem &fi) -{ - RsGxsGroupId grpId(fi.mId1); - - if (grpId.isNull()) { - return; - } - - /* make new widget */ - GxsForumGroupItem *item = new GxsForumGroupItem(this, NEWSFEED_FORUMNEWLIST, grpId, false, true); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemForumNew()"; - std::cerr << std::endl; -#endif -} - -//void NewsFeed::addFeedItemForumUpdate(const RsFeedItem &fi) -//{ -// /* make new widget */ -// ForumNewItem *fni = new ForumNewItem(this, NEWSFEED_FORUMNEWLIST, fi.mId1, false, false); - -// /* add to layout */ -// addFeedItem(fni); - -//#ifdef NEWS_DEBUG -// std::cerr << "NewsFeed::addFeedItemForumUpdate()"; -// std::cerr << std::endl; -//#endif -//} - -void NewsFeed::addFeedItemForumMsg(const RsFeedItem &fi) -{ - RsGxsGroupId grpId(fi.mId1); - RsGxsMessageId msgId(fi.mId2); - - if (grpId.isNull() || msgId.isNull()) { - return; - } - - /* make new widget */ - GxsForumMsgItem *item = new GxsForumMsgItem(this, NEWSFEED_FORUMMSGLIST, grpId, msgId, false, true); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemForumMsg()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemPostedNew(const RsFeedItem &fi) -{ - RsGxsGroupId grpId(fi.mId1); - - if (grpId.isNull()) { - return; - } - - /* make new widget */ - PostedGroupItem *item = new PostedGroupItem(this, NEWSFEED_POSTEDNEWLIST, grpId, false, true); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemPostedNew()"; - std::cerr << std::endl; -#endif -} - -//void NewsFeed::addFeedItemPostedUpdate(const RsFeedItem &fi) -//{ -// /* make new widget */ -// GxsPostedGroupItem *item = new GxsPostedGroupItem(this, NEWSFEED_POSTEDNEWLIST, grpId, false, true); - -// /* add to layout */ -// addFeedItem(item); - -//#ifdef NEWS_DEBUG -// std::cerr << "NewsFeed::addFeedItemPostedUpdate()"; -// std::cerr << std::endl; -//#endif -//} - -void NewsFeed::addFeedItemPostedMsg(const RsFeedItem &fi) -{ - RsGxsGroupId grpId(fi.mId1); - RsGxsMessageId msgId(fi.mId2); - - if (grpId.isNull() || msgId.isNull()) { - return; - } - - /* make new widget */ - PostedItem *item = new PostedItem(this, NEWSFEED_POSTEDMSGLIST, grpId, msgId, false, true); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemPostedMsg()"; - std::cerr << std::endl; -#endif -} -#endif - -#if 0 -void NewsFeed::addFeedItemBlogNew(const RsFeedItem &fi) -{ - Q_UNUSED(fi); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemBlogNew()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemBlogMsg(const RsFeedItem &fi) -{ - Q_UNUSED(fi); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemBlogMsg()"; - std::cerr << std::endl; -#endif -} - - -void NewsFeed::addFeedItemChatNew(const RsFeedItem &fi, bool addWithoutCheck) -{ -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemChatNew()"; - std::cerr << std::endl; -#endif - - if (!addWithoutCheck && fi.mId1 == rsPeers->getOwnId().toStdString()) { - /* chat message from myself */ - return; - } - - /* make new widget */ - ChatMsgItem *cm = new ChatMsgItem(this, NEWSFEED_CHATMSGLIST, RsPeerId(fi.mId1), fi.mId2); - - /* add to layout */ - addFeedItem(cm); -} - -void NewsFeed::addFeedItemMessage(const RsFeedItem &fi) -{ - /* make new widget */ - MsgItem *mi = new MsgItem(this, NEWSFEED_MESSAGELIST, fi.mId1, false); - - /* add to layout */ - addFeedItem(mi); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemMessage()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemFilesNew(const RsFeedItem &/*fi*/) -{ -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemFilesNew()"; - std::cerr << std::endl; -#endif -} - -void NewsFeed::addFeedItemCircleMembReq(const RsFeedItem &fi) -{ - RsGxsCircleId circleId(fi.mId1); - RsGxsId gxsId(fi.mId2); - - if (circleId.isNull() || gxsId.isNull()) { - return; - } - - /* make new widget */ - GxsCircleItem *item = new GxsCircleItem(this, NEWSFEED_CIRCLELIST, circleId, gxsId, RS_FEED_ITEM_CIRCLE_MEMB_REQ); - - /* add to layout */ - addFeedItemIfUnique(item, false); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemCircleMembReq()" << std::endl; -#endif -} - -void NewsFeed::remFeedItemCircleMembReq(const RsFeedItem &fi) -{ - RsGxsCircleId circleId(fi.mId1); - RsGxsId gxsId(fi.mId2); - - if (circleId.isNull() || gxsId.isNull()) { - return; - } - - /* make new widget */ - GxsCircleItem *item = new GxsCircleItem(this, NEWSFEED_CIRCLELIST, circleId, gxsId, RS_FEED_ITEM_CIRCLE_MEMB_REQ); - - /* add to layout */ - remUniqueFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::remFeedItemCircleMembReq()" << std::endl; -#endif -} - -void NewsFeed::addFeedItemCircleInvitRec(const RsFeedItem &fi) -{ - RsGxsCircleId circleId(fi.mId1); - RsGxsId gxsId(fi.mId2); - - if (circleId.isNull()) { - return; - } - - /* make new widget */ - GxsCircleItem *item = new GxsCircleItem(this, NEWSFEED_CIRCLELIST, circleId, gxsId, RS_FEED_ITEM_CIRCLE_INVIT_REC); - - /* add to layout */ - addFeedItem(item); - -#ifdef NEWS_DEBUG - std::cerr << "NewsFeed::addFeedItemCircleInvitRec()" << std::endl; -#endif -} -#endif - /* FeedHolder Functions (for FeedItem functionality) */ QScrollArea *NewsFeed::getScrollArea() { diff --git a/retroshare-gui/src/gui/NewsFeed.h b/retroshare-gui/src/gui/NewsFeed.h index 7bb5a307e..c255d56ac 100644 --- a/retroshare-gui/src/gui/NewsFeed.h +++ b/retroshare-gui/src/gui/NewsFeed.h @@ -56,7 +56,7 @@ class RsFeedItem; class FeedNotify; class FeedItem; -class NewsFeed : public RsAutoUpdatePage, public FeedHolder +class NewsFeed : public MainPage,public FeedHolder { Q_OBJECT @@ -81,8 +81,6 @@ public: static void testFeeds(uint notifyFlags); static void testFeed(FeedNotify *feedNotify); - virtual void updateDisplay(); - void handleEvent(std::shared_ptr event); // get events from libretroshare signals: @@ -91,9 +89,6 @@ signals: protected: void processSettings(bool load); - /* TokenResponse */ - virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); - private slots: void feedoptions(); void sortChanged(int index); @@ -119,10 +114,6 @@ private: void addFeedItemBlogMsg(const RsFeedItem &fi); #endif -// void addFeedItemChatNew(const RsFeedItem &fi, bool addWithoutCheck); -// void addFeedItemMessage(const RsFeedItem &fi); -// void addFeedItemFilesNew(const RsFeedItem &fi); - private: /* UI - from Designer */ Ui::NewsFeed *ui; diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 7ea64e7b5..4ad6315b9 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -337,24 +337,49 @@ void ConnectFriendWizard::setCertificate(const QString &certificate, bool friend void ConnectFriendWizard::setGpgId(const RsPgpId &gpgId, const RsPeerId &sslId, bool friendRequest) { - if (!rsPeers->getGPGDetails(gpgId, peerDetails)) { - setField("errorMessage", tr("Cannot get peer details of PGP key %1").arg(QString::fromStdString(gpgId.toStdString()))); + if(sslId == rsPeers->getOwnId()) + { + setField("errorMessage", tr("This is your own certificate! You would not want to make friend with yourself. Wouldn't you?") ) ; setStartId(Page_ErrorMessage); - return; + error = false; } - /* Set ssl id when available */ - peerDetails.id = sslId; + if (!rsPeers->getGPGDetails(gpgId, peerDetails)) + { + mIsShortInvite = true; - //setStartId(friendRequest ? Page_FriendRequest : Page_Conclusion); - setStartId(Page_Conclusion); - if (friendRequest){ - ui->cp_Label->show(); - ui->requestinfolabel->show(); - setTitleText(ui->ConclusionPage,tr("Friend request")); - ui->ConclusionPage->setSubTitle(tr("Details about the request")); - setButtonText(QWizard::FinishButton , tr("Accept")); - } + peerDetails.id = sslId; + peerDetails.gpg_id = gpgId; + peerDetails.skip_pgp_signature_validation = true; + + mCertificate.clear(); + + setStartId(Page_Conclusion); + + if (friendRequest){ + ui->cp_Label->show(); + ui->requestinfolabel->show(); + setTitleText(ui->ConclusionPage, tr("Friend request")); + ui->ConclusionPage->setSubTitle(tr("Details about the request")); + setButtonText(QWizard::FinishButton , tr("Accept")); + } + } + else + { + /* Set ssl id when available */ + peerDetails.id = sslId; + mIsShortInvite = false; + + //setStartId(friendRequest ? Page_FriendRequest : Page_Conclusion); + setStartId(Page_Conclusion); + if (friendRequest){ + ui->cp_Label->show(); + ui->requestinfolabel->show(); + setTitleText(ui->ConclusionPage,tr("Friend request")); + ui->ConclusionPage->setSubTitle(tr("Details about the request")); + setButtonText(QWizard::FinishButton , tr("Accept")); + } + } } ConnectFriendWizard::~ConnectFriendWizard() @@ -507,7 +532,7 @@ void ConnectFriendWizard::initializePage(int id) ui->cp_Label->setText(tr("You have a friend request from") + " " + QString::fromUtf8(peerDetails.name.c_str())); ui->nameEdit->setText(QString::fromUtf8(peerDetails.name.c_str())); ui->trustEdit->setText(trustString); - ui->emailEdit->setText(QString::fromUtf8(peerDetails.email.c_str())); + ui->profileIdEdit->setText(QString::fromStdString(peerDetails.gpg_id.toStdString())); QString loc = QString::fromUtf8(peerDetails.location.c_str()); if (!loc.isEmpty()) { @@ -540,12 +565,19 @@ void ConnectFriendWizard::initializePage(int id) ui->ipLabel->setPixmap(QPixmap(":/images/anonymous_128_blue.png").scaledToHeight(S*2,Qt::SmoothTransformation)); ui->ipLabel->setToolTip("This is a Hidden node - you need tor/i2p proxy to connect"); } - - if(peerDetails.email.empty()) + if(mIsShortInvite) { - ui->emailLabel->hide(); // is it ever used? - ui->emailEdit->hide(); + ui->nameEdit->setText(tr("[Unknown]")); + ui->addKeyToKeyring_CB->setChecked(false); + ui->addKeyToKeyring_CB->setEnabled(false); + ui->signersEdit->hide(); + ui->signersLabel->hide(); + ui->signGPGCheckBox->setChecked(false); + ui->signGPGCheckBox->setEnabled(false); + ui->acceptNoSignGPGCheckBox->setChecked(true); + ui->acceptNoSignGPGCheckBox->setEnabled(false); } + ui->ipEdit->setTextInteractionFlags(Qt::TextSelectableByMouse); } diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui index a950d3ceb..9cbd53ca0 100644 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui @@ -6,8 +6,8 @@ 0 0 - 600 - 437 + 1139 + 1171 @@ -480,14 +480,14 @@ - + - Email: + Profile ID: - + Email @@ -794,8 +794,8 @@ - + diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index b14853ae2..8609069f0 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -174,40 +174,47 @@ void SecurityItem::updateItem() std::cerr << std::endl; #endif - if(!RsAutoUpdatePage::eventsLocked()) { + if(!RsAutoUpdatePage::eventsLocked()) + { RsPeerDetails details; - /* first try sslid */ - if (!rsPeers->getPeerDetails(mSslId, details)) + /* first try sslid */; + if (!rsPeers->getPeerDetails(mSslId, details) && !rsPeers->getGPGDetails(mGpgId, details)) { - /* then gpgid */ - if(!rsPeers->getGPGDetails(mGpgId, details)) - { - /* it is very likely that we will end up here for some of the + /* it is very likely that we will end up here for some of the * Unknown peer cases.... so allow them here */ - /* set peer name */ - peerNameLabel->setText(QString("%1 (%2)").arg(tr("Unknown Peer"), QString::fromUtf8(mSslCn.c_str()))); + /* set peer name */ + peerNameLabel->setText(tr("A unknown peer")); - nameLabel->setText(QString::fromUtf8(mSslCn.c_str()) + " (" + QString::fromStdString(mGpgId.toStdString()) + ")"); - idLabel->setText(QString::fromStdString(mSslId.toStdString())); + nameLabel->setText(tr("Unknown") + " (" + tr("Profile ID: ") + QString::fromStdString(mGpgId.toStdString()) + ")"); + idLabel->setText(QString::fromStdString(mSslId.toStdString())); - statusLabel->setText(tr("Unknown Peer")); - trustLabel->setText(tr("Unknown Peer")); - locLabel->setText(tr("Unknown Peer")); - ipLabel->setText(QString::fromStdString(mIP)) ; //tr("Unknown Peer")); - connLabel->setText(tr("Unknown Peer")); + statusLabel->hide(); + typeLabel->hide(); - chatButton->hide(); - //quickmsgButton->hide(); - requestLabel->hide(); + trustLabel->hide(); + trustLeftLabel->hide(); - removeFriendButton->setEnabled(false); - removeFriendButton->hide(); - peerDetailsButton->setEnabled(false); + locLabel->hide(); + locLeftLabel->hide(); - return; - } + ipLabel->setText(QString::fromStdString(mIP)) ; + connLabel->hide(); + connLeftLabel->hide(); + + chatButton->hide(); + //quickmsgButton->hide(); + requestLabel->hide(); + + removeFriendButton->setEnabled(false); + removeFriendButton->hide(); + peerDetailsButton->setEnabled(false); + + friendRequesttoolButton->show(); + requestLabel->show(); + + return; } /* set peer name */ @@ -344,6 +351,7 @@ void SecurityItem::friendRequest() #endif ConnectFriendWizard *connectFriendWizard = new ConnectFriendWizard; + connectFriendWizard->setAttribute(Qt::WA_DeleteOnClose, true); connectFriendWizard->setGpgId(mGpgId, mSslId, true); connectFriendWizard->show(); diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.ui b/retroshare-gui/src/gui/feeds/SecurityItem.ui index 8e4d10967..54bb46645 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.ui +++ b/retroshare-gui/src/gui/feeds/SecurityItem.ui @@ -6,8 +6,8 @@ 0 0 - 763 - 246 + 1196 + 491 @@ -354,7 +354,7 @@ - + 75 @@ -367,7 +367,7 @@ - + 75 @@ -380,7 +380,7 @@ - + 0 @@ -399,7 +399,7 @@ - + 75 @@ -412,7 +412,7 @@ - + 75 @@ -425,7 +425,7 @@ - + 75 @@ -578,8 +578,8 @@ - +