2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Moved api peer photo processing to separated file.

Removed MainWidget::deletePhotoLayer.
This commit is contained in:
23rd
2021-10-20 19:54:22 +03:00
parent 36d6682122
commit 159beb138a
15 changed files with 294 additions and 213 deletions

View File

@@ -36,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_cloud_file.h"
#include "apiwrap.h"
#include "api/api_invite_links.h"
#include "api/api_peer_photo.h"
#include "main/main_session.h"
#include "facades.h"
#include "styles/style_layers.h"
@@ -89,7 +90,7 @@ void ChatCreateDone(
}
| [&](not_null<ChatData*> chat) {
if (!image.isNull()) {
chat->session().api().uploadPeerPhoto(
chat->session().api().peerPhoto().upload(
chat,
std::move(image));
}
@@ -741,7 +742,7 @@ void GroupInfoBox::createChannel(
| [&](not_null<ChannelData*> channel) {
auto image = _photo->takeResultImage();
if (!image.isNull()) {
channel->session().api().uploadPeerPhoto(
channel->session().api().peerPhoto().upload(
channel,
std::move(image));
}

View File

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/peers/edit_peer_info_box.h"
#include "apiwrap.h"
#include "api/api_peer_photo.h"
#include "main/main_session.h"
#include "boxes/add_contact_box.h"
#include "ui/boxes/confirm_box.h"
@@ -1469,7 +1470,7 @@ void Controller::savePhoto() {
? _controls.photo->takeResultImage()
: QImage();
if (!image.isNull()) {
_peer->session().api().uploadPeerPhoto(_peer, std::move(image));
_peer->session().api().peerPhoto().upload(_peer, std::move(image));
}
_box->closeBox();
}