2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Move all gsl::byte helpers to base/bytes module.

This commit is contained in:
John Preston
2018-03-27 16:16:00 +04:00
parent b2014f403e
commit 1392e05ab1
33 changed files with 360 additions and 390 deletions

View File

@@ -286,16 +286,13 @@ void Session::sendPong(quint64 msgId, quint64 pingId) {
}
void Session::sendMsgsStateInfo(quint64 msgId, QByteArray data) {
auto info = std::string();
auto info = bytes::vector();
if (!data.isEmpty()) {
info.resize(data.size());
auto src = gsl::as_bytes(gsl::make_span(data));
// auto dst = gsl::as_writeable_bytes(gsl::make_span(info));
auto dst = gsl::as_writeable_bytes(gsl::make_span(&info[0], info.size()));
base::copy_bytes(dst, src);
bytes::copy(info, bytes::make_span(data));
}
send(mtpRequestData::serialize(MTPMsgsStateInfo(
MTP_msgs_state_info(MTP_long(msgId), MTP_string(std::move(info))))));
MTP_msgs_state_info(MTP_long(msgId), MTP_bytes(data)))));
}
void Session::checkRequestsByTimer() {