aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-02-26 17:27:44 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-02-26 17:27:44 +0900
commit967b18197aa262751f357c25d812e63b9bcce8b2 (patch)
treebb0de550a4d780ecebb1353cbd81a369dd4ebb1d
parent4b5d5d20de1a3c00c77e395260f572c2b90f54f4 (diff)
downloadlibquotient-967b18197aa262751f357c25d812e63b9bcce8b2.tar.gz
libquotient-967b18197aa262751f357c25d812e63b9bcce8b2.zip
TagEvent: drop unneeded methods; add a license block to the .cpp file
Those methods are more appropriate for Room.
-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: