Added and modified patch from Anonym

- when an unknow user attempt to connect, show the name in the security item

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6079 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-01-19 19:24:08 +00:00
parent e7536960c3
commit 72e5d10bcd
3 changed files with 11 additions and 10 deletions

View File

@ -538,7 +538,7 @@ void NewsFeed::addFeedItemPeerNew(RsFeedItem &fi)
void NewsFeed::addFeedItemSecurityConnectAttempt(RsFeedItem &fi)
{
/* make new widget */
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId4, SEC_TYPE_CONNECT_ATTEMPT, false);
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, SEC_TYPE_CONNECT_ATTEMPT, false);
/* store */
@ -554,7 +554,7 @@ void NewsFeed::addFeedItemSecurityConnectAttempt(RsFeedItem &fi)
void NewsFeed::addFeedItemSecurityAuthDenied(RsFeedItem &fi)
{
/* make new widget */
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId4, SEC_TYPE_AUTH_DENIED, false);
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, SEC_TYPE_AUTH_DENIED, false);
/* store */
@ -570,7 +570,7 @@ void NewsFeed::addFeedItemSecurityAuthDenied(RsFeedItem &fi)
void NewsFeed::addFeedItemSecurityUnknownIn(RsFeedItem &fi)
{
/* make new widget */
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId4, SEC_TYPE_UNKNOWN_IN, false);
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, SEC_TYPE_UNKNOWN_IN, false);
/* store */
@ -586,7 +586,7 @@ void NewsFeed::addFeedItemSecurityUnknownIn(RsFeedItem &fi)
void NewsFeed::addFeedItemSecurityUnknownOut(RsFeedItem &fi)
{
/* make new widget */
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId4, SEC_TYPE_UNKNOWN_OUT, false);
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, SEC_TYPE_UNKNOWN_OUT, false);
/* store */

View File

@ -43,9 +43,9 @@
****/
/** Constructor */
SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::string &gpgId, const std::string &sslId, const std::string& ip_address,uint32_t type, bool isHome)
SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::string &gpgId, const std::string &sslId, const std::string &sslCn, const std::string& ip_address,uint32_t type, bool isHome)
:QWidget(NULL), mParent(parent), mFeedId(feedId),
mSslId(sslId), mGpgId(gpgId), mType(type), mIsHome(isHome), mIP(ip_address)
mGpgId(gpgId), mSslId(sslId), mSslCn(sslCn), mType(type), mIsHome(isHome), mIP(ip_address)
{
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
@ -180,9 +180,9 @@ void SecurityItem::updateItem()
*/
/* set peer name */
peerNameLabel->setText(tr("Unknown Peer"));
peerNameLabel->setText(QString("%1 (%2)").arg(tr("Unknown Peer"), QString::fromUtf8(mSslCn.c_str())));
nameLabel->setText(QString::fromStdString(mGpgId));
nameLabel->setText(QString::fromUtf8(mSslCn.c_str()) + " (" + QString::fromStdString(mGpgId) + ")");
idLabel->setText(QString::fromStdString(mSslId));
statusLabel->setText(tr("Unknown Peer"));

View File

@ -38,7 +38,7 @@ class SecurityItem : public QWidget, private Ui::SecurityItem
public:
/** Default Constructor */
SecurityItem(FeedHolder *parent, uint32_t feedId, const std::string &gpgId, const std::string &sslId, const std::string& ip_addr,uint32_t type, bool isHome);
SecurityItem(FeedHolder *parent, uint32_t feedId, const std::string &gpgId, const std::string &sslId, const std::string &sslCn, const std::string& ip_addr,uint32_t type, bool isHome);
void updateItemStatic();
@ -66,8 +66,9 @@ private:
FeedHolder *mParent;
uint32_t mFeedId;
std::string mSslId;
std::string mGpgId;
std::string mSslId;
std::string mSslCn;
std::string mIP;
uint32_t mType;
bool mIsHome;