mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Erase items using the key
This commit is contained in:
parent
936e215aed
commit
0e91dae922
6 changed files with 7 additions and 12 deletions
|
@ -20,7 +20,7 @@ public:
|
||||||
void clear() { communities_.clear(); }
|
void clear() { communities_.clear(); }
|
||||||
|
|
||||||
void addCommunity(QSharedPointer<Community> community, const QString &id);
|
void addCommunity(QSharedPointer<Community> community, const QString &id);
|
||||||
void removeCommunity(const QString &id);
|
void removeCommunity(const QString &id) { communities_.erase(id); };
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void communityChanged(const QString &id);
|
void communityChanged(const QString &id);
|
||||||
|
|
|
@ -39,7 +39,7 @@ AvatarProvider::updateAvatar(const QString &uid, const QImage &img)
|
||||||
for (const auto callback : callbacks)
|
for (const auto callback : callbacks)
|
||||||
callback(img);
|
callback(img);
|
||||||
|
|
||||||
toBeResolved_.erase(toBeResolved_.find(uid));
|
toBeResolved_.erase(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto avatarData = avatars_[uid];
|
auto avatarData = avatars_[uid];
|
||||||
|
|
|
@ -761,8 +761,9 @@ ChatPage::addRoom(const QString &room_id)
|
||||||
void
|
void
|
||||||
ChatPage::removeRoom(const QString &room_id)
|
ChatPage::removeRoom(const QString &room_id)
|
||||||
{
|
{
|
||||||
roomStates_.erase(roomStates_.find(room_id));
|
roomStates_.erase(room_id);
|
||||||
roomSettings_.erase(roomSettings_.find(room_id));
|
roomSettings_.erase(room_id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cache_->removeRoom(room_id);
|
cache_->removeRoom(room_id);
|
||||||
cache_->removeInvite(room_id);
|
cache_->removeInvite(room_id);
|
||||||
|
|
|
@ -100,12 +100,6 @@ CommunitiesList::addCommunity(QSharedPointer<Community> community, const QString
|
||||||
&CommunitiesList::highlightSelectedCommunity);
|
&CommunitiesList::highlightSelectedCommunity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
CommunitiesList::removeCommunity(const QString &community_id)
|
|
||||||
{
|
|
||||||
communities_.erase(communities_.find(community_id));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CommunitiesList::updateCommunityAvatar(const QString &community_id, const QPixmap &img)
|
CommunitiesList::updateCommunityAvatar(const QString &community_id, const QPixmap &img)
|
||||||
{
|
{
|
||||||
|
|
|
@ -123,7 +123,7 @@ RoomList::updateAvatar(const QString &room_id, const QString &url)
|
||||||
void
|
void
|
||||||
RoomList::removeRoom(const QString &room_id, bool reset)
|
RoomList::removeRoom(const QString &room_id, bool reset)
|
||||||
{
|
{
|
||||||
rooms_.erase(rooms_.find(room_id));
|
rooms_.erase(room_id);
|
||||||
|
|
||||||
if (rooms_.empty() || !reset)
|
if (rooms_.empty() || !reset)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -157,7 +157,7 @@ RoomState::update(const RoomState &state)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (membershipState == mtx::events::state::Membership::Leave)
|
if (membershipState == mtx::events::state::Membership::Leave)
|
||||||
this->memberships.erase(this->memberships.find(it->first));
|
this->memberships.erase(it->first);
|
||||||
else
|
else
|
||||||
this->memberships.emplace(it->first, it->second);
|
this->memberships.emplace(it->first, it->second);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue