mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
finished add a Friend with RetroShare ID in ConnectFriendWizard
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3240 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6008ef5e22
commit
840f077826
@ -1062,14 +1062,22 @@ bool RsidPage::isComplete() const {
|
|||||||
|
|
||||||
int RsidPage::nextId() const {
|
int RsidPage::nextId() const {
|
||||||
|
|
||||||
std::string rsidstr;
|
|
||||||
rsidstr = friendRsidEdit->text().toStdString();
|
|
||||||
QString rsidstring = friendRsidEdit->text();
|
QString rsidstring = friendRsidEdit->text();
|
||||||
|
|
||||||
if (rsidstr.empty() == false) {
|
if (rsidstring.isEmpty() == false) {
|
||||||
|
// search for peer id in string
|
||||||
|
std::string rsidstr;
|
||||||
|
|
||||||
|
int nIndex = rsidstring.indexOf("@");
|
||||||
|
if (nIndex >= 0) {
|
||||||
|
// found "@", extract peer id from string
|
||||||
|
rsidstr = rsidstring.mid(nIndex + 1).toStdString();
|
||||||
|
} else {
|
||||||
|
// maybe its only the peer id
|
||||||
|
rsidstr = rsidstring.toStdString();
|
||||||
|
}
|
||||||
RsPeerDetails pd;
|
RsPeerDetails pd;
|
||||||
if ( rsPeers->getPeerDetails(rsidstr, pd) ) {
|
if ( rsPeers->getPeerDetails(rsidstr, pd) ) {
|
||||||
|
|
||||||
wizard()->setField(SSL_ID_FIELD_CONNECT_FRIEND_WIZARD, QString::fromStdString(pd.id));
|
wizard()->setField(SSL_ID_FIELD_CONNECT_FRIEND_WIZARD, QString::fromStdString(pd.id));
|
||||||
wizard()->setField(GPG_ID_FIELD_CONNECT_FRIEND_WIZARD, QString::fromStdString(pd.gpg_id));
|
wizard()->setField(GPG_ID_FIELD_CONNECT_FRIEND_WIZARD, QString::fromStdString(pd.gpg_id));
|
||||||
wizard()->setField(LOCATION_FIELD_CONNECT_FRIEND_WIZARD, QString::fromStdString(pd.location));
|
wizard()->setField(LOCATION_FIELD_CONNECT_FRIEND_WIZARD, QString::fromStdString(pd.location));
|
||||||
@ -1087,4 +1095,6 @@ int RsidPage::nextId() const {
|
|||||||
return ConnectFriendWizard::Page_ErrorMessage;
|
return ConnectFriendWizard::Page_ErrorMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ConnectFriendWizard::Page_Rsid;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user