aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rw-r--r--events/tagevent.cpp28
-rw-r--r--events/tagevent.h8
2 files changed, 21 insertions, 15 deletions
diff --git a/events/tagevent.cpp b/events/tagevent.cpp
index 9f381c76..c6297003 100644
--- a/events/tagevent.cpp
+++ b/events/tagevent.cpp
@@ -1,3 +1,21 @@
+/******************************************************************************
+ * Copyright (C) 2018 Kitsune Ral <kitsune-ral@users.sf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include "tagevent.h"
using namespace QMatrixClient;
@@ -26,16 +44,6 @@ QHash<QString, TagRecord> TagEvent::tags() const
return result;
}
-bool TagEvent::isFavourite() const
-{
- return tagsObject().contains("m.favourite");
-}
-
-bool TagEvent::isLowPriority() const
-{
- return tagsObject().contains("m.lowpriority");
-}
-
QJsonObject TagEvent::tagsObject() const
{
return contentJson().value("tags").toObject();
diff --git a/events/tagevent.h b/events/tagevent.h
index 23b0b703..44a7e49a 100644
--- a/events/tagevent.h
+++ b/events/tagevent.h
@@ -22,6 +22,9 @@
namespace QMatrixClient
{
+ static constexpr const char* FavouriteTag = "m.favourite";
+ static constexpr const char* LowPriorityTag = "m.lowpriority";
+
struct TagRecord
{
explicit TagRecord(const QJsonObject& json = {});
@@ -40,11 +43,6 @@ namespace QMatrixClient
/** Get the list of tags along with information on each */
QHash<QString, TagRecord> tags() const;
- /** Check whether the list of tags has m.favourite */
- bool isFavourite() const;
- /** Check whether the list of tags has m.lowpriority */
- bool isLowPriority() const;
-
static constexpr const char * TypeId = "m.tag";
protected: