You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
888 B

#pragma once
#include <QString>
#include <QByteArray>
#include <QList>
#include <cstdint>
#include "../db/db_manager.h"
#define INVITE_LINK_VERSION 0x01
#define INVITE_PROTO_UDP 0x01
#define INVITE_PROTO_TCP 0x02
#define INVITE_PROTO_BOTH 0x03
struct InviteAddr {
int family; // 4=IPv4, 6=IPv6
QByteArray address;
quint16 port;
uint8_t socketId; // socket_id из ETCP
uint8_t proto; // INVITE_PROTO_UDP/TCP/BOTH
};
struct InviteData {
uint64_t channelId = 0;
QByteArray pubkey;
QList<InviteAddr> addrs;
QString password;
QString error;
};
QString encodeInviteLink(uint64_t channelId, const QByteArray& pubkey,
const QList<NodeAddr>& addrs,
const QString& password = QString());
InviteData decodeInviteLink(const QString& link);