mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Replace SelectedItemSet with MessageIdsList.
Use vector<FullMsgId> everywhere instead QMap<..,HistoryItem*>. The old way the app crashed in case some messages were deleted. If the items are needed use HistoryItemsList=vector<HistoryItem*>.
This commit is contained in:
@@ -450,21 +450,11 @@ DeleteMessagesBox::DeleteMessagesBox(
|
||||
|
||||
DeleteMessagesBox::DeleteMessagesBox(
|
||||
QWidget*,
|
||||
const SelectedItemSet &selected)
|
||||
: _ids(CollectFrom(selected)) {
|
||||
MessageIdsList &&selected)
|
||||
: _ids(std::move(selected)) {
|
||||
Expects(!_ids.empty());
|
||||
}
|
||||
|
||||
std::vector<FullMsgId> DeleteMessagesBox::CollectFrom(
|
||||
const SelectedItemSet &items) {
|
||||
return ranges::make_iterator_range(
|
||||
items.begin(),
|
||||
items.end()
|
||||
) | ranges::view::transform([](not_null<HistoryItem*> item) {
|
||||
return item->fullId();
|
||||
}) | ranges::to_vector;
|
||||
}
|
||||
|
||||
void DeleteMessagesBox::prepare() {
|
||||
auto text = QString();
|
||||
if (_moderateFrom) {
|
||||
|
Reference in New Issue
Block a user