From 967b18197aa262751f357c25d812e63b9bcce8b2 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 26 Feb 2018 17:27:44 +0900 Subject: TagEvent: drop unneeded methods; add a license block to the .cpp file Those methods are more appropriate for Room. --- events/tagevent.cpp | 28 ++++++++++++++++++---------- events/tagevent.h | 8 +++----- 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 + * + * 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 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 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: -- cgit v1.2.3