summary refs log tree commit diff
path: root/src/Community.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-14 12:08:16 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-14 12:08:16 +0300
commit73dbd3c8dd78b41c8d93392eac74231e5b4a20d5 (patch)
tree8f48775d63a917faacfff03a55b1767bfb75477a /src/Community.cc
parentProperly display the bottom border on the TopRoomBar (diff)
downloadnheko-73dbd3c8dd78b41c8d93392eac74231e5b4a20d5.tar.xz
Re-enable groups
Diffstat (limited to 'src/Community.cc')
-rw-r--r--src/Community.cc33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/Community.cc b/src/Community.cc
deleted file mode 100644

index d563c151..00000000 --- a/src/Community.cc +++ /dev/null
@@ -1,33 +0,0 @@ -#include "include/Community.h" - -#include <QJsonArray> -#include <QJsonValue> - -void -Community::parseProfile(const QJsonObject &profile) -{ - if (profile["name"].type() == QJsonValue::Type::String) - name_ = profile["name"].toString(); - else - name_ = "Unnamed Community"; // TODO: what is correct here? - - if (profile["avatar_url"].type() == QJsonValue::Type::String) - avatar_ = QUrl(profile["avatar_url"].toString()); - - if (profile["short_description"].type() == QJsonValue::Type::String) - short_description_ = profile["short_description"].toString(); - - if (profile["long_description"].type() == QJsonValue::Type::String) - long_description_ = profile["long_description"].toString(); -} - -void -Community::parseRooms(const QJsonObject &rooms) -{ - rooms_.clear(); - - for (auto const &room : rooms["chunk"].toArray()) { - if (room.toObject().contains("room_id")) - rooms_.emplace_back(room.toObject()["room_id"].toString()); - } -}