| 4074 | } |
| 4075 | |
| 4076 | void ApiWrap::sendUploadedDocument( |
| 4077 | FullMsgId localId, |
| 4078 | Api::RemoteFileInfo info, |
| 4079 | Api::SendOptions options) { |
| 4080 | if (const auto item = _session->data().message(localId)) { |
| 4081 | if (!item->media() || !item->media()->document()) { |
| 4082 | return; |
| 4083 | } |
| 4084 | const auto media = Api::PrepareUploadedDocument( |
| 4085 | item, |
| 4086 | std::move(info)); |
| 4087 | const auto groupId = item->groupId(); |
| 4088 | if (groupId) { |
| 4089 | uploadAlbumMedia(item, groupId, media); |
| 4090 | } else { |
| 4091 | sendMedia(item, media, options); |
| 4092 | } |
| 4093 | } |
| 4094 | } |
| 4095 | |
| 4096 | void ApiWrap::cancelLocalItem(not_null<HistoryItem*> item) { |
| 4097 | Expects(item->isSending()); |