aboutsummaryrefslogtreecommitdiff
path: root/lib/events/eventcontent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/eventcontent.cpp')
-rw-r--r--lib/events/eventcontent.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/events/eventcontent.cpp b/lib/events/eventcontent.cpp
index 9a5e872c..77f756cd 100644
--- a/lib/events/eventcontent.cpp
+++ b/lib/events/eventcontent.cpp
@@ -50,6 +50,12 @@ FileInfo::FileInfo(const QUrl& u, const QJsonObject& infoJson,
mimeType = QMimeDatabase().mimeTypeForData(QByteArray());
}
+bool FileInfo::isValid() const
+{
+ return url.scheme() == "mxc"
+ && (url.authority() + url.path()).count('/') == 1;
+}
+
void FileInfo::fillInfoJson(QJsonObject* infoJson) const
{
Q_ASSERT(infoJson);