diff options
author | Jedi18 <targetakhil@gmail.com> | 2021-01-29 00:09:11 +0530 |
---|---|---|
committer | Jedi18 <targetakhil@gmail.com> | 2021-01-29 00:09:11 +0530 |
commit | fa7ad4f2344c72a8754a6d7b4489082fc81bb930 (patch) | |
tree | df382cc07db913f1ab484f00ce0701b09097f648 /src/timeline/TimelineModel.cpp | |
parent | fix linting (diff) | |
download | nheko-fa7ad4f2344c72a8754a6d7b4489082fc81bb930.tar.xz |
Shifted fetching of global username fom timeline model to user profile
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index a25e77fd..73077508 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -22,7 +22,6 @@ #include "TimelineViewManager.h" #include "Utils.h" #include "dialogs/RawMessage.h" -#include <mtx/responses.hpp> Q_DECLARE_METATYPE(QModelIndex) @@ -261,17 +260,6 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj connect(&events, &EventStore::updateFlowEventId, this, [this](std::string event_id) { this->updateFlowEventId(event_id); }); - - const auto userid = utils::localUser().toStdString(); - http::client()->get_profile( - userid, [this](const mtx::responses::Profile &res, mtx::http::RequestErr err) { - if (err) { - nhlog::net()->warn("failed to retrieve own profile info"); - return; - } - - globalUsername = QString::fromStdString(res.display_name); - }); } QHash<int, QByteArray> @@ -814,8 +802,7 @@ void TimelineModel::openUserProfile(QString userid, bool global) { if (global) { - emit openProfile( - new UserProfile("", utils::localUser(), manager_, this, globalUsername)); + emit openProfile(new UserProfile("", utils::localUser(), manager_, this)); } else { emit openProfile(new UserProfile(room_id_, userid, manager_, this)); } |