#pragma once #include #include #include #include #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 addrs; QString password; QString error; }; QString encodeInviteLink(uint64_t channelId, const QByteArray& pubkey, const QList& addrs, const QString& password = QString()); InviteData decodeInviteLink(const QString& link);