fixed a few bugs in latest identity link code

This commit is contained in:
csoler 2017-04-08 21:43:07 +02:00
parent 6d290389f0
commit 54cd402f1c
2 changed files with 18 additions and 1 deletions

View File

@ -2432,6 +2432,7 @@ void IdDialog::copyRetroshareLink()
RetroShareLink link ;
link.createIdentity(RsGxsId(keyId),QString::fromUtf8(details.mNickname.c_str()),QString::fromStdString(radix)) ;
urls.push_back(link);
RSLinkClipboard::copyLinks(urls) ;

View File

@ -307,6 +307,21 @@ void RetroShareLink::fromUrl(const QUrl& url)
return;
}
if(url.host() == HOST_IDENTITY) {
_type = TYPE_IDENTITY ;
QString name = urlQuery.queryItemValue(IDENTITY_NAME) ;
QString radix= urlQuery.queryItemValue(IDENTITY_GROUP) ;
QString gxsid= urlQuery.queryItemValue(IDENTITY_ID) ;
RsGxsId id(gxsid.toStdString()) ;
if(!id.isNull())
createIdentity(id,name,radix) ;
else
std::cerr << "(EE) identity link is not valid." << std::endl;
return ;
}
if (url.host() == HOST_MESSAGE) {
_type = TYPE_MESSAGE;
std::string id = urlQuery.queryItemValue(MESSAGE_ID).toStdString();
@ -844,7 +859,7 @@ QString RetroShareLink::niceName() const
return PeerDefs::rsid(name().toUtf8().constData(), RsPgpId(hash().toStdString()));
if(type() == TYPE_IDENTITY)
return QObject::tr("Click this link to add this person (name=%1, ID=%2) to your People tab.").arg(_name).arg(_hash) ;
return QObject::tr("Identity link (name=%1, ID=%2)").arg(_name).arg(_hash) ;
if(type() == TYPE_PUBLIC_MSG) {
RsPeerDetails detail;
@ -1055,6 +1070,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
case TYPE_POSTED:
case TYPE_SEARCH:
case TYPE_MESSAGE:
case TYPE_IDENTITY:
case TYPE_CERTIFICATE:
case TYPE_PUBLIC_MSG:
case TYPE_PRIVATE_CHAT: