mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
Fix crash when you have no rooms and open the profile as well as not rendering rooms without groups
This commit is contained in:
parent
7431b51d27
commit
986b561c34
4 changed files with 9 additions and 6 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "Utils.h"
|
||||
#include "ui/OverlayModal.h"
|
||||
#include "ui/Theme.h"
|
||||
#include "ui/UserProfile.h"
|
||||
|
||||
#include "notifications/Manager.h"
|
||||
|
||||
|
@ -100,7 +101,8 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
|||
|
||||
user_info_widget_ = new UserInfoWidget(sideBar_);
|
||||
connect(user_info_widget_, &UserInfoWidget::openGlobalUserProfile, this, [this]() {
|
||||
view_manager_->activeTimeline()->openUserProfile(utils::localUser(), true);
|
||||
UserProfile *userProfile = new UserProfile("", utils::localUser(), view_manager_);
|
||||
emit view_manager_->openProfile(userProfile);
|
||||
});
|
||||
|
||||
user_mentions_popup_ = new popups::UserMentions();
|
||||
|
@ -1187,6 +1189,7 @@ ChatPage::getProfileInfo()
|
|||
nhlog::net()->critical("failed to retrieve joined groups: {} {}",
|
||||
static_cast<int>(err->status_code),
|
||||
err->matrix_error.error);
|
||||
emit updateGroupsInfo({});
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -854,12 +854,12 @@ TimelineModel::viewDecryptedRawMessage(QString id) const
|
|||
}
|
||||
|
||||
void
|
||||
TimelineModel::openUserProfile(QString userid, bool global)
|
||||
TimelineModel::openUserProfile(QString userid)
|
||||
{
|
||||
UserProfile *userProfile = new UserProfile(global ? "" : room_id_, userid, manager_, this);
|
||||
UserProfile *userProfile = new UserProfile(room_id_, userid, manager_, this);
|
||||
connect(
|
||||
this, &TimelineModel::roomAvatarUrlChanged, userProfile, &UserProfile::updateAvatarUrl);
|
||||
emit openProfile(userProfile);
|
||||
emit manager_->openProfile(userProfile);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -223,7 +223,7 @@ public:
|
|||
Q_INVOKABLE void viewRawMessage(QString id) const;
|
||||
Q_INVOKABLE void forwardMessage(QString eventId, QString roomId);
|
||||
Q_INVOKABLE void viewDecryptedRawMessage(QString id) const;
|
||||
Q_INVOKABLE void openUserProfile(QString userid, bool global = false);
|
||||
Q_INVOKABLE void openUserProfile(QString userid);
|
||||
Q_INVOKABLE void openRoomSettings();
|
||||
Q_INVOKABLE void editAction(QString id);
|
||||
Q_INVOKABLE void replyAction(QString id);
|
||||
|
@ -322,7 +322,6 @@ signals:
|
|||
void newCallEvent(const mtx::events::collections::TimelineEvents &event);
|
||||
void scrollToIndex(int index);
|
||||
|
||||
void openProfile(UserProfile *profile);
|
||||
void openRoomSettingsDialog(RoomSettings *settings);
|
||||
|
||||
void newMessageToSend(mtx::events::collections::TimelineEvents event);
|
||||
|
|
|
@ -93,6 +93,7 @@ signals:
|
|||
void focusChanged();
|
||||
void focusInput();
|
||||
void openImageOverlayInternalCb(QString eventId, QImage img);
|
||||
void openProfile(UserProfile *profile);
|
||||
|
||||
public slots:
|
||||
void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);
|
||||
|
|
Loading…
Reference in a new issue