Warning, file /network/tokodon/src/admin/ipinfo.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // SPDX-FileCopyrightText: 2023 Rishi Kumar <rsi.dev17@gmail.com> 0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0003 0004 #pragma once 0005 0006 #include <QDateTime> 0007 0008 class IpInfo 0009 { 0010 Q_GADGET 0011 0012 public: 0013 enum SeverityValues { LimitSignUps, BlockSignUps, BlockAccess }; 0014 0015 Q_ENUM(SeverityValues) 0016 0017 QString id() const; 0018 QString ip() const; 0019 void setIp(const QString &ip); 0020 SeverityValues severity() const; 0021 void setSeverity(const QString &severity); 0022 QString comment() const; 0023 void setComment(const QString &comment); 0024 QDateTime createdAt() const; 0025 QDateTime expiresAt() const; 0026 void setExpiredAt(int expiresAt); 0027 0028 static IpInfo fromSourceData(const QJsonObject &doc); 0029 0030 private: 0031 static SeverityValues calculateSeverity(const QString &severity); 0032 QString m_id; 0033 QString m_ip; 0034 SeverityValues m_severity = LimitSignUps; 0035 QString m_comment; 0036 QDateTime m_createdAt; 0037 QDateTime m_expiresAt; 0038 };