mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Merge pull request #476 from Jedi18/master
Fix room leaving related bugs and few minor bugs
This commit is contained in:
commit
cae5531c4b
4 changed files with 17 additions and 2 deletions
|
@ -65,6 +65,7 @@ CommunitiesList::setCommunities(const mtx::responses::JoinedGroups &response)
|
||||||
addCommunity(group);
|
addCommunity(group);
|
||||||
|
|
||||||
communities_["world"]->setPressedState(true);
|
communities_["world"]->setPressedState(true);
|
||||||
|
selectedCommunity_ = "world";
|
||||||
emit communityChanged("world");
|
emit communityChanged("world");
|
||||||
sortEntries();
|
sortEntries();
|
||||||
}
|
}
|
||||||
|
@ -74,6 +75,7 @@ CommunitiesList::syncTags(const std::map<QString, RoomInfo> &info)
|
||||||
{
|
{
|
||||||
for (const auto &room : info)
|
for (const auto &room : info)
|
||||||
setTagsForRoom(room.first, room.second.tags);
|
setTagsForRoom(room.first, room.second.tags);
|
||||||
|
emit communityChanged(selectedCommunity_);
|
||||||
sortEntries();
|
sortEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,6 +233,7 @@ CommunitiesList::highlightSelectedCommunity(const QString &community_id)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectedCommunity_ = community_id;
|
||||||
emit communityChanged(community_id);
|
emit communityChanged(community_id);
|
||||||
|
|
||||||
for (const auto &community : communities_) {
|
for (const auto &community : communities_) {
|
||||||
|
|
|
@ -53,6 +53,7 @@ private:
|
||||||
return communities_.find(id) != communities_.end();
|
return communities_.find(id) != communities_.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString selectedCommunity_;
|
||||||
QVBoxLayout *topLayout_;
|
QVBoxLayout *topLayout_;
|
||||||
QVBoxLayout *contentsLayout_;
|
QVBoxLayout *contentsLayout_;
|
||||||
QScrollArea *scrollArea_;
|
QScrollArea *scrollArea_;
|
||||||
|
|
|
@ -106,6 +106,10 @@ void
|
||||||
RoomList::removeRoom(const QString &room_id, bool reset)
|
RoomList::removeRoom(const QString &room_id, bool reset)
|
||||||
{
|
{
|
||||||
auto roomIt = rooms_.find(room_id);
|
auto roomIt = rooms_.find(room_id);
|
||||||
|
if (roomIt == rooms_.end()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto roomSortIt = rooms_sort_cache_.begin(); roomSortIt != rooms_sort_cache_.end();
|
for (auto roomSortIt = rooms_sort_cache_.begin(); roomSortIt != rooms_sort_cache_.end();
|
||||||
++roomSortIt) {
|
++roomSortIt) {
|
||||||
if (roomIt->second == *roomSortIt) {
|
if (roomIt->second == *roomSortIt) {
|
||||||
|
@ -523,8 +527,11 @@ RoomList::firstRoom() const
|
||||||
auto item = qobject_cast<RoomInfoListItem *>(contentsLayout_->itemAt(i)->widget());
|
auto item = qobject_cast<RoomInfoListItem *>(contentsLayout_->itemAt(i)->widget());
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
|
auto topRoom = rooms_.find(item->roomId());
|
||||||
|
if (topRoom != rooms_.end()) {
|
||||||
return std::pair<QString, QSharedPointer<RoomInfoListItem>>(
|
return std::pair<QString, QSharedPointer<RoomInfoListItem>>(
|
||||||
item->roomId(), rooms_.at(item->roomId()));
|
item->roomId(), topRoom->second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,10 @@ InviteUsers::InviteUsers(QWidget *parent)
|
||||||
|
|
||||||
connect(inviteeInput_, &TextField::returnPressed, this, &InviteUsers::addUser);
|
connect(inviteeInput_, &TextField::returnPressed, this, &InviteUsers::addUser);
|
||||||
connect(confirmBtn_, &QPushButton::clicked, [this]() {
|
connect(confirmBtn_, &QPushButton::clicked, [this]() {
|
||||||
|
if (!inviteeInput_->text().trimmed().isEmpty()) {
|
||||||
|
addUser();
|
||||||
|
}
|
||||||
|
|
||||||
emit sendInvites(invitedUsers());
|
emit sendInvites(invitedUsers());
|
||||||
|
|
||||||
inviteeInput_->clear();
|
inviteeInput_->clear();
|
||||||
|
|
Loading…
Reference in a new issue