2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Extended output data from emoji userpic builder.

This commit is contained in:
23rd
2023-01-30 23:32:41 +03:00
committed by John Preston
parent 9940ee21d3
commit b7cf32a65f
10 changed files with 45 additions and 20 deletions

View File

@@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/painter.h"
#include "editor/photo_editor_common.h"
#include "editor/photo_editor_layer_widget.h"
#include "info/userpic/info_userpic_emoji_builder_common.h"
#include "info/userpic/info_userpic_emoji_builder_menu_item.h"
#include "media/streaming/media_streaming_instance.h"
#include "media/streaming/media_streaming_player.h"
@@ -351,6 +352,15 @@ void UserpicButton::choosePhotoLocally() {
}, &st::menuIconPhotoSet);
}
if (_controller) {
const auto done = [=](UserpicBuilder::Result data) {
auto result = ChosenImage{
base::take(data.image),
ChosenType::Set,
};
result.markup.documentId = data.id;
result.markup.colors = base::take(data.colors);
_chosenImages.fire(std::move(result));
};
auto &session = _controller->session();
UserpicBuilder::AddEmojiBuilderAction(
_controller,
@@ -358,7 +368,7 @@ void UserpicButton::choosePhotoLocally() {
session.api().peerPhoto().emojiListValue(user
? Api::PeerPhoto::EmojiListType::Profile
: Api::PeerPhoto::EmojiListType::Group),
callback(ChosenType::Set));
done);
}
} else {
chooseFile();