added optional display of short invites in places with certificates

This commit is contained in:
csoler 2019-06-06 21:41:38 +02:00
parent 8fddb559b9
commit 3a799bae37
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
8 changed files with 106 additions and 47 deletions

View file

@ -1129,6 +1129,7 @@ enum class RsShortInviteFieldType : uint8_t
SSL_ID = 0x00,
PEER_NAME = 0x01,
LOCATOR = 0x02,
PGP_FINGERPRINT = 0x03,
/* The following will be deprecated, and ported to LOCATOR when generic
* trasport layer will be implemented */
@ -1156,6 +1157,10 @@ bool p3Peers::getShortInvite(
RS_SERIAL_PROCESS(tType);
RS_SERIAL_PROCESS(sslId);
tType = RsShortInviteFieldType::PGP_FINGERPRINT;
RS_SERIAL_PROCESS(tType);
RS_SERIAL_PROCESS(tDetails.fpr);
tType = RsShortInviteFieldType::PEER_NAME;
RS_SERIAL_PROCESS(tType);
RS_SERIAL_PROCESS(tDetails.name);
@ -1220,8 +1225,7 @@ bool p3Peers::getShortInvite(
return ctx.mOk;
}
bool p3Peers::parseShortInvite(
const std::string& inviteStrUrl, RsPeerDetails& details )
bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& details )
{
if(inviteStrUrl.empty())
{
@ -1261,6 +1265,11 @@ bool p3Peers::parseShortInvite(
case RsShortInviteFieldType::PEER_NAME:
RS_SERIAL_PROCESS(details.name);
break;
case RsShortInviteFieldType::PGP_FINGERPRINT:
RS_SERIAL_PROCESS(details.fpr);
break;
case RsShortInviteFieldType::LOCATOR:
{
std::string locatorStr;