Clean up code

This commit is contained in:
Loren Burkholder 2021-07-17 16:49:34 -04:00
parent 3c5b395171
commit baa9dfe110
3 changed files with 3 additions and 39 deletions

View file

@ -116,34 +116,6 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
connect(this, &ChatPage::loggedOut, this, &ChatPage::logout);
// TODO: once this signal is moved, reenable this
// connect(view_manager_, &TimelineViewManager::inviteUsers, this, [this](QStringList
// users) {
// const auto room_id = currentRoom().toStdString();
// for (int ii = 0; ii < users.size(); ++ii) {
// QTimer::singleShot(ii * 500, this, [this, room_id, ii, users]() {
// const auto user = users.at(ii);
// http::client()->invite_user(
// room_id,
// user.toStdString(),
// [this, user](const mtx::responses::RoomInvite &,
// mtx::http::RequestErr err) {
// if (err) {
// emit showNotification(
// tr("Failed to invite user:
// %1").arg(user));
// return;
// }
// emit showNotification(tr("Invited user:
// %1").arg(user));
// });
// });
// }
// });
connect(
view_manager_,
&TimelineViewManager::inviteUsers,

View file

@ -1074,7 +1074,7 @@ TimelineModel::openRoomSettings(QString room_id)
{
RoomSettings *settings = new RoomSettings(room_id == QString() ? roomId() : room_id, this);
connect(this, &TimelineModel::roomAvatarUrlChanged, settings, &RoomSettings::avatarChanged);
openRoomSettingsDialog(settings);
emit openRoomSettingsDialog(settings);
}
void
@ -1082,9 +1082,9 @@ TimelineModel::openInviteUsers(QString roomId)
{
InviteesModel *model = new InviteesModel{this};
connect(model, &InviteesModel::accept, this, [this, model, roomId]() {
manager_->inviteUsers(roomId == QString() ? room_id_ : roomId, model->mxids());
emit manager_->inviteUsers(roomId == QString() ? room_id_ : roomId, model->mxids());
});
openInviteUsersDialog(model);
emit openInviteUsersDialog(model);
}
void

View file

@ -430,14 +430,6 @@ TimelineViewManager::openImageOverlayInternal(QString eventId, QImage img)
});
}
// void
// TimelineViewManager::openInviteUsersDialog()
//{
// TODO: move this somewhere where it will actually work (probably Rooms)
// MainWindow::instance()->openInviteUsersDialog(
// [this](const QStringList &invitees) { emit inviteUsers(invitees); });
//}
void
TimelineViewManager::openLeaveRoomDialog(QString roomid) const
{