Move multi-forward group adding code
This commit is contained in:
parent
b6fb3f89d6
commit
988c27a94d
1 changed files with 8 additions and 17 deletions
|
|
@ -1133,30 +1133,21 @@ QPointer<Ui::RpWidget> ShowForwardMessagesBox(
|
||||||
auto item = navigation->session().data().message(fullId);
|
auto item = navigation->session().data().message(fullId);
|
||||||
auto group = owner->groups().find(item);
|
auto group = owner->groups().find(item);
|
||||||
|
|
||||||
if (!groupedMsgIds.size()) {
|
if (groupedMsgIds.size()) {
|
||||||
MsgIdsGroup msgIdGroupInst;
|
|
||||||
msgIdGroupInst.items.push_back(item);
|
|
||||||
msgIdGroupInst.ids.push_back(MTP_int(fullId.msg));
|
|
||||||
if (group != nullptr) {
|
|
||||||
msgIdGroupInst.grouped = true;
|
|
||||||
}
|
|
||||||
groupedMsgIds.push_back(msgIdGroupInst);
|
|
||||||
} else {
|
|
||||||
auto prevItem = groupedMsgIds.back().items.back();
|
auto prevItem = groupedMsgIds.back().items.back();
|
||||||
auto prevGroup = owner->groups().find(prevItem);
|
auto prevGroup = owner->groups().find(prevItem);
|
||||||
if (prevGroup == group) {
|
if (prevGroup == group) {
|
||||||
groupedMsgIds.back().items.push_back(item);
|
groupedMsgIds.back().items.push_back(item);
|
||||||
groupedMsgIds.back().ids.push_back(MTP_int(fullId.msg));
|
groupedMsgIds.back().ids.push_back(MTP_int(fullId.msg));
|
||||||
} else {
|
continue;
|
||||||
MsgIdsGroup msgIdGroupInst;
|
|
||||||
msgIdGroupInst.items.push_back(item);
|
|
||||||
msgIdGroupInst.ids.push_back(MTP_int(fullId.msg));
|
|
||||||
if (group != nullptr) {
|
|
||||||
msgIdGroupInst.grouped = true;
|
|
||||||
}
|
|
||||||
groupedMsgIds.push_back(msgIdGroupInst);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MsgIdsGroup msgIdGroupInst;
|
||||||
|
msgIdGroupInst.items.push_back(item);
|
||||||
|
msgIdGroupInst.ids.push_back(MTP_int(fullId.msg));
|
||||||
|
msgIdGroupInst.grouped = (group != nullptr);
|
||||||
|
groupedMsgIds.push_back(msgIdGroupInst);
|
||||||
}
|
}
|
||||||
auto generateRandom = [&] (int size) {
|
auto generateRandom = [&] (int size) {
|
||||||
auto result = QVector<MTPlong>(size);
|
auto result = QVector<MTPlong>(size);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue