Browse Source

Show invitation lifetime and correlate desktop join results by group

master
evgeny 6 days ago
parent
commit
fb21f9c1af
  1. 4
      tools/chatgui/src/invitedialog.cpp
  2. 6
      tools/chatgui/src/joindialog.cpp

4
tools/chatgui/src/invitedialog.cpp

@ -17,6 +17,7 @@
extern "C" {
#include "../../../src/chat/invite_build.h"
#include "../../../src/chat/chat_join.h"
#include "../../../lib/mem.h"
}
@ -31,6 +32,9 @@ ShareInviteDialog::ShareInviteDialog(const QString& channelId, DbManager* db, QW
auto *layout = new QVBoxLayout(this);
layout->setSpacing(12);
auto* expiry = new QLabel(QStringLiteral("Ссылка действует %1 минут с момента создания.").arg(JOIN_KEY_TTL_SECONDS / 60), this);
expiry->setWordWrap(true);
layout->addWidget(expiry);
auto *nodeLabel = new QLabel(QString::fromUtf8("Узел входа:"), this);
nodeLabel->setStyleSheet("font-size: 12px; color: palette(window-text);");

6
tools/chatgui/src/joindialog.cpp

@ -41,6 +41,10 @@ JoinDialog::JoinDialog(UtunNode* node, DbManager* db, QWidget* parent,
"QLineEdit { border: 1px solid palette(mid); border-radius: 6px;"
" padding: 8px 12px; font-size: 13px; background: palette(base); }");
layout->addWidget(m_linkEdit);
auto* expiry = new QLabel(QStringLiteral("Приглашение действует 10 минут с момента создания.\n"
"Если срок истёк, попросите отправителя создать новую ссылку."), this);
expiry->setWordWrap(true);
layout->addWidget(expiry);
m_statusLabel = new QLabel(this);
m_statusLabel->setWordWrap(true);
@ -199,7 +203,7 @@ void JoinDialog::onConnectClicked() {
}
void JoinDialog::onConnectResult(uint64_t nodeId, uint64_t channelId, int result) {
if (!m_connecting || nodeId != m_pendingNodeId) return;
if (!m_connecting || nodeId != m_pendingNodeId || channelId != m_pendingChannelId) return;
if (result == 0) {
setStatus("Connected!");

Loading…
Cancel
Save