aboutsummaryrefslogtreecommitdiff
path: root/room.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'room.cpp')
-rw-r--r--room.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/room.cpp b/room.cpp
index ab7f7a8f..71b7b228 100644
--- a/room.cpp
+++ b/room.cpp
@@ -1467,7 +1467,9 @@ QJsonObject Room::Private::toJson() const
QJsonObject roomStateObj;
roomStateObj.insert("events", stateEvents);
- result.insert("state", roomStateObj);
+ result.insert(
+ joinState == JoinState::Invite ? "invite_state" : "state",
+ roomStateObj);
}
if (!q->readMarkerEventId().isEmpty())
@@ -1499,9 +1501,12 @@ QJsonObject Room::Private::toJson() const
}
QJsonObject unreadNotificationsObj;
- unreadNotificationsObj.insert("highlight_count", highlightCount);
- unreadNotificationsObj.insert("notification_count", notificationCount);
- result.insert("unread_notifications", unreadNotificationsObj);
+ if (highlightCount > 0)
+ unreadNotificationsObj.insert("highlight_count", highlightCount);
+ if (notificationCount > 0)
+ unreadNotificationsObj.insert("notification_count", notificationCount);
+ if (!unreadNotificationsObj.isEmpty())
+ result.insert("unread_notifications", unreadNotificationsObj);
return result;
}