mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 03:58:49 +03:00
Properly restore room mentions state after edit
This commit is contained in:
parent
80ab0394cd
commit
3533f104bd
1 changed files with 6 additions and 0 deletions
|
@ -197,12 +197,14 @@ public slots:
|
|||
textBeforeEdit = text();
|
||||
mentionsBefore = mentions_;
|
||||
mentionTextsBefore = mentionTexts_;
|
||||
containsAtRoomBefore = containsAtRoom_;
|
||||
emit mentionsChanged();
|
||||
}
|
||||
void restoreAfterEdit()
|
||||
{
|
||||
mentions_ = mentionsBefore;
|
||||
mentionTexts_ = mentionTextsBefore;
|
||||
containsAtRoom_ = containsAtRoomBefore;
|
||||
mentionsBefore.clear();
|
||||
mentionTextsBefore.clear();
|
||||
setText(textBeforeEdit);
|
||||
|
@ -216,6 +218,9 @@ public slots:
|
|||
|
||||
mentions_ = newMentions;
|
||||
mentionTexts_ = newMentionTexts;
|
||||
|
||||
this->containsAtRoom_ = newMentions.contains(u"@room");
|
||||
|
||||
emit mentionsChanged();
|
||||
}
|
||||
|
||||
|
@ -331,6 +336,7 @@ private:
|
|||
// store stuff during edits
|
||||
QStringList mentionsBefore, mentionTextsBefore;
|
||||
QString textBeforeEdit;
|
||||
bool containsAtRoomBefore = false;
|
||||
|
||||
using UploadHandle = std::unique_ptr<MediaUpload, DeleteLaterDeleter>;
|
||||
std::vector<UploadHandle> unconfirmedUploads;
|
||||
|
|
Loading…
Reference in a new issue