mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Slightly refactored uploading of edit media.
This commit is contained in:
@@ -344,13 +344,15 @@ void FillMessagePostFlags(
|
||||
|
||||
void SendConfirmedFile(
|
||||
not_null<Main::Session*> session,
|
||||
const std::shared_ptr<FileLoadResult> &file,
|
||||
const std::optional<FullMsgId> &oldId) {
|
||||
const auto isEditing = oldId.has_value();
|
||||
const std::shared_ptr<FileLoadResult> &file) {
|
||||
const auto isEditing = file->to.replaceMediaOf != 0;
|
||||
const auto channelId = peerToChannel(file->to.peer);
|
||||
|
||||
const auto newId = oldId.value_or(
|
||||
FullMsgId(channelId, session->data().nextLocalMessageId()));
|
||||
const auto newId = FullMsgId(
|
||||
channelId,
|
||||
isEditing
|
||||
? file->to.replaceMediaOf
|
||||
: session->data().nextLocalMessageId());
|
||||
auto groupId = file->album ? file->album->groupId : uint64(0);
|
||||
if (file->album) {
|
||||
const auto proj = [](const SendingAlbum::Item &item) {
|
||||
@@ -361,7 +363,6 @@ void SendConfirmedFile(
|
||||
|
||||
it->msgId = newId;
|
||||
}
|
||||
file->edit = isEditing;
|
||||
session->uploader().upload(newId, file);
|
||||
|
||||
const auto itemToEdit = isEditing
|
||||
|
Reference in New Issue
Block a user