mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-27 21:48:48 +03:00
parent
ed867f53c4
commit
388e0c28bd
5 changed files with 11 additions and 3 deletions
|
@ -257,9 +257,6 @@ Page {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("tapped " + roomId);
|
console.log("tapped " + roomId);
|
||||||
|
|
||||||
if (isSpace && Communities.currentTagId != "space:"+roomId)
|
|
||||||
Communities.currentTagId = "space:"+roomId;
|
|
||||||
|
|
||||||
if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId)
|
if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId)
|
||||||
Rooms.setCurrentRoom(roomId);
|
Rooms.setCurrentRoom(roomId);
|
||||||
else
|
else
|
||||||
|
|
|
@ -579,6 +579,9 @@ CommunitiesModel::sync(const mtx::responses::Sync &sync_)
|
||||||
void
|
void
|
||||||
CommunitiesModel::setCurrentTagId(const QString &tagId)
|
CommunitiesModel::setCurrentTagId(const QString &tagId)
|
||||||
{
|
{
|
||||||
|
if (currentTagId_ == tagId)
|
||||||
|
return;
|
||||||
|
|
||||||
if (tagId.startsWith(QLatin1String("tag:"))) {
|
if (tagId.startsWith(QLatin1String("tag:"))) {
|
||||||
auto tag = tagId.mid(4);
|
auto tag = tagId.mid(4);
|
||||||
for (const auto &t : qAsConst(tags_)) {
|
for (const auto &t : qAsConst(tags_)) {
|
||||||
|
|
|
@ -768,6 +768,10 @@ RoomlistModel::setCurrentRoom(const QString &roomid)
|
||||||
currentRoomPreview_.reset();
|
currentRoomPreview_.reset();
|
||||||
emit currentRoomChanged(currentRoom_->roomId());
|
emit currentRoomChanged(currentRoom_->roomId());
|
||||||
nhlog::ui()->debug("Switched to: {}", roomid.toStdString());
|
nhlog::ui()->debug("Switched to: {}", roomid.toStdString());
|
||||||
|
|
||||||
|
if (currentRoom_->isSpace()) {
|
||||||
|
emit spaceSelected(roomid);
|
||||||
|
}
|
||||||
} else if (invites.contains(roomid) || previewedRooms.contains(roomid)) {
|
} else if (invites.contains(roomid) || previewedRooms.contains(roomid)) {
|
||||||
currentRoom_ = nullptr;
|
currentRoom_ = nullptr;
|
||||||
std::optional<RoomInfo> i;
|
std::optional<RoomInfo> i;
|
||||||
|
|
|
@ -129,6 +129,7 @@ signals:
|
||||||
void totalUnreadMessageCountUpdated(int unreadMessages);
|
void totalUnreadMessageCountUpdated(int unreadMessages);
|
||||||
void currentRoomChanged(QString currentRoomId);
|
void currentRoomChanged(QString currentRoomId);
|
||||||
void fetchedPreview(QString roomid, RoomInfo info);
|
void fetchedPreview(QString roomid, RoomInfo info);
|
||||||
|
void spaceSelected(QString roomId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addRoom(const QString &room_id, bool suppressInsertNotification = false);
|
void addRoom(const QString &room_id, bool suppressInsertNotification = false);
|
||||||
|
|
|
@ -152,6 +152,9 @@ TimelineViewManager::TimelineViewManager(CallManager *, ChatPage *parent)
|
||||||
isConnected_ = true;
|
isConnected_ = true;
|
||||||
emit isConnectedChanged(true);
|
emit isConnectedChanged(true);
|
||||||
});
|
});
|
||||||
|
connect(rooms_, &RoomlistModel::spaceSelected, communities_, [this](QString roomId) {
|
||||||
|
communities_->setCurrentTagId("space:" + roomId);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue