Fix mismerges during the great rebase

This commit is contained in:
Max Sandholm 2017-10-30 05:38:52 +02:00
parent 7c93e07637
commit ab3893ff54
3 changed files with 28 additions and 38 deletions

View File

@ -26,9 +26,10 @@
#include "MemberEventContent.h" #include "MemberEventContent.h"
#include "MessageEvent.h" #include "MessageEvent.h"
#include "StateEvent.h" #include "StateEvent.h"
#include "CommunitiesList.h"
#include "Community.h"
class Cache; class Cache;
class CommunitiesList;
class MatrixClient; class MatrixClient;
class OverlayModal; class OverlayModal;
class QuickSwitcher; class QuickSwitcher;

View File

@ -101,39 +101,6 @@ private:
int unreadMsgCount_ = 0; int unreadMsgCount_ = 0;
}; };
inline int
RoomInfoListItem::unreadMessageCount() const
{
return unreadMsgCount_;
}
inline bool
RoomInfoListItem::isPressed() const
{
return isPressed_;
}
inline RoomState
RoomInfoListItem::state() const
{
return state_;
}
inline void
RoomInfoListItem::setAvatar(const QImage &img)
{
roomAvatar_ = QPixmap::fromImage(
img.scaled(IconSize, IconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
update();
}
inline void
RoomInfoListItem::setDescriptionMessage(const DescInfo &info)
{
lastMsgInfo_ = info;
update();
}
inline QString inline QString
RoomInfoListItem::roomId() RoomInfoListItem::roomId()
{ {

View File

@ -476,7 +476,29 @@ MatrixClient::getOwnCommunities() noexcept
QNetworkRequest request(QString(endpoint.toEncoded())); QNetworkRequest request(QString(endpoint.toEncoded()));
QNetworkReply *reply = get(request); QNetworkReply *reply = get(request);
reply->setProperty("endpoint", static_cast<int>(Endpoint::GetOwnCommunities)); connect(reply, &QNetworkReply::finished, this, [this, reply]() {
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (status >= 400) {
qWarning() << reply->errorString();
return;
}
auto data = reply->readAll();
auto json = QJsonDocument::fromJson(data).object();
try {
QList<QString> response;
for (auto it = json["groups"].toArray().constBegin(); it != json["groups"].toArray().constEnd(); it++) {
response.append(it->toString());
}
emit getOwnCommunitiesResponse(response);
} catch (DeserializationException &e) {
qWarning() << "Own communities:" << e.what();
}
});
} }
void void
@ -526,7 +548,7 @@ MatrixClient::fetchRoomAvatar(const QString &roomid, const QUrl &avatar_url)
} }
void void
MatrixClient::fetchCommunityAvatar(const QString &communityid, const QUrl &avatar_url) MatrixClient::fetchCommunityAvatar(const QString &communityId, const QUrl &avatar_url)
{ {
QList<QString> url_parts = avatar_url.toString().split("mxc://"); QList<QString> url_parts = avatar_url.toString().split("mxc://");
@ -585,7 +607,7 @@ MatrixClient::fetchCommunityProfile(const QString &communityId)
QNetworkReply *reply = get(request); QNetworkReply *reply = get(request);
connect(reply, &QNetworkRequest::finished, this, [this, reply, communityId]() { connect(reply, &QNetworkReply::finished, this, [this, reply, communityId]() {
reply->deleteLater(); reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -615,7 +637,7 @@ MatrixClient::fetchCommunityRooms(const QString &communityId)
QNetworkRequest request(QString(endpoint.toEncoded())); QNetworkRequest request(QString(endpoint.toEncoded()));
QNetworkReply *reply = get(request); QNetworkReply *reply = get(request);
connect(reply, &QNetworkRequest::finished, this, [this, reply, communityId]() { connect(reply, &QNetworkReply::finished, this, [this, reply, communityId]() {
reply->deleteLater(); reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();