diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index 92888fe49..91e69aab2 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -27,20 +27,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include #include -#ifdef OS_MAC_OLD -namespace gsl { - -inline span make_span(QByteArray &container) { - return span(container.begin(), container.end()); -} - -inline span make_span(const QByteArray &container) { - return span(container.begin(), container.end()); -} - -} // namespace gsl -#endif // OS_MAC_OLD - // Release build assertions. inline void t_noop() { } @@ -468,6 +454,7 @@ public: ReadLockerAttempt &operator=(ReadLockerAttempt &&other) { _lock = other._lock; _locked = base::take(other._locked); + return *this; } ~ReadLockerAttempt() { if (_locked) { diff --git a/Telegram/SourceFiles/history/history_admin_log_item.cpp b/Telegram/SourceFiles/history/history_admin_log_item.cpp index bf2c4d0be..7fb6d4421 100644 --- a/Telegram/SourceFiles/history/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/history_admin_log_item.cpp @@ -117,8 +117,8 @@ auto GenerateAdminChangeText(gsl::not_null channel, const TextWith Expects(!newRights || newRights->type() == mtpc_channelAdminRights); Expects(!prevRights || prevRights->type() == mtpc_channelAdminRights); - auto newFlags = newRights ? newRights->c_channelAdminRights().vflags.v : 0; - auto prevFlags = prevRights ? prevRights->c_channelAdminRights().vflags.v : 0; + auto newFlags = newRights ? newRights->c_channelAdminRights().vflags.v : MTPDchannelAdminRights::Flags(0); + auto prevFlags = prevRights ? prevRights->c_channelAdminRights().vflags.v : MTPDchannelAdminRights::Flags(0); auto result = lng_admin_log_promoted__generic(lt_user, user); auto inviteKey = Flag::f_invite_users | Flag::f_invite_link; @@ -150,8 +150,8 @@ auto GenerateBannedChangeText(const TextWithEntities &user, const MTPChannelBann Expects(!newRights || newRights->type() == mtpc_channelBannedRights); Expects(!prevRights || prevRights->type() == mtpc_channelBannedRights); - auto newFlags = newRights ? newRights->c_channelBannedRights().vflags.v : 0; - auto prevFlags = prevRights ? prevRights->c_channelBannedRights().vflags.v : 0; + auto newFlags = newRights ? newRights->c_channelBannedRights().vflags.v : MTPDchannelBannedRights::Flags(0); + auto prevFlags = prevRights ? prevRights->c_channelBannedRights().vflags.v : MTPDchannelBannedRights::Flags(0); auto newUntil = newRights ? newRights->c_channelBannedRights().vuntil_date : MTP_int(0); auto indefinitely = ChannelData::IsRestrictedForever(newUntil.v); if (newFlags & Flag::f_view_messages) { @@ -248,7 +248,6 @@ void GenerateItems(gsl::not_null history, LocalIdManager &idManager, c return callback(HistoryItemOwned(item)); }; - using ServiceFlag = MTPDmessageService::Flag; using Flag = MTPDmessage::Flag; auto fromName = App::peerName(from); auto fromLink = peerOpenClickHandler(from); diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h index 5e5c52168..d0bc743d9 100644 --- a/Telegram/SourceFiles/history/history_item.h +++ b/Telegram/SourceFiles/history/history_item.h @@ -779,7 +779,7 @@ public: return (!out() || isPost()) && !history()->peer->isUser(); } PeerData *author() const { - return isPost() ? history()->peer : _from; + return isPost() ? history()->peer : from(); } QDateTime dateOriginal() const { diff --git a/Telegram/SourceFiles/mtproto/special_config_request.cpp b/Telegram/SourceFiles/mtproto/special_config_request.cpp index 7223614ff..3bb2ea258 100644 --- a/Telegram/SourceFiles/mtproto/special_config_request.cpp +++ b/Telegram/SourceFiles/mtproto/special_config_request.cpp @@ -107,7 +107,7 @@ void SpecialConfigRequest::dnsFinished() { } else if (!answerIt->isArray()) { LOG(("Config Error: Not an array received in Answer in dns response JSON.")); } else { - for (auto &elem : answerIt->toArray()) { + for (auto elem : answerIt->toArray()) { if (!elem.isObject()) { LOG(("Config Error: Not an object found in Answer array in dns response JSON.")); } else {