From b3da99c3020e5b51e142358ddc1ff1039872c13e Mon Sep 17 00:00:00 2001
From: John Preston <johnprestonmail@gmail.com>
Date: Thu, 17 Aug 2017 11:31:24 +0300
Subject: [PATCH] Replace gsl::not_null<T*> with just not_null<T*>.

---
 Telegram/SourceFiles/apiwrap.cpp              |  22 ++--
 Telegram/SourceFiles/apiwrap.h                |  28 ++---
 Telegram/SourceFiles/auth_session.h           |  12 +-
 .../SourceFiles/boxes/add_contact_box.cpp     |  18 +--
 Telegram/SourceFiles/boxes/add_contact_box.h  |  14 +--
 Telegram/SourceFiles/boxes/confirm_box.cpp    |   2 +-
 Telegram/SourceFiles/boxes/confirm_box.h      |   4 +-
 .../boxes/edit_participant_box.cpp            |  18 +--
 .../SourceFiles/boxes/edit_participant_box.h  |  18 +--
 .../SourceFiles/boxes/edit_privacy_box.cpp    |  24 ++--
 Telegram/SourceFiles/boxes/edit_privacy_box.h |   6 +-
 Telegram/SourceFiles/boxes/language_box.cpp   |   6 +-
 .../SourceFiles/boxes/mute_settings_box.h     |   4 +-
 Telegram/SourceFiles/boxes/peer_list_box.cpp  |  60 +++++-----
 Telegram/SourceFiles/boxes/peer_list_box.h    | 112 +++++++++---------
 .../boxes/peer_list_controllers.cpp           |  80 ++++++-------
 .../SourceFiles/boxes/peer_list_controllers.h |  78 ++++++------
 Telegram/SourceFiles/boxes/stickers_box.cpp   |   4 +-
 Telegram/SourceFiles/boxes/stickers_box.h     |   4 +-
 .../calls/calls_box_controller.cpp            |   4 +-
 .../SourceFiles/calls/calls_box_controller.h  |   4 +-
 Telegram/SourceFiles/calls/calls_call.cpp     |   2 +-
 Telegram/SourceFiles/calls/calls_call.h       |  14 +--
 .../calls/calls_emoji_fingerprint.cpp         |   2 +-
 .../calls/calls_emoji_fingerprint.h           |   2 +-
 Telegram/SourceFiles/calls/calls_instance.cpp |  14 +--
 Telegram/SourceFiles/calls/calls_instance.h   |  16 +--
 Telegram/SourceFiles/calls/calls_panel.cpp    |  10 +-
 Telegram/SourceFiles/calls/calls_panel.h      |   6 +-
 .../SourceFiles/chat_helpers/bot_keyboard.cpp |   2 +-
 .../SourceFiles/chat_helpers/bot_keyboard.h   |   2 +-
 .../chat_helpers/emoji_list_widget.cpp        |   8 +-
 .../chat_helpers/emoji_list_widget.h          |   2 +-
 .../chat_helpers/emoji_suggestions_widget.cpp |  10 +-
 .../chat_helpers/emoji_suggestions_widget.h   |   4 +-
 .../chat_helpers/gifs_list_widget.cpp         |   8 +-
 .../chat_helpers/gifs_list_widget.h           |   2 +-
 .../chat_helpers/message_field.cpp            |   2 +-
 .../SourceFiles/chat_helpers/message_field.h  |   4 +-
 .../SourceFiles/chat_helpers/stickers.cpp     |  28 ++---
 Telegram/SourceFiles/chat_helpers/stickers.h  |  10 +-
 .../chat_helpers/stickers_list_widget.cpp     |   8 +-
 .../chat_helpers/stickers_list_widget.h       |   2 +-
 .../SourceFiles/chat_helpers/tabbed_panel.cpp |   4 +-
 .../SourceFiles/chat_helpers/tabbed_panel.h   |   6 +-
 .../chat_helpers/tabbed_section.cpp           |   4 +-
 .../SourceFiles/chat_helpers/tabbed_section.h |   4 +-
 .../chat_helpers/tabbed_selector.cpp          |  10 +-
 .../chat_helpers/tabbed_selector.h            |  26 ++--
 Telegram/SourceFiles/core/basic_types.h       |   3 +
 Telegram/SourceFiles/core/utils.h             |   4 +-
 .../dialogs/dialogs_inner_widget.cpp          |   6 +-
 .../dialogs/dialogs_inner_widget.h            |   8 +-
 .../dialogs_search_from_controllers.cpp       |  16 +--
 .../dialogs/dialogs_search_from_controllers.h |  20 ++--
 .../SourceFiles/dialogs/dialogs_widget.cpp    |   4 +-
 Telegram/SourceFiles/dialogs/dialogs_widget.h |   2 +-
 Telegram/SourceFiles/facades.cpp              |   2 +-
 Telegram/SourceFiles/facades.h                |   2 +-
 Telegram/SourceFiles/history/history.cpp      |  10 +-
 Telegram/SourceFiles/history/history.h        |  10 +-
 .../history/history_admin_log_filter.cpp      |  24 ++--
 .../history/history_admin_log_filter.h        |   6 +-
 .../history/history_admin_log_inner.cpp       |  22 ++--
 .../history/history_admin_log_inner.h         |  30 ++---
 .../history/history_admin_log_item.cpp        |  10 +-
 .../history/history_admin_log_item.h          |   4 +-
 .../history/history_admin_log_section.cpp     |  20 ++--
 .../history/history_admin_log_section.h       |  34 +++---
 .../history/history_inner_widget.cpp          |  16 +--
 .../history/history_inner_widget.h            |  10 +-
 Telegram/SourceFiles/history/history_item.cpp |   2 +-
 Telegram/SourceFiles/history/history_item.h   |  10 +-
 Telegram/SourceFiles/history/history_media.h  |   4 +-
 .../history/history_media_types.cpp           |  42 +++----
 .../SourceFiles/history/history_media_types.h |  56 ++++-----
 .../SourceFiles/history/history_message.cpp   |  24 ++--
 .../SourceFiles/history/history_message.h     |  36 +++---
 .../SourceFiles/history/history_service.cpp   |  10 +-
 .../SourceFiles/history/history_service.h     |  18 +--
 .../SourceFiles/history/history_widget.cpp    |   8 +-
 Telegram/SourceFiles/history/history_widget.h |   8 +-
 .../inline_bot_layout_internal.cpp            |  22 ++--
 .../inline_bots/inline_bot_layout_internal.h  |  26 ++--
 .../inline_bots/inline_bot_layout_item.cpp    |   4 +-
 .../inline_bots/inline_bot_layout_item.h      |  14 +--
 .../inline_bots/inline_results_widget.cpp     |   4 +-
 .../inline_bots/inline_results_widget.h       |   8 +-
 .../SourceFiles/lang/lang_cloud_manager.cpp   |   2 +-
 .../SourceFiles/lang/lang_cloud_manager.h     |   2 +-
 Telegram/SourceFiles/layerwidget.cpp          |   2 +-
 Telegram/SourceFiles/layerwidget.h            |   6 +-
 Telegram/SourceFiles/mainwidget.cpp           |  26 ++--
 Telegram/SourceFiles/mainwidget.h             |  26 ++--
 .../SourceFiles/media/media_audio_track.cpp   |   2 +-
 .../SourceFiles/media/media_audio_track.h     |   4 +-
 .../SourceFiles/media/media_clip_reader.cpp   |   2 +-
 .../SourceFiles/media/media_clip_reader.h     |   2 +-
 .../media/player/media_player_float.h         |   2 +-
 .../media/player/media_player_list.cpp        |   2 +-
 .../media/player/media_player_list.h          |   2 +-
 .../media/player/media_player_panel.cpp       |   2 +-
 .../media/player/media_player_panel.h         |   2 +-
 Telegram/SourceFiles/mediaview.cpp            |   2 +-
 Telegram/SourceFiles/mediaview.h              |   2 +-
 Telegram/SourceFiles/messenger.cpp            |   8 +-
 Telegram/SourceFiles/messenger.h              |   8 +-
 .../SourceFiles/mtproto/config_loader.cpp     |   2 +-
 Telegram/SourceFiles/mtproto/config_loader.h  |   4 +-
 Telegram/SourceFiles/mtproto/dc_options.cpp   |   2 +-
 Telegram/SourceFiles/mtproto/dcenter.cpp      |   2 +-
 Telegram/SourceFiles/mtproto/dcenter.h        |   4 +-
 Telegram/SourceFiles/mtproto/mtp_instance.cpp |  16 +--
 Telegram/SourceFiles/mtproto/mtp_instance.h   |   4 +-
 Telegram/SourceFiles/mtproto/sender.h         |  22 ++--
 Telegram/SourceFiles/mtproto/session.cpp      |   2 +-
 Telegram/SourceFiles/mtproto/session.h        |  30 ++---
 Telegram/SourceFiles/overviewwidget.cpp       |   4 +-
 Telegram/SourceFiles/overviewwidget.h         |   4 +-
 .../platform/mac/main_window_mac.mm           |   2 +-
 .../profile/profile_block_group_members.cpp   |   4 +-
 .../profile/profile_block_group_members.h     |   4 +-
 .../profile/profile_block_widget.h            |   4 +-
 .../profile/profile_channel_controllers.cpp   |  92 +++++++-------
 .../profile/profile_channel_controllers.h     | 108 ++++++++---------
 .../profile/profile_common_groups_section.cpp |  24 ++--
 .../profile/profile_common_groups_section.h   |  38 +++---
 .../profile/profile_inner_widget.cpp          |   4 +-
 .../profile/profile_inner_widget.h            |   4 +-
 .../profile/profile_section_memento.cpp       |   2 +-
 .../profile/profile_section_memento.h         |   2 +-
 .../SourceFiles/profile/profile_widget.cpp    |  10 +-
 Telegram/SourceFiles/profile/profile_widget.h |  10 +-
 .../settings/settings_privacy_controllers.cpp |  26 ++--
 .../settings/settings_privacy_controllers.h   |   4 +-
 .../settings/settings_privacy_widget.cpp      |   2 +-
 Telegram/SourceFiles/storage/file_download.h  |   2 +-
 Telegram/SourceFiles/structs.cpp              |  12 +-
 Telegram/SourceFiles/structs.h                |  42 +++----
 Telegram/SourceFiles/ui/widgets/checkbox.h    |   6 +-
 Telegram/SourceFiles/window/section_memento.h |   2 +-
 .../SourceFiles/window/section_widget.cpp     |   2 +-
 Telegram/SourceFiles/window/section_widget.h  |  10 +-
 .../SourceFiles/window/top_bar_widget.cpp     |   2 +-
 Telegram/SourceFiles/window/top_bar_widget.h  |   4 +-
 .../SourceFiles/window/window_controller.cpp  |   2 +-
 .../SourceFiles/window/window_controller.h    |   8 +-
 .../SourceFiles/window/window_main_menu.cpp   |   4 +-
 148 files changed, 966 insertions(+), 963 deletions(-)

diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp
index d90c2102e2..7491cbca30 100644
--- a/Telegram/SourceFiles/apiwrap.cpp
+++ b/Telegram/SourceFiles/apiwrap.cpp
@@ -49,7 +49,7 @@ constexpr auto kUnreadMentionsNextRequestLimit = 100;
 
 } // namespace
 
-ApiWrap::ApiWrap(gsl::not_null<AuthSession*> session)
+ApiWrap::ApiWrap(not_null<AuthSession*> session)
 : _session(session)
 , _messageDataResolveDelayed([this] { resolveMessageDatas(); })
 , _webPagesTimer([this] { resolveWebPages(); })
@@ -1462,7 +1462,7 @@ void ApiWrap::updateStickers() {
 	requestSavedGifs(now);
 }
 
-void ApiWrap::setGroupStickerSet(gsl::not_null<ChannelData*> megagroup, const MTPInputStickerSet &set) {
+void ApiWrap::setGroupStickerSet(not_null<ChannelData*> megagroup, const MTPInputStickerSet &set) {
 	Expects(megagroup->mgInfo != nullptr);
 	megagroup->mgInfo->stickerSet = set;
 	request(MTPchannels_SetStickers(megagroup->inputChannel, set)).send();
@@ -1720,7 +1720,7 @@ void ApiWrap::applyUpdateNoPtsCheck(const MTPUpdate &update) {
 	}
 }
 
-void ApiWrap::jumpToDate(gsl::not_null<PeerData*> peer, const QDate &date) {
+void ApiWrap::jumpToDate(not_null<PeerData*> peer, const QDate &date) {
 	// API returns a message with date <= offset_date.
 	// So we request a message with offset_date = desired_date - 1 and add_offset = -1.
 	// This should give us the first message with date >= desired_date.
@@ -1762,7 +1762,7 @@ void ApiWrap::jumpToDate(gsl::not_null<PeerData*> peer, const QDate &date) {
 	}).send();
 }
 
-void ApiWrap::preloadEnoughUnreadMentions(gsl::not_null<History*> history) {
+void ApiWrap::preloadEnoughUnreadMentions(not_null<History*> history) {
 	auto fullCount = history->getUnreadMentionsCount();
 	auto loadedCount = history->getUnreadMentionsLoadedCount();
 	auto allLoaded = (fullCount >= 0) ? (loadedCount >= fullCount) : false;
@@ -1798,7 +1798,7 @@ void ApiWrap::checkForUnreadMentions(const base::flat_set<MsgId> &possiblyReadMe
 	}
 }
 
-void ApiWrap::cancelEditChatAdmins(gsl::not_null<ChatData*> chat) {
+void ApiWrap::cancelEditChatAdmins(not_null<ChatData*> chat) {
 	_chatAdminsEnabledRequests.take(chat)
 		| requestCanceller();
 
@@ -1809,9 +1809,9 @@ void ApiWrap::cancelEditChatAdmins(gsl::not_null<ChatData*> chat) {
 }
 
 void ApiWrap::editChatAdmins(
-		gsl::not_null<ChatData*> chat,
+		not_null<ChatData*> chat,
 		bool adminsEnabled,
-		base::flat_set<gsl::not_null<UserData*>> &&admins) {
+		base::flat_set<not_null<UserData*>> &&admins) {
 	cancelEditChatAdmins(chat);
 	if (adminsEnabled) {
 		_chatAdminsToSave.emplace(chat, std::move(admins));
@@ -1830,7 +1830,7 @@ void ApiWrap::editChatAdmins(
 	_chatAdminsEnabledRequests.emplace(chat, requestId);
 }
 
-void ApiWrap::saveChatAdmins(gsl::not_null<ChatData*> chat) {
+void ApiWrap::saveChatAdmins(not_null<ChatData*> chat) {
 	if (!_chatAdminsToSave.contains(chat)) {
 		return;
 	}
@@ -1845,8 +1845,8 @@ void ApiWrap::saveChatAdmins(gsl::not_null<ChatData*> chat) {
 	_chatAdminsEnabledRequests.emplace(chat, requestId);
 }
 
-void ApiWrap::sendSaveChatAdminsRequests(gsl::not_null<ChatData*> chat) {
-	auto editOne = [this, chat](gsl::not_null<UserData*> user, bool admin) {
+void ApiWrap::sendSaveChatAdminsRequests(not_null<ChatData*> chat) {
+	auto editOne = [this, chat](not_null<UserData*> user, bool admin) {
 		auto requestId = request(MTPmessages_EditChatAdmin(
 				chat->inputChat,
 				user->inputUser,
@@ -1892,7 +1892,7 @@ void ApiWrap::sendSaveChatAdminsRequests(gsl::not_null<ChatData*> chat) {
 	t_assert(!!admins);
 
 	auto toRemove = chat->admins;
-	auto toAppoint = std::vector<gsl::not_null<UserData*>>();
+	auto toAppoint = std::vector<not_null<UserData*>>();
 	if (!admins->empty()) {
 		toAppoint.reserve(admins->size());
 		for (auto user : *admins) {
diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h
index d3f67da2d1..7b7a94b8fe 100644
--- a/Telegram/SourceFiles/apiwrap.h
+++ b/Telegram/SourceFiles/apiwrap.h
@@ -42,7 +42,7 @@ inline const MTPVector<MTPChat> *getChatsFromMessagesChats(const MTPmessages_Cha
 
 class ApiWrap : private MTP::Sender, private base::Subscriber {
 public:
-	ApiWrap(gsl::not_null<AuthSession*> session);
+	ApiWrap(not_null<AuthSession*> session);
 
 	void start();
 	void applyUpdates(const MTPUpdates &updates, uint64 sentMessageRandomId = 0);
@@ -72,7 +72,7 @@ public:
 	void requestStickerSets();
 	void saveStickerSets(const Stickers::Order &localOrder, const Stickers::Order &localRemoved);
 	void updateStickers();
-	void setGroupStickerSet(gsl::not_null<ChannelData*> megagroup, const MTPInputStickerSet &set);
+	void setGroupStickerSet(not_null<ChannelData*> megagroup, const MTPInputStickerSet &set);
 
 	void joinChannel(ChannelData *channel);
 	void leaveChannel(ChannelData *channel);
@@ -98,15 +98,15 @@ public:
 	void applyUpdatesNoPtsCheck(const MTPUpdates &updates);
 	void applyUpdateNoPtsCheck(const MTPUpdate &update);
 
-	void jumpToDate(gsl::not_null<PeerData*> peer, const QDate &date);
+	void jumpToDate(not_null<PeerData*> peer, const QDate &date);
 
-	void preloadEnoughUnreadMentions(gsl::not_null<History*> history);
+	void preloadEnoughUnreadMentions(not_null<History*> history);
 	void checkForUnreadMentions(const base::flat_set<MsgId> &possiblyReadMentions, ChannelData *channel = nullptr);
 
 	void editChatAdmins(
-		gsl::not_null<ChatData*> chat,
+		not_null<ChatData*> chat,
 		bool adminsEnabled,
-		base::flat_set<gsl::not_null<UserData*>> &&admins);
+		base::flat_set<not_null<UserData*>> &&admins);
 
 	~ApiWrap();
 
@@ -149,11 +149,11 @@ private:
 	void requestFeaturedStickers(TimeId now);
 	void requestSavedGifs(TimeId now);
 
-	void cancelEditChatAdmins(gsl::not_null<ChatData*> chat);
-	void saveChatAdmins(gsl::not_null<ChatData*> chat);
-	void sendSaveChatAdminsRequests(gsl::not_null<ChatData*> chat);
+	void cancelEditChatAdmins(not_null<ChatData*> chat);
+	void saveChatAdmins(not_null<ChatData*> chat);
+	void sendSaveChatAdminsRequests(not_null<ChatData*> chat);
 
-	gsl::not_null<AuthSession*> _session;
+	not_null<AuthSession*> _session;
 	mtpRequestId _changelogSubscription = 0;
 
 	MessageDataRequests _messageDataRequests;
@@ -203,11 +203,11 @@ private:
 
 	mtpRequestId _contactsStatusesRequestId = 0;
 
-	base::flat_map<gsl::not_null<History*>, mtpRequestId> _unreadMentionsRequests;
+	base::flat_map<not_null<History*>, mtpRequestId> _unreadMentionsRequests;
 
-	base::flat_map<gsl::not_null<ChatData*>, mtpRequestId> _chatAdminsEnabledRequests;
-	base::flat_map<gsl::not_null<ChatData*>, base::flat_set<gsl::not_null<UserData*>>> _chatAdminsToSave;
-	base::flat_map<gsl::not_null<ChatData*>, base::flat_set<mtpRequestId>> _chatAdminsSaveRequests;
+	base::flat_map<not_null<ChatData*>, mtpRequestId> _chatAdminsEnabledRequests;
+	base::flat_map<not_null<ChatData*>, base::flat_set<not_null<UserData*>>> _chatAdminsToSave;
+	base::flat_map<not_null<ChatData*>, base::flat_set<mtpRequestId>> _chatAdminsSaveRequests;
 
 	base::Observable<PeerData*> _fullPeerUpdated;
 
diff --git a/Telegram/SourceFiles/auth_session.h b/Telegram/SourceFiles/auth_session.h
index a11f4012b0..3124a26b34 100644
--- a/Telegram/SourceFiles/auth_session.h
+++ b/Telegram/SourceFiles/auth_session.h
@@ -61,18 +61,18 @@ public:
 	base::Observable<void> &savedGifsUpdated() {
 		return _savedGifsUpdated;
 	}
-	base::Observable<gsl::not_null<History*>> &historyCleared() {
+	base::Observable<not_null<History*>> &historyCleared() {
 		return _historyCleared;
 	}
-	base::Observable<gsl::not_null<const HistoryItem*>> &repaintLogEntry() {
+	base::Observable<not_null<const HistoryItem*>> &repaintLogEntry() {
 		return _repaintLogEntry;
 	}
 	base::Observable<void> &pendingHistoryResize() {
 		return _pendingHistoryResize;
 	}
 	struct ItemVisibilityQuery {
-		gsl::not_null<HistoryItem*> item;
-		gsl::not_null<bool*> isVisible;
+		not_null<HistoryItem*> item;
+		not_null<bool*> isVisible;
 	};
 	base::Observable<ItemVisibilityQuery> &queryItemVisibility() {
 		return _queryItemVisibility;
@@ -162,8 +162,8 @@ private:
 	base::Observable<void> _moreChatsLoaded;
 	base::Observable<void> _stickersUpdated;
 	base::Observable<void> _savedGifsUpdated;
-	base::Observable<gsl::not_null<History*>> _historyCleared;
-	base::Observable<gsl::not_null<const HistoryItem*>> _repaintLogEntry;
+	base::Observable<not_null<History*>> _historyCleared;
+	base::Observable<not_null<const HistoryItem*>> _repaintLogEntry;
 	base::Observable<void> _pendingHistoryResize;
 	base::Observable<ItemVisibilityQuery> _queryItemVisibility;
 	Variables _variables;
diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp
index 97741955f1..3905a52b8d 100644
--- a/Telegram/SourceFiles/boxes/add_contact_box.cpp
+++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp
@@ -78,10 +78,10 @@ protected:
 
 private:
 	struct ChatRow {
-		ChatRow(gsl::not_null<PeerData*> peer) : peer(peer) {
+		ChatRow(not_null<PeerData*> peer) : peer(peer) {
 		}
 
-		gsl::not_null<PeerData*> peer;
+		not_null<PeerData*> peer;
 		Text name, status;
 	};
 	void paintChat(Painter &p, const ChatRow &row, bool selected) const;
@@ -390,7 +390,7 @@ void GroupInfoBox::onNameSubmit() {
 	}
 }
 
-void GroupInfoBox::createGroup(gsl::not_null<PeerListBox*> selectUsersBox, const QString &title, const std::vector<gsl::not_null<PeerData*>> &users) {
+void GroupInfoBox::createGroup(not_null<PeerListBox*> selectUsersBox, const QString &title, const std::vector<not_null<PeerData*>> &users) {
 	if (_creationRequestId) return;
 
 	auto inputs = QVector<MTPInputUser>();
@@ -426,7 +426,7 @@ void GroupInfoBox::createGroup(gsl::not_null<PeerListBox*> selectUsersBox, const
 			| [](auto chats) {
 				return App::chat(chats->front().c_chat().vid.v);
 			}
-			| [this](gsl::not_null<ChatData*> chat) {
+			| [this](not_null<ChatData*> chat) {
 				if (!_photoImage.isNull()) {
 					Messenger::Instance().uploadProfilePhoto(_photoImage, chat->id);
 				}
@@ -465,7 +465,7 @@ void GroupInfoBox::onNext() {
 	if (_creating != CreatingGroupGroup) {
 		createChannel(title, description);
 	} else {
-		auto initBox = [title, weak = weak(this)](gsl::not_null<PeerListBox*> box) {
+		auto initBox = [title, weak = weak(this)](not_null<PeerListBox*> box) {
 			box->addButton(langFactory(lng_create_group_create), [box, title, weak] {
 				if (weak) {
 					auto rows = box->peerListCollectSelectedRows();
@@ -505,7 +505,7 @@ void GroupInfoBox::createChannel(const QString &title, const QString &descriptio
 			| [](auto chats) {
 				return App::channel(chats->front().c_channel().vid.v);
 			}
-			| [this](gsl::not_null<ChannelData*> channel) {
+			| [this](not_null<ChannelData*> channel) {
 				if (!_photoImage.isNull()) {
 					Messenger::Instance().uploadProfilePhoto(
 						_photoImage,
@@ -909,7 +909,7 @@ bool SetupChannelBox::onFirstCheckFail(const RPCError &error) {
 	return true;
 }
 
-EditNameTitleBox::EditNameTitleBox(QWidget*, gsl::not_null<PeerData*> peer)
+EditNameTitleBox::EditNameTitleBox(QWidget*, not_null<PeerData*> peer)
 : _peer(peer)
 , _first(this, st::defaultInputField, langFactory(_peer->isUser() ? lng_signup_firstname : lng_dlg_new_group_name), _peer->isUser() ? _peer->asUser()->firstName : _peer->name)
 , _last(this, st::defaultInputField, langFactory(lng_signup_lastname), peer->isUser() ? peer->asUser()->lastName : QString())
@@ -1064,7 +1064,7 @@ void EditNameTitleBox::onSaveChatDone(const MTPUpdates &updates) {
 	closeBox();
 }
 
-EditBioBox::EditBioBox(QWidget*, gsl::not_null<UserData*> self) : BoxContent()
+EditBioBox::EditBioBox(QWidget*, not_null<UserData*> self) : BoxContent()
 , _dynamicFieldStyle(CreateBioFieldStyle())
 , _self(self)
 , _bio(this, _dynamicFieldStyle, langFactory(lng_bio_placeholder), _self->about())
@@ -1134,7 +1134,7 @@ void EditBioBox::save() {
 	}).send();
 }
 
-EditChannelBox::EditChannelBox(QWidget*, gsl::not_null<ChannelData*> channel)
+EditChannelBox::EditChannelBox(QWidget*, not_null<ChannelData*> channel)
 : _channel(channel)
 , _title(this, st::defaultInputField, langFactory(_channel->isMegagroup() ? lng_dlg_new_group_name : lng_dlg_new_channel_name), _channel->name)
 , _description(this, st::newGroupDescription, langFactory(lng_create_group_description), _channel->about())
diff --git a/Telegram/SourceFiles/boxes/add_contact_box.h b/Telegram/SourceFiles/boxes/add_contact_box.h
index f52db5d21c..c49e8f14f6 100644
--- a/Telegram/SourceFiles/boxes/add_contact_box.h
+++ b/Telegram/SourceFiles/boxes/add_contact_box.h
@@ -116,7 +116,7 @@ private slots:
 private:
 	void setupPhotoButton();
 	void createChannel(const QString &title, const QString &description);
-	void createGroup(gsl::not_null<PeerListBox*> selectUsersBox, const QString &title, const std::vector<gsl::not_null<PeerData*>> &users);
+	void createGroup(not_null<PeerListBox*> selectUsersBox, const QString &title, const std::vector<not_null<PeerData*>> &users);
 
 	void updateMaxHeight();
 	void updateSelected(const QPoint &cursorGlobalPosition);
@@ -206,7 +206,7 @@ class EditNameTitleBox : public BoxContent, public RPCSender {
 	Q_OBJECT
 
 public:
-	EditNameTitleBox(QWidget*, gsl::not_null<PeerData*> peer);
+	EditNameTitleBox(QWidget*, not_null<PeerData*> peer);
 
 protected:
 	void setInnerFocus() override;
@@ -225,7 +225,7 @@ private:
 	void onSaveChatDone(const MTPUpdates &updates);
 	bool onSaveChatFail(const RPCError &e);
 
-	gsl::not_null<PeerData*> _peer;
+	not_null<PeerData*> _peer;
 
 	object_ptr<Ui::InputField> _first;
 	object_ptr<Ui::InputField> _last;
@@ -239,7 +239,7 @@ private:
 
 class EditBioBox : public BoxContent, private MTP::Sender {
 public:
-	EditBioBox(QWidget*, gsl::not_null<UserData*> self);
+	EditBioBox(QWidget*, not_null<UserData*> self);
 
 protected:
 	void setInnerFocus() override;
@@ -253,7 +253,7 @@ private:
 	void save();
 
 	style::InputField _dynamicFieldStyle;
-	gsl::not_null<UserData*> _self;
+	not_null<UserData*> _self;
 
 	object_ptr<Ui::InputArea> _bio;
 	object_ptr<Ui::FlatLabel> _countdown;
@@ -267,7 +267,7 @@ class EditChannelBox : public BoxContent, public RPCSender {
 	Q_OBJECT
 
 public:
-	EditChannelBox(QWidget*, gsl::not_null<ChannelData*> channel);
+	EditChannelBox(QWidget*, not_null<ChannelData*> channel);
 
 protected:
 	void prepare() override;
@@ -301,7 +301,7 @@ private:
 	void saveSign();
 	void saveInvites();
 
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 
 	object_ptr<Ui::InputField> _title;
 	object_ptr<Ui::InputArea> _description;
diff --git a/Telegram/SourceFiles/boxes/confirm_box.cpp b/Telegram/SourceFiles/boxes/confirm_box.cpp
index 0d2a297cec..eedeb4bcf2 100644
--- a/Telegram/SourceFiles/boxes/confirm_box.cpp
+++ b/Telegram/SourceFiles/boxes/confirm_box.cpp
@@ -216,7 +216,7 @@ InformBox::InformBox(QWidget*, const QString &text, base::lambda<void()> closedC
 InformBox::InformBox(QWidget*, const QString &text, const QString &doneText, base::lambda<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, doneText, std::move(closedCallback)) {
 }
 
-MaxInviteBox::MaxInviteBox(QWidget*, gsl::not_null<ChannelData*> channel) : BoxContent()
+MaxInviteBox::MaxInviteBox(QWidget*, not_null<ChannelData*> channel) : BoxContent()
 , _channel(channel)
 , _text(st::boxLabelStyle, lng_participant_invite_sorry(lt_count, Global::ChatSizeMax()), _confirmBoxTextOptions, st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()) {
 }
diff --git a/Telegram/SourceFiles/boxes/confirm_box.h b/Telegram/SourceFiles/boxes/confirm_box.h
index 4637e82494..9ea2e457a2 100644
--- a/Telegram/SourceFiles/boxes/confirm_box.h
+++ b/Telegram/SourceFiles/boxes/confirm_box.h
@@ -98,7 +98,7 @@ public:
 
 class MaxInviteBox : public BoxContent {
 public:
-	MaxInviteBox(QWidget*, gsl::not_null<ChannelData*> channel);
+	MaxInviteBox(QWidget*, not_null<ChannelData*> channel);
 
 protected:
 	void prepare() override;
@@ -112,7 +112,7 @@ protected:
 private:
 	void updateSelected(const QPoint &cursorGlobalPosition);
 
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 
 	Text _text;
 	int32 _textWidth, _textHeight;
diff --git a/Telegram/SourceFiles/boxes/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/edit_participant_box.cpp
index 334d7ac165..589adbf0f4 100644
--- a/Telegram/SourceFiles/boxes/edit_participant_box.cpp
+++ b/Telegram/SourceFiles/boxes/edit_participant_box.cpp
@@ -75,7 +75,7 @@ void ApplyDependencies(CheckboxesMap &checkboxes, DependenciesMap &dependencies,
 
 class EditParticipantBox::Inner : public TWidget {
 public:
-	Inner(QWidget *parent, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, bool hasAdminRights);
+	Inner(QWidget *parent, not_null<ChannelData*> channel, not_null<UserData*> user, bool hasAdminRights);
 
 	template <typename Widget>
 	QPointer<Widget> addControl(object_ptr<Widget> widget, QMargins margin) {
@@ -92,8 +92,8 @@ protected:
 private:
 	void doAddControl(object_ptr<TWidget> widget, QMargins margin);
 
-	gsl::not_null<ChannelData*> _channel;
-	gsl::not_null<UserData*> _user;
+	not_null<ChannelData*> _channel;
+	not_null<UserData*> _user;
 	object_ptr<Ui::PeerAvatarButton> _userPhoto;
 	Text _userName;
 	bool _hasAdminRights = false;
@@ -105,7 +105,7 @@ private:
 
 };
 
-EditParticipantBox::Inner::Inner(QWidget *parent, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, bool hasAdminRights) : TWidget(parent)
+EditParticipantBox::Inner::Inner(QWidget *parent, not_null<ChannelData*> channel, not_null<UserData*> user, bool hasAdminRights) : TWidget(parent)
 , _channel(channel)
 , _user(user)
 , _userPhoto(this, _user, st::rightsPhotoButton)
@@ -163,7 +163,7 @@ void EditParticipantBox::Inner::paintEvent(QPaintEvent *e) {
 	p.drawTextLeft(namex, st::rightsPhotoMargin.top() + st::rightsStatusTop, width(), statusText());
 }
 
-EditParticipantBox::EditParticipantBox(QWidget*, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, bool hasAdminRights) : BoxContent()
+EditParticipantBox::EditParticipantBox(QWidget*, not_null<ChannelData*> channel, not_null<UserData*> user, bool hasAdminRights) : BoxContent()
 , _channel(channel)
 , _user(user)
 , _hasAdminRights(hasAdminRights) {
@@ -189,7 +189,7 @@ void EditParticipantBox::resizeToContent() {
 	setDimensions(_inner->width(), qMin(_inner->height(), st::boxMaxListHeight));
 }
 
-EditAdminBox::EditAdminBox(QWidget*, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, const MTPChannelAdminRights &rights) : EditParticipantBox(nullptr, channel, user, (rights.c_channelAdminRights().vflags.v != 0))
+EditAdminBox::EditAdminBox(QWidget*, not_null<ChannelData*> channel, not_null<UserData*> user, const MTPChannelAdminRights &rights) : EditParticipantBox(nullptr, channel, user, (rights.c_channelAdminRights().vflags.v != 0))
 , _oldRights(rights) {
 	auto dependency = [this](Flag dependent, Flag dependency) {
 		_dependencies.push_back(std::make_pair(dependent, dependency));
@@ -198,7 +198,7 @@ EditAdminBox::EditAdminBox(QWidget*, gsl::not_null<ChannelData*> channel, gsl::n
 	dependency(Flag::f_invite_users, Flag::f_invite_link);
 }
 
-MTPChannelAdminRights EditAdminBox::DefaultRights(gsl::not_null<ChannelData*> channel) {
+MTPChannelAdminRights EditAdminBox::DefaultRights(not_null<ChannelData*> channel) {
 	auto defaultRights = channel->isMegagroup()
 		? (Flag::f_change_info | Flag::f_delete_messages | Flag::f_ban_users | Flag::f_invite_users | Flag::f_invite_link | Flag::f_pin_messages)
 		: (Flag::f_change_info | Flag::f_post_messages | Flag::f_edit_messages | Flag::f_delete_messages | Flag::f_invite_users | Flag::f_invite_link);
@@ -308,7 +308,7 @@ void EditAdminBox::refreshAboutAddAdminsText() {
 	resizeToContent();
 }
 
-EditRestrictedBox::EditRestrictedBox(QWidget*, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, bool hasAdminRights, const MTPChannelBannedRights &rights) : EditParticipantBox(nullptr, channel, user, hasAdminRights)
+EditRestrictedBox::EditRestrictedBox(QWidget*, not_null<ChannelData*> channel, not_null<UserData*> user, bool hasAdminRights, const MTPChannelBannedRights &rights) : EditParticipantBox(nullptr, channel, user, hasAdminRights)
 , _oldRights(rights) {
 	auto dependency = [this](Flag dependent, Flag dependency) {
 		_dependencies.push_back(std::make_pair(dependent, dependency));
@@ -391,7 +391,7 @@ void EditRestrictedBox::applyDependencies(QPointer<Ui::Checkbox> changed) {
 	ApplyDependencies(_checkboxes, _dependencies, changed);
 }
 
-MTPChannelBannedRights EditRestrictedBox::DefaultRights(gsl::not_null<ChannelData*> channel) {
+MTPChannelBannedRights EditRestrictedBox::DefaultRights(not_null<ChannelData*> channel) {
 	auto defaultRights = Flag::f_send_messages | Flag::f_send_media | Flag::f_embed_links | Flag::f_send_stickers | Flag::f_send_gifs | Flag::f_send_games | Flag::f_send_inline;
 	return MTP_channelBannedRights(MTP_flags(defaultRights), MTP_int(0));
 }
diff --git a/Telegram/SourceFiles/boxes/edit_participant_box.h b/Telegram/SourceFiles/boxes/edit_participant_box.h
index ca5edd0206..d4496b19b4 100644
--- a/Telegram/SourceFiles/boxes/edit_participant_box.h
+++ b/Telegram/SourceFiles/boxes/edit_participant_box.h
@@ -34,17 +34,17 @@ class CalendarBox;
 
 class EditParticipantBox : public BoxContent {
 public:
-	EditParticipantBox(QWidget*, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, bool hasAdminRights);
+	EditParticipantBox(QWidget*, not_null<ChannelData*> channel, not_null<UserData*> user, bool hasAdminRights);
 
 protected:
 	void prepare() override;
 
 	void resizeToContent();
 
-	gsl::not_null<UserData*> user() const {
+	not_null<UserData*> user() const {
 		return _user;
 	}
-	gsl::not_null<ChannelData*> channel() const {
+	not_null<ChannelData*> channel() const {
 		return _channel;
 	}
 
@@ -58,8 +58,8 @@ protected:
 	}
 
 private:
-	gsl::not_null<ChannelData*> _channel;
-	gsl::not_null<UserData*> _user;
+	not_null<ChannelData*> _channel;
+	not_null<UserData*> _user;
 	bool _hasAdminRights = false;
 
 	class Inner;
@@ -69,7 +69,7 @@ private:
 
 class EditAdminBox : public EditParticipantBox {
 public:
-	EditAdminBox(QWidget*, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, const MTPChannelAdminRights &rights);
+	EditAdminBox(QWidget*, not_null<ChannelData*> channel, not_null<UserData*> user, const MTPChannelAdminRights &rights);
 
 	void setSaveCallback(base::lambda<void(MTPChannelAdminRights, MTPChannelAdminRights)> callback) {
 		_saveCallback = std::move(callback);
@@ -82,7 +82,7 @@ private:
 	using Flag = MTPDchannelAdminRights::Flag;
 	using Flags = MTPDchannelAdminRights::Flags;
 
-	static MTPChannelAdminRights DefaultRights(gsl::not_null<ChannelData*> channel);
+	static MTPChannelAdminRights DefaultRights(not_null<ChannelData*> channel);
 
 	bool canSave() const {
 		return !!_saveCallback;
@@ -104,7 +104,7 @@ private:
 
 class EditRestrictedBox : public EditParticipantBox {
 public:
-	EditRestrictedBox(QWidget*, gsl::not_null<ChannelData*> channel, gsl::not_null<UserData*> user, bool hasAdminRights, const MTPChannelBannedRights &rights);
+	EditRestrictedBox(QWidget*, not_null<ChannelData*> channel, not_null<UserData*> user, bool hasAdminRights, const MTPChannelBannedRights &rights);
 
 	void setSaveCallback(base::lambda<void(MTPChannelBannedRights, MTPChannelBannedRights)> callback) {
 		_saveCallback = std::move(callback);
@@ -117,7 +117,7 @@ private:
 	using Flag = MTPDchannelBannedRights::Flag;
 	using Flags = MTPDchannelBannedRights::Flags;
 
-	static MTPChannelBannedRights DefaultRights(gsl::not_null<ChannelData*> channel);
+	static MTPChannelBannedRights DefaultRights(not_null<ChannelData*> channel);
 
 	bool canSave() const {
 		return !!_saveCallback;
diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp
index 3233d305f5..a9137d2f63 100644
--- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp
+++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp
@@ -34,22 +34,22 @@ namespace {
 
 class PrivacyExceptionsBoxController : public ChatsListBoxController {
 public:
-	PrivacyExceptionsBoxController(base::lambda<QString()> titleFactory, const std::vector<gsl::not_null<UserData*>> &selected);
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	PrivacyExceptionsBoxController(base::lambda<QString()> titleFactory, const std::vector<not_null<UserData*>> &selected);
+	void rowClicked(not_null<PeerListRow*> row) override;
 
-	std::vector<gsl::not_null<UserData*>> getResult() const;
+	std::vector<not_null<UserData*>> getResult() const;
 
 protected:
 	void prepareViewHook() override;
-	std::unique_ptr<Row> createRow(gsl::not_null<History*> history) override;
+	std::unique_ptr<Row> createRow(not_null<History*> history) override;
 
 private:
 	base::lambda<QString()> _titleFactory;
-	std::vector<gsl::not_null<UserData*>> _selected;
+	std::vector<not_null<UserData*>> _selected;
 
 };
 
-PrivacyExceptionsBoxController::PrivacyExceptionsBoxController(base::lambda<QString()> titleFactory, const std::vector<gsl::not_null<UserData*>> &selected)
+PrivacyExceptionsBoxController::PrivacyExceptionsBoxController(base::lambda<QString()> titleFactory, const std::vector<not_null<UserData*>> &selected)
 : _titleFactory(std::move(titleFactory))
 , _selected(selected) {
 }
@@ -59,9 +59,9 @@ void PrivacyExceptionsBoxController::prepareViewHook() {
 	delegate()->peerListAddSelectedRows(_selected);
 }
 
-std::vector<gsl::not_null<UserData*>> PrivacyExceptionsBoxController::getResult() const {
+std::vector<not_null<UserData*>> PrivacyExceptionsBoxController::getResult() const {
 	auto peers = delegate()->peerListCollectSelectedRows();
-	auto users = std::vector<gsl::not_null<UserData*>>();
+	auto users = std::vector<not_null<UserData*>>();
 	if (!peers.empty()) {
 		users.reserve(peers.size());
 		for_const (auto peer, peers) {
@@ -73,11 +73,11 @@ std::vector<gsl::not_null<UserData*>> PrivacyExceptionsBoxController::getResult(
 	return users;
 }
 
-void PrivacyExceptionsBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void PrivacyExceptionsBoxController::rowClicked(not_null<PeerListRow*> row) {
 	delegate()->peerListSetRowChecked(row, !row->checked());
 }
 
-std::unique_ptr<PrivacyExceptionsBoxController::Row> PrivacyExceptionsBoxController::createRow(gsl::not_null<History*> history) {
+std::unique_ptr<PrivacyExceptionsBoxController::Row> PrivacyExceptionsBoxController::createRow(not_null<History*> history) {
 	if (history->peer->isSelf()) {
 		return nullptr;
 	}
@@ -178,7 +178,7 @@ void EditPrivacyBox::editExceptionUsers(Exception exception) {
 	auto controller = std::make_unique<PrivacyExceptionsBoxController>(base::lambda_guarded(this, [this, exception] {
 		return _controller->exceptionBoxTitle(exception);
 	}), exceptionUsers(exception));
-	auto initBox = [this, exception, controller = controller.get()](gsl::not_null<PeerListBox*> box) {
+	auto initBox = [this, exception, controller = controller.get()](not_null<PeerListBox*> box) {
 		box->addButton(langFactory(lng_settings_save), base::lambda_guarded(this, [this, box, exception, controller] {
 			exceptionUsers(exception) = controller->getResult();
 			exceptionLink(exception)->entity()->setText(exceptionLinkText(exception));
@@ -244,7 +244,7 @@ style::margins EditPrivacyBox::exceptionLinkMargins() const {
 	return st::editPrivacyLinkMargin;
 }
 
-std::vector<gsl::not_null<UserData*>> &EditPrivacyBox::exceptionUsers(Exception exception) {
+std::vector<not_null<UserData*>> &EditPrivacyBox::exceptionUsers(Exception exception) {
 	switch (exception) {
 	case Exception::Always: return _alwaysUsers;
 	case Exception::Never: return _neverUsers;
diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.h b/Telegram/SourceFiles/boxes/edit_privacy_box.h
index 0d54281158..46eaae29f4 100644
--- a/Telegram/SourceFiles/boxes/edit_privacy_box.h
+++ b/Telegram/SourceFiles/boxes/edit_privacy_box.h
@@ -102,7 +102,7 @@ private:
 
 	void editExceptionUsers(Exception exception);
 	QString exceptionLinkText(Exception exception);
-	std::vector<gsl::not_null<UserData*>> &exceptionUsers(Exception exception);
+	std::vector<not_null<UserData*>> &exceptionUsers(Exception exception);
 	object_ptr<Ui::WidgetSlideWrap<Ui::LinkButton>> &exceptionLink(Exception exception);
 
 	std::unique_ptr<Controller> _controller;
@@ -120,7 +120,7 @@ private:
 	object_ptr<Ui::WidgetSlideWrap<Ui::LinkButton>> _neverLink = { nullptr };
 	object_ptr<Ui::FlatLabel> _exceptionsDescription = { nullptr };
 
-	std::vector<gsl::not_null<UserData*>> _alwaysUsers;
-	std::vector<gsl::not_null<UserData*>> _neverUsers;
+	std::vector<not_null<UserData*>> _alwaysUsers;
+	std::vector<not_null<UserData*>> _neverUsers;
 
 };
diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp
index 084b4dc075..42c2f789f9 100644
--- a/Telegram/SourceFiles/boxes/language_box.cpp
+++ b/Telegram/SourceFiles/boxes/language_box.cpp
@@ -33,7 +33,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 class LanguageBox::Inner : public TWidget, private base::Subscriber {
 public:
-	Inner(QWidget *parent, gsl::not_null<Languages*> languages);
+	Inner(QWidget *parent, not_null<Languages*> languages);
 
 	void setSelected(int index);
 	void refresh();
@@ -42,13 +42,13 @@ private:
 	void activateCurrent();
 	void languageChanged(int languageIndex);
 
-	gsl::not_null<Languages*> _languages;
+	not_null<Languages*> _languages;
 	std::shared_ptr<Ui::RadiobuttonGroup> _group;
 	std::vector<object_ptr<Ui::Radiobutton>> _buttons;
 
 };
 
-LanguageBox::Inner::Inner(QWidget *parent, gsl::not_null<Languages*> languages) : TWidget(parent)
+LanguageBox::Inner::Inner(QWidget *parent, not_null<Languages*> languages) : TWidget(parent)
 , _languages(languages) {
 	_group = std::make_shared<Ui::RadiobuttonGroup>(0);
 	_group->setChangedCallback([this](int value) { languageChanged(value); });
diff --git a/Telegram/SourceFiles/boxes/mute_settings_box.h b/Telegram/SourceFiles/boxes/mute_settings_box.h
index 8749872713..dc689b1fb6 100644
--- a/Telegram/SourceFiles/boxes/mute_settings_box.h
+++ b/Telegram/SourceFiles/boxes/mute_settings_box.h
@@ -15,7 +15,7 @@ class MuteSettingsBox : public BoxContent {
 	Q_OBJECT
 
   public:
-	MuteSettingsBox(QWidget *parent, gsl::not_null<PeerData*> peer)
+	MuteSettingsBox(QWidget *parent, not_null<PeerData*> peer)
 	  : _peer(peer) {
 	}
 
@@ -23,6 +23,6 @@ class MuteSettingsBox : public BoxContent {
 	void prepare() override;
 
   private:
-	gsl::not_null<PeerData*> _peer;
+	not_null<PeerData*> _peer;
 };
 // vi: ts=4 tw=80
diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp
index 960770b674..9afaf48960 100644
--- a/Telegram/SourceFiles/boxes/peer_list_box.cpp
+++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp
@@ -34,7 +34,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 #include "storage/file_download.h"
 #include "window/themes/window_theme.h"
 
-PeerListBox::PeerListBox(QWidget*, std::unique_ptr<PeerListController> controller, base::lambda<void(gsl::not_null<PeerListBox*>)> init)
+PeerListBox::PeerListBox(QWidget*, std::unique_ptr<PeerListController> controller, base::lambda<void(not_null<PeerListBox*>)> init)
 : _controller(std::move(controller))
 , _init(std::move(init)) {
 	Expects(_controller != nullptr);
@@ -155,7 +155,7 @@ void PeerListBox::peerListAppendSearchRow(std::unique_ptr<PeerListRow> row) {
 	_inner->appendSearchRow(std::move(row));
 }
 
-void PeerListBox::peerListAppendFoundRow(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::peerListAppendFoundRow(not_null<PeerListRow*> row) {
 	_inner->appendFoundRow(row);
 }
 
@@ -163,7 +163,7 @@ void PeerListBox::peerListPrependRow(std::unique_ptr<PeerListRow> row) {
 	_inner->prependRow(std::move(row));
 }
 
-void PeerListBox::peerListPrependRowFromSearchResult(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::peerListPrependRowFromSearchResult(not_null<PeerListRow*> row) {
 	_inner->prependRowFromSearchResult(row);
 }
 
@@ -171,19 +171,19 @@ PeerListRow *PeerListBox::peerListFindRow(PeerListRowId id) {
 	return _inner->findRow(id);
 }
 
-void PeerListBox::peerListUpdateRow(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::peerListUpdateRow(not_null<PeerListRow*> row) {
 	_inner->updateRow(row);
 }
 
-void PeerListBox::peerListRemoveRow(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::peerListRemoveRow(not_null<PeerListRow*> row) {
 	_inner->removeRow(row);
 }
 
-void PeerListBox::peerListConvertRowToSearchResult(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::peerListConvertRowToSearchResult(not_null<PeerListRow*> row) {
 	_inner->convertRowToSearchResult(row);
 }
 
-void PeerListBox::peerListSetRowChecked(gsl::not_null<PeerListRow*> row, bool checked) {
+void PeerListBox::peerListSetRowChecked(not_null<PeerListRow*> row, bool checked) {
 	auto peer = row->peer();
 	if (checked) {
 		addSelectItem(peer, PeerListRow::SetStyle::Animated);
@@ -203,7 +203,7 @@ int PeerListBox::peerListFullRowsCount() {
 	return _inner->fullRowsCount();
 }
 
-gsl::not_null<PeerListRow*> PeerListBox::peerListRowAt(int index) {
+not_null<PeerListRow*> PeerListBox::peerListRowAt(int index) {
 	return _inner->rowAt(index);
 }
 
@@ -276,7 +276,7 @@ void PeerListController::search(const QString &query) {
 	_searchController->searchQuery(query);
 }
 
-void PeerListController::peerListSearchAddRow(gsl::not_null<PeerData*> peer) {
+void PeerListController::peerListSearchAddRow(not_null<PeerData*> peer) {
 	if (auto row = delegate()->peerListFindRow(peer->id)) {
 		t_assert(row->id() == row->peer()->id);
 		delegate()->peerListAppendFoundRow(row);
@@ -314,7 +314,7 @@ void PeerListController::setSearchNoResultsText(const QString &text) {
 	}
 }
 
-void PeerListBox::addSelectItem(gsl::not_null<PeerData*> peer, PeerListRow::SetStyle style) {
+void PeerListBox::addSelectItem(not_null<PeerData*> peer, PeerListRow::SetStyle style) {
 	if (!_select) {
 		createMultiSelect();
 		_select->toggleFast(false);
@@ -331,7 +331,7 @@ void PeerListBox::peerListFinishSelectedRowsBunch() {
 	_select->entity()->finishItemsBunch();
 }
 
-bool PeerListBox::peerListIsRowSelected(gsl::not_null<PeerData*> peer) {
+bool PeerListBox::peerListIsRowSelected(not_null<PeerData*> peer) {
 	return _select ? _select->entity()->hasItem(peer->id) : false;
 }
 
@@ -340,9 +340,9 @@ int PeerListBox::peerListSelectedRowsCount() {
 	return _select->entity()->getItemsCount();
 }
 
-std::vector<gsl::not_null<PeerData*>> PeerListBox::peerListCollectSelectedRows() {
+std::vector<not_null<PeerData*>> PeerListBox::peerListCollectSelectedRows() {
 	Expects(_select != nullptr);
-	auto result = std::vector<gsl::not_null<PeerData*>>();
+	auto result = std::vector<not_null<PeerData*>>();
 	auto items = _select->entity()->getItems();
 	if (!items.empty()) {
 		result.reserve(items.size());
@@ -353,10 +353,10 @@ std::vector<gsl::not_null<PeerData*>> PeerListBox::peerListCollectSelectedRows()
 	return result;
 }
 
-PeerListRow::PeerListRow(gsl::not_null<PeerData*> peer) : PeerListRow(peer, peer->id) {
+PeerListRow::PeerListRow(not_null<PeerData*> peer) : PeerListRow(peer, peer->id) {
 }
 
-PeerListRow::PeerListRow(gsl::not_null<PeerData*> peer, PeerListRowId id)
+PeerListRow::PeerListRow(not_null<PeerData*> peer, PeerListRowId id)
 : _id(id)
 , _peer(peer)
 , _initialized(false)
@@ -522,7 +522,7 @@ void PeerListRow::setCheckedInternal(bool checked, SetStyle style) {
 	_checkbox->setChecked(checked, speed);
 }
 
-PeerListBox::Inner::Inner(QWidget *parent, gsl::not_null<PeerListController*> controller) : TWidget(parent)
+PeerListBox::Inner::Inner(QWidget *parent, not_null<PeerListController*> controller) : TWidget(parent)
 , _controller(controller)
 , _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom()) {
 	subscribe(Auth().downloaderTaskFinished(), [this] { update(); });
@@ -564,7 +564,7 @@ void PeerListBox::Inner::appendSearchRow(std::unique_ptr<PeerListRow> row) {
 	}
 }
 
-void PeerListBox::Inner::appendFoundRow(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::Inner::appendFoundRow(not_null<PeerListRow*> row) {
 	Expects(showingSearch());
 	auto index = findRowIndex(row);
 	if (index.value < 0) {
@@ -572,13 +572,13 @@ void PeerListBox::Inner::appendFoundRow(gsl::not_null<PeerListRow*> row) {
 	}
 }
 
-void PeerListBox::Inner::changeCheckState(gsl::not_null<PeerListRow*> row, bool checked, PeerListRow::SetStyle style) {
+void PeerListBox::Inner::changeCheckState(not_null<PeerListRow*> row, bool checked, PeerListRow::SetStyle style) {
 	row->setChecked(checked, style, [this, row] {
 		updateRow(row);
 	});
 }
 
-void PeerListBox::Inner::addRowEntry(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::Inner::addRowEntry(not_null<PeerListRow*> row) {
 	_rowsById.emplace(row->id(), row);
 	_rowsByPeer[row->peer()].push_back(row);
 	if (addingToSearchIndex()) {
@@ -601,7 +601,7 @@ bool PeerListBox::Inner::addingToSearchIndex() const {
 	return (_searchMode != PeerListSearchMode::Disabled) || !_searchIndex.empty();
 }
 
-void PeerListBox::Inner::addToSearchIndex(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::Inner::addToSearchIndex(not_null<PeerListRow*> row) {
 	if (row->isSearchResult()) {
 		return;
 	}
@@ -613,7 +613,7 @@ void PeerListBox::Inner::addToSearchIndex(gsl::not_null<PeerListRow*> row) {
 	}
 }
 
-void PeerListBox::Inner::removeFromSearchIndex(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::Inner::removeFromSearchIndex(not_null<PeerListRow*> row) {
 	auto &nameFirstChars = row->nameFirstChars();
 	if (!nameFirstChars.empty()) {
 		for_const (auto ch, row->nameFirstChars()) {
@@ -639,7 +639,7 @@ void PeerListBox::Inner::prependRow(std::unique_ptr<PeerListRow> row) {
 	}
 }
 
-void PeerListBox::Inner::prependRowFromSearchResult(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::Inner::prependRowFromSearchResult(not_null<PeerListRow*> row) {
 	if (!row->isSearchResult()) {
 		return;
 	}
@@ -677,7 +677,7 @@ PeerListRow *PeerListBox::Inner::findRow(PeerListRowId id) {
 	return (it == _rowsById.cend()) ? nullptr : it->second.get();
 }
 
-void PeerListBox::Inner::removeRow(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::Inner::removeRow(not_null<PeerListRow*> row) {
 	auto index = row->absoluteIndex();
 	auto isSearchResult = row->isSearchResult();
 	auto &eraseFrom = isSearchResult ? _searchRows : _rows;
@@ -698,7 +698,7 @@ void PeerListBox::Inner::removeRow(gsl::not_null<PeerListRow*> row) {
 	restoreSelection();
 }
 
-void PeerListBox::Inner::convertRowToSearchResult(gsl::not_null<PeerListRow*> row) {
+void PeerListBox::Inner::convertRowToSearchResult(not_null<PeerListRow*> row) {
 	if (row->isSearchResult()) {
 		return;
 	} else if (!showingSearch() || !_controller->hasComplexSearch()) {
@@ -719,7 +719,7 @@ int PeerListBox::Inner::fullRowsCount() const {
 	return _rows.size();
 }
 
-gsl::not_null<PeerListRow*> PeerListBox::Inner::rowAt(int index) const {
+not_null<PeerListRow*> PeerListBox::Inner::rowAt(int index) const {
 	Expects(index >= 0 && index < _rows.size());
 	return _rows[index].get();
 }
@@ -1001,7 +1001,7 @@ void PeerListBox::Inner::selectSkip(int direction) {
 	auto rowsCount = shownRowsCount();
 	auto index = 0;
 	auto firstEnabled = -1, lastEnabled = -1;
-	enumerateShownRows([&firstEnabled, &lastEnabled, &index](gsl::not_null<PeerListRow*> row) {
+	enumerateShownRows([&firstEnabled, &lastEnabled, &index](not_null<PeerListRow*> row) {
 		if (!row->disabled()) {
 			if (firstEnabled < 0) {
 				firstEnabled = index;
@@ -1098,7 +1098,7 @@ void PeerListBox::Inner::searchQueryChanged(QString query) {
 	if (_normalizedSearchQuery != normalizedQuery) {
 		setSearchQuery(query, normalizedQuery);
 		if (_controller->searchInLocal() && !searchWordsList.isEmpty()) {
-			auto minimalList = (const std::vector<gsl::not_null<PeerListRow*>>*)nullptr;
+			auto minimalList = (const std::vector<not_null<PeerListRow*>>*)nullptr;
 			for_const (auto &searchWord, searchWordsList) {
 				auto searchWordStart = searchWord[0].toLower();
 				auto it = _searchIndex.find(searchWordStart);
@@ -1202,7 +1202,7 @@ void PeerListBox::Inner::updateSelection() {
 	setSelected(selected);
 }
 
-QRect PeerListBox::Inner::getActionRect(gsl::not_null<PeerListRow*> row, RowIndex index) const {
+QRect PeerListBox::Inner::getActionRect(not_null<PeerListRow*> row, RowIndex index) const {
 	auto actionSize = row->actionSize();
 	if (actionSize.isEmpty()) {
 		return QRect();
@@ -1226,7 +1226,7 @@ int PeerListBox::Inner::getRowTop(RowIndex index) const {
 	return -1;
 }
 
-void PeerListBox::Inner::updateRow(gsl::not_null<PeerListRow*> row, RowIndex hint) {
+void PeerListBox::Inner::updateRow(not_null<PeerListRow*> row, RowIndex hint) {
 	updateRow(findRowIndex(row, hint));
 }
 
@@ -1286,7 +1286,7 @@ PeerListRow *PeerListBox::Inner::getRow(RowIndex index) {
 	return nullptr;
 }
 
-PeerListBox::Inner::RowIndex PeerListBox::Inner::findRowIndex(gsl::not_null<PeerListRow*> row, RowIndex hint) {
+PeerListBox::Inner::RowIndex PeerListBox::Inner::findRowIndex(not_null<PeerListRow*> row, RowIndex hint) {
 	if (!showingSearch()) {
 		t_assert(!row->isSearchResult());
 		return RowIndex(row->absoluteIndex());
diff --git a/Telegram/SourceFiles/boxes/peer_list_box.h b/Telegram/SourceFiles/boxes/peer_list_box.h
index 801106be1d..394ba00889 100644
--- a/Telegram/SourceFiles/boxes/peer_list_box.h
+++ b/Telegram/SourceFiles/boxes/peer_list_box.h
@@ -46,8 +46,8 @@ inline auto PaintUserpicCallback(PeerData *peer) {
 using PeerListRowId = uint64;
 class PeerListRow {
 public:
-	PeerListRow(gsl::not_null<PeerData*> peer);
-	PeerListRow(gsl::not_null<PeerData*> peer, PeerListRowId id);
+	PeerListRow(not_null<PeerData*> peer);
+	PeerListRow(not_null<PeerData*> peer, PeerListRowId id);
 
 	enum class State {
 		Active,
@@ -64,7 +64,7 @@ public:
 	// added to the box it is always false.
 	bool checked() const;
 
-	gsl::not_null<PeerData*> peer() const {
+	not_null<PeerData*> peer() const {
 		return _peer;
 	}
 	PeerListRowId id() const {
@@ -163,7 +163,7 @@ private:
 	void setStatusText(const QString &text);
 
 	PeerListRowId _id = 0;
-	gsl::not_null<PeerData*> _peer;
+	not_null<PeerData*> _peer;
 	std::unique_ptr<Ui::RippleAnimation> _ripple;
 	std::unique_ptr<Ui::RoundImageCheckbox> _checkbox;
 	Text _name;
@@ -193,15 +193,15 @@ public:
 	virtual void peerListSetSearchMode(PeerListSearchMode mode) = 0;
 	virtual void peerListAppendRow(std::unique_ptr<PeerListRow> row) = 0;
 	virtual void peerListAppendSearchRow(std::unique_ptr<PeerListRow> row) = 0;
-	virtual void peerListAppendFoundRow(gsl::not_null<PeerListRow*> row) = 0;
+	virtual void peerListAppendFoundRow(not_null<PeerListRow*> row) = 0;
 	virtual void peerListPrependRow(std::unique_ptr<PeerListRow> row) = 0;
-	virtual void peerListPrependRowFromSearchResult(gsl::not_null<PeerListRow*> row) = 0;
-	virtual void peerListUpdateRow(gsl::not_null<PeerListRow*> row) = 0;
-	virtual void peerListRemoveRow(gsl::not_null<PeerListRow*> row) = 0;
-	virtual void peerListConvertRowToSearchResult(gsl::not_null<PeerListRow*> row) = 0;
-	virtual bool peerListIsRowSelected(gsl::not_null<PeerData*> peer) = 0;
-	virtual void peerListSetRowChecked(gsl::not_null<PeerListRow*> row, bool checked) = 0;
-	virtual gsl::not_null<PeerListRow*> peerListRowAt(int index) = 0;
+	virtual void peerListPrependRowFromSearchResult(not_null<PeerListRow*> row) = 0;
+	virtual void peerListUpdateRow(not_null<PeerListRow*> row) = 0;
+	virtual void peerListRemoveRow(not_null<PeerListRow*> row) = 0;
+	virtual void peerListConvertRowToSearchResult(not_null<PeerListRow*> row) = 0;
+	virtual bool peerListIsRowSelected(not_null<PeerData*> peer) = 0;
+	virtual void peerListSetRowChecked(not_null<PeerListRow*> row, bool checked) = 0;
+	virtual not_null<PeerListRow*> peerListRowAt(int index) = 0;
 	virtual void peerListRefreshRows() = 0;
 	virtual void peerListScrollToTop() = 0;
 	virtual int peerListFullRowsCount() = 0;
@@ -218,18 +218,18 @@ public:
 	}
 
 	virtual int peerListSelectedRowsCount() = 0;
-	virtual std::vector<gsl::not_null<PeerData*>> peerListCollectSelectedRows() = 0;
+	virtual std::vector<not_null<PeerData*>> peerListCollectSelectedRows() = 0;
 	virtual ~PeerListDelegate() = default;
 
 private:
-	virtual void peerListAddSelectedRowInBunch(gsl::not_null<PeerData*> peer) = 0;
+	virtual void peerListAddSelectedRowInBunch(not_null<PeerData*> peer) = 0;
 	virtual void peerListFinishSelectedRowsBunch() = 0;
 
 };
 
 class PeerListSearchDelegate {
 public:
-	virtual void peerListSearchAddRow(gsl::not_null<PeerData*> peer) = 0;
+	virtual void peerListSearchAddRow(not_null<PeerData*> peer) = 0;
 	virtual void peerListSearchRefreshRows() = 0;
 	virtual ~PeerListSearchDelegate() = default;
 
@@ -242,12 +242,12 @@ public:
 	virtual bool loadMoreRows() = 0;
 	virtual ~PeerListSearchController() = default;
 
-	void setDelegate(gsl::not_null<PeerListSearchDelegate*> delegate) {
+	void setDelegate(not_null<PeerListSearchDelegate*> delegate) {
 		_delegate = delegate;
 	}
 
 protected:
-	gsl::not_null<PeerListSearchDelegate*> delegate() const {
+	not_null<PeerListSearchDelegate*> delegate() const {
 		return _delegate;
 	}
 
@@ -261,27 +261,27 @@ public:
 	// Search works only with RowId == peer->id.
 	PeerListController(std::unique_ptr<PeerListSearchController> searchController = nullptr);
 
-	void setDelegate(gsl::not_null<PeerListDelegate*> delegate) {
+	void setDelegate(not_null<PeerListDelegate*> delegate) {
 		_delegate = delegate;
 		prepare();
 	}
 
 	virtual void prepare() = 0;
-	virtual void rowClicked(gsl::not_null<PeerListRow*> row) = 0;
-	virtual void rowActionClicked(gsl::not_null<PeerListRow*> row) {
+	virtual void rowClicked(not_null<PeerListRow*> row) = 0;
+	virtual void rowActionClicked(not_null<PeerListRow*> row) {
 	}
 	virtual void loadMoreRows() {
 	}
-	virtual void itemDeselectedHook(gsl::not_null<PeerData*> peer) {
+	virtual void itemDeselectedHook(not_null<PeerData*> peer) {
 	}
 	bool isSearchLoading() const {
 		return _searchController ? _searchController->isLoading() : false;
 	}
-	virtual std::unique_ptr<PeerListRow> createSearchRow(gsl::not_null<PeerData*> peer) {
+	virtual std::unique_ptr<PeerListRow> createSearchRow(not_null<PeerData*> peer) {
 		return nullptr;
 	}
 
-	bool isRowSelected(gsl::not_null<PeerData*> peer) {
+	bool isRowSelected(not_null<PeerData*> peer) {
 		return delegate()->peerListIsRowSelected(peer);
 	}
 
@@ -291,13 +291,13 @@ public:
 	bool hasComplexSearch() const;
 	void search(const QString &query);
 
-	void peerListSearchAddRow(gsl::not_null<PeerData*> peer) override;
+	void peerListSearchAddRow(not_null<PeerData*> peer) override;
 	void peerListSearchRefreshRows() override;
 
 	virtual ~PeerListController() = default;
 
 protected:
-	gsl::not_null<PeerListDelegate*> delegate() const {
+	not_null<PeerListDelegate*> delegate() const {
 		return _delegate;
 	}
 	PeerListSearchController *searchController() const {
@@ -325,7 +325,7 @@ private:
 
 class PeerListBox : public BoxContent, public PeerListDelegate {
 public:
-	PeerListBox(QWidget*, std::unique_ptr<PeerListController> controller, base::lambda<void(gsl::not_null<PeerListBox*>)> init);
+	PeerListBox(QWidget*, std::unique_ptr<PeerListController> controller, base::lambda<void(not_null<PeerListBox*>)> init);
 
 	void peerListSetTitle(base::lambda<QString()> title) override {
 		setTitle(std::move(title));
@@ -340,17 +340,17 @@ public:
 	void peerListSetSearchMode(PeerListSearchMode mode) override;
 	void peerListAppendRow(std::unique_ptr<PeerListRow> row) override;
 	void peerListAppendSearchRow(std::unique_ptr<PeerListRow> row) override;
-	void peerListAppendFoundRow(gsl::not_null<PeerListRow*> row) override;
+	void peerListAppendFoundRow(not_null<PeerListRow*> row) override;
 	void peerListPrependRow(std::unique_ptr<PeerListRow> row) override;
-	void peerListPrependRowFromSearchResult(gsl::not_null<PeerListRow*> row) override;
-	void peerListUpdateRow(gsl::not_null<PeerListRow*> row) override;
-	void peerListRemoveRow(gsl::not_null<PeerListRow*> row) override;
-	void peerListConvertRowToSearchResult(gsl::not_null<PeerListRow*> row) override;
-	void peerListSetRowChecked(gsl::not_null<PeerListRow*> row, bool checked) override;
-	gsl::not_null<PeerListRow*> peerListRowAt(int index) override;
-	bool peerListIsRowSelected(gsl::not_null<PeerData*> peer) override;
+	void peerListPrependRowFromSearchResult(not_null<PeerListRow*> row) override;
+	void peerListUpdateRow(not_null<PeerListRow*> row) override;
+	void peerListRemoveRow(not_null<PeerListRow*> row) override;
+	void peerListConvertRowToSearchResult(not_null<PeerListRow*> row) override;
+	void peerListSetRowChecked(not_null<PeerListRow*> row, bool checked) override;
+	not_null<PeerListRow*> peerListRowAt(int index) override;
+	bool peerListIsRowSelected(not_null<PeerData*> peer) override;
 	int peerListSelectedRowsCount() override;
-	std::vector<gsl::not_null<PeerData*>> peerListCollectSelectedRows() override;
+	std::vector<not_null<PeerData*>> peerListCollectSelectedRows() override;
 	void peerListRefreshRows() override;
 	void peerListScrollToTop() override;
 	int peerListFullRowsCount() override;
@@ -367,12 +367,12 @@ protected:
 	void paintEvent(QPaintEvent *e) override;
 
 private:
-	void peerListAddSelectedRowInBunch(gsl::not_null<PeerData*> peer) override {
+	void peerListAddSelectedRowInBunch(not_null<PeerData*> peer) override {
 		addSelectItem(peer, PeerListRow::SetStyle::Fast);
 	}
 	void peerListFinishSelectedRowsBunch() override;
 
-	void addSelectItem(gsl::not_null<PeerData*> peer, PeerListRow::SetStyle style);
+	void addSelectItem(not_null<PeerData*> peer, PeerListRow::SetStyle style);
 	void createMultiSelect();
 	int getTopScrollSkip() const;
 	void updateScrollSkips();
@@ -394,7 +394,7 @@ class PeerListBox::Inner : public TWidget, private base::Subscriber {
 	Q_OBJECT
 
 public:
-	Inner(QWidget *parent, gsl::not_null<PeerListController*> controller);
+	Inner(QWidget *parent, not_null<PeerListController*> controller);
 
 	void selectSkip(int direction);
 	void selectSkipPage(int height, int direction);
@@ -409,17 +409,17 @@ public:
 	// Interface for the controller.
 	void appendRow(std::unique_ptr<PeerListRow> row);
 	void appendSearchRow(std::unique_ptr<PeerListRow> row);
-	void appendFoundRow(gsl::not_null<PeerListRow*> row);
+	void appendFoundRow(not_null<PeerListRow*> row);
 	void prependRow(std::unique_ptr<PeerListRow> row);
-	void prependRowFromSearchResult(gsl::not_null<PeerListRow*> row);
+	void prependRowFromSearchResult(not_null<PeerListRow*> row);
 	PeerListRow *findRow(PeerListRowId id);
-	void updateRow(gsl::not_null<PeerListRow*> row) {
+	void updateRow(not_null<PeerListRow*> row) {
 		updateRow(row, RowIndex());
 	}
-	void removeRow(gsl::not_null<PeerListRow*> row);
-	void convertRowToSearchResult(gsl::not_null<PeerListRow*> row);
+	void removeRow(not_null<PeerListRow*> row);
+	void convertRowToSearchResult(not_null<PeerListRow*> row);
 	int fullRowsCount() const;
-	gsl::not_null<PeerListRow*> rowAt(int index) const;
+	not_null<PeerListRow*> rowAt(int index) const;
 	void setDescription(object_ptr<Ui::FlatLabel> description);
 	void setSearchLoading(object_ptr<Ui::FlatLabel> loading);
 	void setSearchNoResults(object_ptr<Ui::FlatLabel> noResults);
@@ -427,7 +427,7 @@ public:
 	void refreshRows();
 
 	void setSearchMode(PeerListSearchMode mode);
-	void changeCheckState(gsl::not_null<PeerListRow*> row, bool checked, PeerListRow::SetStyle style);
+	void changeCheckState(not_null<PeerListRow*> row, bool checked, PeerListRow::SetStyle style);
 
 	template <typename ReorderCallback>
 	void reorderRows(ReorderCallback &&callback) {
@@ -499,19 +499,19 @@ private:
 	void loadProfilePhotos();
 	void checkScrollForPreload();
 
-	void updateRow(gsl::not_null<PeerListRow*> row, RowIndex hint);
+	void updateRow(not_null<PeerListRow*> row, RowIndex hint);
 	void updateRow(RowIndex row);
 	int getRowTop(RowIndex row) const;
 	PeerListRow *getRow(RowIndex element);
-	RowIndex findRowIndex(gsl::not_null<PeerListRow*> row, RowIndex hint = RowIndex());
-	QRect getActionRect(gsl::not_null<PeerListRow*> row, RowIndex index) const;
+	RowIndex findRowIndex(not_null<PeerListRow*> row, RowIndex hint = RowIndex());
+	QRect getActionRect(not_null<PeerListRow*> row, RowIndex index) const;
 
 	void paintRow(Painter &p, TimeMs ms, RowIndex index);
 
-	void addRowEntry(gsl::not_null<PeerListRow*> row);
-	void addToSearchIndex(gsl::not_null<PeerListRow*> row);
+	void addRowEntry(not_null<PeerListRow*> row);
+	void addToSearchIndex(not_null<PeerListRow*> row);
 	bool addingToSearchIndex() const;
-	void removeFromSearchIndex(gsl::not_null<PeerListRow*> row);
+	void removeFromSearchIndex(not_null<PeerListRow*> row);
 	void setSearchQuery(const QString &query, const QString &normalizedQuery);
 	bool showingSearch() const {
 		return !_searchQuery.isEmpty();
@@ -529,7 +529,7 @@ private:
 
 	void clearSearchRows();
 
-	gsl::not_null<PeerListController*> _controller;
+	not_null<PeerListController*> _controller;
 	PeerListSearchMode _searchMode = PeerListSearchMode::Disabled;
 
 	int _rowHeight = 0;
@@ -541,14 +541,14 @@ private:
 	bool _mouseSelection = false;
 
 	std::vector<std::unique_ptr<PeerListRow>> _rows;
-	std::map<PeerListRowId, gsl::not_null<PeerListRow*>> _rowsById;
-	std::map<PeerData*, std::vector<gsl::not_null<PeerListRow*>>> _rowsByPeer;
+	std::map<PeerListRowId, not_null<PeerListRow*>> _rowsById;
+	std::map<PeerData*, std::vector<not_null<PeerListRow*>>> _rowsByPeer;
 
-	std::map<QChar, std::vector<gsl::not_null<PeerListRow*>>> _searchIndex;
+	std::map<QChar, std::vector<not_null<PeerListRow*>>> _searchIndex;
 	QString _searchQuery;
 	QString _normalizedSearchQuery;
 	QString _mentionHighlight;
-	std::vector<gsl::not_null<PeerListRow*>> _filterResults;
+	std::vector<not_null<PeerListRow*>> _filterResults;
 
 	int _aboveHeight = 0;
 	object_ptr<TWidget> _aboveWidget = { nullptr };
diff --git a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp
index 87afeaa5cf..dfc0115f27 100644
--- a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp
+++ b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp
@@ -33,7 +33,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace {
 
-base::flat_set<gsl::not_null<UserData*>> GetAlreadyInFromPeer(PeerData *peer) {
+base::flat_set<not_null<UserData*>> GetAlreadyInFromPeer(PeerData *peer) {
 	if (!peer) {
 		return {};
 	}
@@ -266,11 +266,11 @@ QString ChatsListBoxController::emptyBoxText() const {
 	return lang(lng_contacts_not_found);
 }
 
-std::unique_ptr<PeerListRow> ChatsListBoxController::createSearchRow(gsl::not_null<PeerData*> peer) {
+std::unique_ptr<PeerListRow> ChatsListBoxController::createSearchRow(not_null<PeerData*> peer) {
 	return createRow(App::history(peer));
 }
 
-bool ChatsListBoxController::appendRow(gsl::not_null<History*> history) {
+bool ChatsListBoxController::appendRow(not_null<History*> history) {
 	if (auto row = delegate()->peerListFindRow(history->peer->id)) {
 		updateRowHook(static_cast<Row*>(row));
 		return false;
@@ -328,15 +328,15 @@ void ContactsBoxController::checkForEmptyRows() {
 	}
 }
 
-std::unique_ptr<PeerListRow> ContactsBoxController::createSearchRow(gsl::not_null<PeerData*> peer) {
+std::unique_ptr<PeerListRow> ContactsBoxController::createSearchRow(not_null<PeerData*> peer) {
 	return createRow(peer->asUser());
 }
 
-void ContactsBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void ContactsBoxController::rowClicked(not_null<PeerListRow*> row) {
 	Ui::showPeerHistory(row->peer(), ShowAtUnreadMsgId);
 }
 
-bool ContactsBoxController::appendRow(gsl::not_null<UserData*> user) {
+bool ContactsBoxController::appendRow(not_null<UserData*> user) {
 	if (auto row = delegate()->peerListFindRow(user->id)) {
 		updateRowHook(row);
 		return false;
@@ -348,7 +348,7 @@ bool ContactsBoxController::appendRow(gsl::not_null<UserData*> user) {
 	return false;
 }
 
-std::unique_ptr<PeerListRow> ContactsBoxController::createRow(gsl::not_null<UserData*> user) {
+std::unique_ptr<PeerListRow> ContactsBoxController::createRow(not_null<UserData*> user) {
 	return std::make_unique<PeerListRow>(user);
 }
 
@@ -359,14 +359,14 @@ AddParticipantsBoxController::AddParticipantsBoxController(PeerData *peer)
 }
 
 AddParticipantsBoxController::AddParticipantsBoxController(
-	gsl::not_null<ChannelData*> channel,
-	base::flat_set<gsl::not_null<UserData*>> &&alreadyIn)
+	not_null<ChannelData*> channel,
+	base::flat_set<not_null<UserData*>> &&alreadyIn)
 : ContactsBoxController(std::make_unique<PeerListGlobalSearchController>())
 , _peer(channel)
 , _alreadyIn(std::move(alreadyIn)) {
 }
 
-void AddParticipantsBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void AddParticipantsBoxController::rowClicked(not_null<PeerListRow*> row) {
 	auto count = fullCount();
 	auto limit = (_peer && _peer->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax();
 	if (count < limit || row->checked()) {
@@ -381,7 +381,7 @@ void AddParticipantsBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
 	}
 }
 
-void AddParticipantsBoxController::itemDeselectedHook(gsl::not_null<PeerData*> peer) {
+void AddParticipantsBoxController::itemDeselectedHook(not_null<PeerData*> peer) {
 	updateTitle();
 }
 
@@ -401,7 +401,7 @@ int AddParticipantsBoxController::alreadyInCount() const {
 	Unexpected("User in AddParticipantsBoxController::alreadyInCount");
 }
 
-bool AddParticipantsBoxController::isAlreadyIn(gsl::not_null<UserData*> user) const {
+bool AddParticipantsBoxController::isAlreadyIn(not_null<UserData*> user) const {
 	if (!_peer) {
 		return false;
 	}
@@ -418,7 +418,7 @@ int AddParticipantsBoxController::fullCount() const {
 	return alreadyInCount() + delegate()->peerListSelectedRowsCount();
 }
 
-std::unique_ptr<PeerListRow> AddParticipantsBoxController::createRow(gsl::not_null<UserData*> user) {
+std::unique_ptr<PeerListRow> AddParticipantsBoxController::createRow(not_null<UserData*> user) {
 	if (user->isSelf()) {
 		return nullptr;
 	}
@@ -437,12 +437,12 @@ void AddParticipantsBoxController::updateTitle() {
 	delegate()->peerListSetAdditionalTitle([additional] { return additional; });
 }
 
-void AddParticipantsBoxController::Start(gsl::not_null<ChatData*> chat) {
-	auto initBox = [chat](gsl::not_null<PeerListBox*> box) {
+void AddParticipantsBoxController::Start(not_null<ChatData*> chat) {
+	auto initBox = [chat](not_null<PeerListBox*> box) {
 		box->addButton(langFactory(lng_participant_invite), [box, chat] {
 			auto rows = box->peerListCollectSelectedRows();
 			if (!rows.empty()) {
-				auto users = std::vector<gsl::not_null<UserData*>>();
+				auto users = std::vector<not_null<UserData*>>();
 				for (auto peer : rows) {
 					auto user = peer->asUser();
 					t_assert(user != nullptr);
@@ -459,15 +459,15 @@ void AddParticipantsBoxController::Start(gsl::not_null<ChatData*> chat) {
 }
 
 void AddParticipantsBoxController::Start(
-		gsl::not_null<ChannelData*> channel,
-		base::flat_set<gsl::not_null<UserData*>> &&alreadyIn,
+		not_null<ChannelData*> channel,
+		base::flat_set<not_null<UserData*>> &&alreadyIn,
 		bool justCreated) {
-	auto initBox = [channel, justCreated](gsl::not_null<PeerListBox*> box) {
+	auto initBox = [channel, justCreated](not_null<PeerListBox*> box) {
 		auto subscription = std::make_shared<base::Subscription>();
 		box->addButton(langFactory(lng_participant_invite), [box, channel, subscription] {
 			auto rows = box->peerListCollectSelectedRows();
 			if (!rows.empty()) {
-				auto users = std::vector<gsl::not_null<UserData*>>();
+				auto users = std::vector<not_null<UserData*>>();
 				for (auto peer : rows) {
 					auto user = peer->asUser();
 					t_assert(user != nullptr);
@@ -493,12 +493,12 @@ void AddParticipantsBoxController::Start(
 }
 
 void AddParticipantsBoxController::Start(
-		gsl::not_null<ChannelData*> channel,
-		base::flat_set<gsl::not_null<UserData*>> &&alreadyIn) {
+		not_null<ChannelData*> channel,
+		base::flat_set<not_null<UserData*>> &&alreadyIn) {
 	Start(channel, std::move(alreadyIn), false);
 }
 
-void AddParticipantsBoxController::Start(gsl::not_null<ChannelData*> channel) {
+void AddParticipantsBoxController::Start(not_null<ChannelData*> channel) {
 	Start(channel, {}, true);
 }
 
@@ -548,7 +548,7 @@ void EditChatAdminsBoxController::LabeledCheckbox::paintEvent(QPaintEvent *e) {
 	(checked() ? _labelChecked : _labelUnchecked).draw(p, st::contactsPadding.left(), st::contactsAboutTop, _labelWidth);
 }
 
-EditChatAdminsBoxController::EditChatAdminsBoxController(gsl::not_null<ChatData*> chat)
+EditChatAdminsBoxController::EditChatAdminsBoxController(not_null<ChatData*> chat)
 : PeerListController()
 , _chat(chat) {
 }
@@ -609,7 +609,7 @@ void EditChatAdminsBoxController::rebuildRows() {
 
 	auto allAdmins = allAreAdmins();
 
-	auto admins = std::vector<gsl::not_null<UserData*>>();
+	auto admins = std::vector<not_null<UserData*>>();
 	auto others = admins;
 	admins.reserve(allAdmins ? _chat->participants.size() : _chat->admins.size());
 	others.reserve(_chat->participants.size());
@@ -636,7 +636,7 @@ void EditChatAdminsBoxController::rebuildRows() {
 	std::sort(admins.begin(), admins.end(), sortByName);
 	std::sort(others.begin(), others.end(), sortByName);
 
-	auto addOne = [this](gsl::not_null<UserData*> user) {
+	auto addOne = [this](not_null<UserData*> user) {
 		if (auto row = createRow(user)) {
 			delegate()->peerListAppendRow(std::move(row));
 		}
@@ -652,7 +652,7 @@ void EditChatAdminsBoxController::rebuildRows() {
 	delegate()->peerListRefreshRows();
 }
 
-std::unique_ptr<PeerListRow> EditChatAdminsBoxController::createRow(gsl::not_null<UserData*> user) {
+std::unique_ptr<PeerListRow> EditChatAdminsBoxController::createRow(not_null<UserData*> user) {
 	auto result = std::make_unique<PeerListRow>(user);
 	if (allAreAdmins() || user->id == peerFromUser(_chat->creator)) {
 		result->setDisabledState(PeerListRow::State::DisabledChecked);
@@ -660,17 +660,17 @@ std::unique_ptr<PeerListRow> EditChatAdminsBoxController::createRow(gsl::not_nul
 	return result;
 }
 
-void EditChatAdminsBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void EditChatAdminsBoxController::rowClicked(not_null<PeerListRow*> row) {
 	delegate()->peerListSetRowChecked(row, !row->checked());
 }
 
-void EditChatAdminsBoxController::Start(gsl::not_null<ChatData*> chat) {
+void EditChatAdminsBoxController::Start(not_null<ChatData*> chat) {
 	auto controller = std::make_unique<EditChatAdminsBoxController>(chat);
-	auto initBox = [chat, controller = controller.get()](gsl::not_null<PeerListBox*> box) {
+	auto initBox = [chat, controller = controller.get()](not_null<PeerListBox*> box) {
 		box->addButton(langFactory(lng_settings_save), [box, chat, controller] {
 			auto rows = box->peerListCollectSelectedRows();
 			if (!rows.empty()) {
-				auto users = std::vector<gsl::not_null<UserData*>>();
+				auto users = std::vector<not_null<UserData*>>();
 				for (auto peer : rows) {
 					auto user = peer->asUser();
 					t_assert(user != nullptr);
@@ -686,21 +686,21 @@ void EditChatAdminsBoxController::Start(gsl::not_null<ChatData*> chat) {
 	Ui::show(Box<PeerListBox>(std::move(controller), std::move(initBox)));
 }
 
-void AddBotToGroupBoxController::Start(gsl::not_null<UserData*> bot) {
-	auto initBox = [bot](gsl::not_null<PeerListBox*> box) {
+void AddBotToGroupBoxController::Start(not_null<UserData*> bot) {
+	auto initBox = [bot](not_null<PeerListBox*> box) {
 		box->addButton(langFactory(lng_cancel), [box] { box->closeBox(); });
 	};
 	Ui::show(Box<PeerListBox>(std::make_unique<AddBotToGroupBoxController>(bot), std::move(initBox)));
 }
 
-AddBotToGroupBoxController::AddBotToGroupBoxController(gsl::not_null<UserData*> bot)
+AddBotToGroupBoxController::AddBotToGroupBoxController(not_null<UserData*> bot)
 : ChatsListBoxController(SharingBotGame(bot)
 	? std::make_unique<PeerListGlobalSearchController>()
 	: nullptr)
 , _bot(bot) {
 }
 
-void AddBotToGroupBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void AddBotToGroupBoxController::rowClicked(not_null<PeerListRow*> row) {
 	if (sharingBotGame()) {
 		shareBotGame(row->peer());
 	} else {
@@ -708,7 +708,7 @@ void AddBotToGroupBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
 	}
 }
 
-void AddBotToGroupBoxController::shareBotGame(gsl::not_null<PeerData*> chat) {
+void AddBotToGroupBoxController::shareBotGame(not_null<PeerData*> chat) {
 	auto weak = base::make_weak_unique(this);
 	auto send = [weak, bot = _bot, chat] {
 		if (!weak) {
@@ -746,7 +746,7 @@ void AddBotToGroupBoxController::shareBotGame(gsl::not_null<PeerData*> chat) {
 	Ui::show(Box<ConfirmBox>(confirmText(), send), KeepOtherLayers);
 }
 
-void AddBotToGroupBoxController::addBotToGroup(gsl::not_null<PeerData*> chat) {
+void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
 	if (auto megagroup = chat->asMegagroup()) {
 		if (!megagroup->canAddMembers()) {
 			Ui::show(Box<InformBox>(lang(lng_error_cant_add_member)), KeepOtherLayers);
@@ -788,14 +788,14 @@ void AddBotToGroupBoxController::addBotToGroup(gsl::not_null<PeerData*> chat) {
 	Ui::show(Box<ConfirmBox>(confirmText, send), KeepOtherLayers);
 }
 
-std::unique_ptr<ChatsListBoxController::Row> AddBotToGroupBoxController::createRow(gsl::not_null<History*> history) {
+std::unique_ptr<ChatsListBoxController::Row> AddBotToGroupBoxController::createRow(not_null<History*> history) {
 	if (!needToCreateRow(history->peer)) {
 		return nullptr;
 	}
 	return std::make_unique<Row>(history);
 }
 
-bool AddBotToGroupBoxController::needToCreateRow(gsl::not_null<PeerData*> peer) const {
+bool AddBotToGroupBoxController::needToCreateRow(not_null<PeerData*> peer) const {
 	if (sharingBotGame()) {
 		if (!peer->canWrite()) {
 			return false;
@@ -817,7 +817,7 @@ bool AddBotToGroupBoxController::needToCreateRow(gsl::not_null<PeerData*> peer)
 	return false;
 }
 
-bool AddBotToGroupBoxController::SharingBotGame(gsl::not_null<UserData*> bot) {
+bool AddBotToGroupBoxController::SharingBotGame(not_null<UserData*> bot) {
 	auto &info = bot->botInfo;
 	return (info && !info->shareGameShortName.isEmpty());
 }
diff --git a/Telegram/SourceFiles/boxes/peer_list_controllers.h b/Telegram/SourceFiles/boxes/peer_list_controllers.h
index 17ce6e6d55..de09525809 100644
--- a/Telegram/SourceFiles/boxes/peer_list_controllers.h
+++ b/Telegram/SourceFiles/boxes/peer_list_controllers.h
@@ -88,31 +88,31 @@ public:
 	ChatsListBoxController(std::unique_ptr<PeerListSearchController> searchController = std::make_unique<PeerListGlobalSearchController>());
 
 	void prepare() override final;
-	std::unique_ptr<PeerListRow> createSearchRow(gsl::not_null<PeerData*> peer) override final;
+	std::unique_ptr<PeerListRow> createSearchRow(not_null<PeerData*> peer) override final;
 
 protected:
 	class Row : public PeerListRow {
 	public:
-		Row(gsl::not_null<History*> history) : PeerListRow(history->peer), _history(history) {
+		Row(not_null<History*> history) : PeerListRow(history->peer), _history(history) {
 		}
-		gsl::not_null<History*> history() const {
+		not_null<History*> history() const {
 			return _history;
 		}
 
 	private:
-		gsl::not_null<History*> _history;
+		not_null<History*> _history;
 
 	};
-	virtual std::unique_ptr<Row> createRow(gsl::not_null<History*> history) = 0;
+	virtual std::unique_ptr<Row> createRow(not_null<History*> history) = 0;
 	virtual void prepareViewHook() = 0;
-	virtual void updateRowHook(gsl::not_null<Row*> row) {
+	virtual void updateRowHook(not_null<Row*> row) {
 	}
 	virtual QString emptyBoxText() const;
 
 private:
 	void rebuildRows();
 	void checkForEmptyRows();
-	bool appendRow(gsl::not_null<History*> history);
+	bool appendRow(not_null<History*> history);
 
 };
 
@@ -121,40 +121,40 @@ public:
 	ContactsBoxController(std::unique_ptr<PeerListSearchController> searchController = std::make_unique<PeerListGlobalSearchController>());
 
 	void prepare() override final;
-	std::unique_ptr<PeerListRow> createSearchRow(gsl::not_null<PeerData*> peer) override final;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	std::unique_ptr<PeerListRow> createSearchRow(not_null<PeerData*> peer) override final;
+	void rowClicked(not_null<PeerListRow*> row) override;
 
 protected:
-	virtual std::unique_ptr<PeerListRow> createRow(gsl::not_null<UserData*> user);
+	virtual std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user);
 	virtual void prepareViewHook() {
 	}
-	virtual void updateRowHook(gsl::not_null<PeerListRow*> row) {
+	virtual void updateRowHook(not_null<PeerListRow*> row) {
 	}
 
 private:
 	void rebuildRows();
 	void checkForEmptyRows();
-	bool appendRow(gsl::not_null<UserData*> user);
+	bool appendRow(not_null<UserData*> user);
 
 };
 
 class EditChatAdminsBoxController : public PeerListController, private base::Subscriber {
 public:
-	static void Start(gsl::not_null<ChatData*> chat);
+	static void Start(not_null<ChatData*> chat);
 
-	EditChatAdminsBoxController(gsl::not_null<ChatData*> chat);
+	EditChatAdminsBoxController(not_null<ChatData*> chat);
 
 	bool allAreAdmins() const;
 
 	void prepare() override;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
 
 private:
 	void createAllAdminsCheckbox();
 	void rebuildRows();
-	std::unique_ptr<PeerListRow> createRow(gsl::not_null<UserData*> user);
+	std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user);
 
-	gsl::not_null<ChatData*> _chat;
+	not_null<ChatData*> _chat;
 	int _adminsUpdatedSubscription = 0;
 
 	class LabeledCheckbox;
@@ -164,67 +164,67 @@ private:
 
 class AddParticipantsBoxController : public ContactsBoxController {
 public:
-	static void Start(gsl::not_null<ChatData*> chat);
-	static void Start(gsl::not_null<ChannelData*> channel);
+	static void Start(not_null<ChatData*> chat);
+	static void Start(not_null<ChannelData*> channel);
 	static void Start(
-		gsl::not_null<ChannelData*> channel,
-		base::flat_set<gsl::not_null<UserData*>> &&alreadyIn);
+		not_null<ChannelData*> channel,
+		base::flat_set<not_null<UserData*>> &&alreadyIn);
 
 	AddParticipantsBoxController(PeerData *peer);
 	AddParticipantsBoxController(
-		gsl::not_null<ChannelData*> channel,
-		base::flat_set<gsl::not_null<UserData*>> &&alreadyIn);
+		not_null<ChannelData*> channel,
+		base::flat_set<not_null<UserData*>> &&alreadyIn);
 
 	using ContactsBoxController::ContactsBoxController;
 
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
-	void itemDeselectedHook(gsl::not_null<PeerData*> peer) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
+	void itemDeselectedHook(not_null<PeerData*> peer) override;
 
 protected:
 	void prepareViewHook() override;
-	std::unique_ptr<PeerListRow> createRow(gsl::not_null<UserData*> user) override;
+	std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user) override;
 
 private:
 	static void Start(
-		gsl::not_null<ChannelData*> channel,
-		base::flat_set<gsl::not_null<UserData*>> &&alreadyIn,
+		not_null<ChannelData*> channel,
+		base::flat_set<not_null<UserData*>> &&alreadyIn,
 		bool justCreated);
 
 	int alreadyInCount() const;
-	bool isAlreadyIn(gsl::not_null<UserData*> user) const;
+	bool isAlreadyIn(not_null<UserData*> user) const;
 	int fullCount() const;
 	void updateTitle();
 
 	PeerData *_peer = nullptr;
-	base::flat_set<gsl::not_null<UserData*>> _alreadyIn;
+	base::flat_set<not_null<UserData*>> _alreadyIn;
 
 };
 
 class AddBotToGroupBoxController : public ChatsListBoxController, public base::enable_weak_from_this {
 public:
-	static void Start(gsl::not_null<UserData*> bot);
+	static void Start(not_null<UserData*> bot);
 
-	AddBotToGroupBoxController(gsl::not_null<UserData*> bot);
+	AddBotToGroupBoxController(not_null<UserData*> bot);
 
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
 
 protected:
-	std::unique_ptr<Row> createRow(gsl::not_null<History*> history) override;
+	std::unique_ptr<Row> createRow(not_null<History*> history) override;
 	void prepareViewHook() override;
 	QString emptyBoxText() const override;
 
 private:
-	static bool SharingBotGame(gsl::not_null<UserData*> bot);
+	static bool SharingBotGame(not_null<UserData*> bot);
 
-	bool needToCreateRow(gsl::not_null<PeerData*> peer) const;
+	bool needToCreateRow(not_null<PeerData*> peer) const;
 	bool sharingBotGame() const;
 	QString noResultsText() const;
 	QString descriptionText() const;
 	void updateLabels();
 
-	void shareBotGame(gsl::not_null<PeerData*> chat);
-	void addBotToGroup(gsl::not_null<PeerData*> chat);
+	void shareBotGame(not_null<PeerData*> chat);
+	void addBotToGroup(not_null<PeerData*> chat);
 
-	gsl::not_null<UserData*> _bot;
+	not_null<UserData*> _bot;
 
 };
diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp
index ca408668d4..90c8dfd911 100644
--- a/Telegram/SourceFiles/boxes/stickers_box.cpp
+++ b/Telegram/SourceFiles/boxes/stickers_box.cpp
@@ -156,7 +156,7 @@ StickersBox::StickersBox(QWidget*, const Stickers::Order &archivedIds)
 , _about(st::boxLabelStyle, lang(lng_stickers_packs_archived), _defaultOptions, _aboutWidth) {
 }
 
-StickersBox::StickersBox(QWidget*, gsl::not_null<ChannelData*> megagroup)
+StickersBox::StickersBox(QWidget*, not_null<ChannelData*> megagroup)
 : _section(Section::Installed)
 , _installed(0, this, megagroup)
 , _megagroupSet(megagroup) {
@@ -625,7 +625,7 @@ StickersBox::Inner::Inner(QWidget *parent, const Stickers::Order &archivedIds) :
 	setup();
 }
 
-StickersBox::Inner::Inner(QWidget *parent, gsl::not_null<ChannelData*> megagroup) : TWidget(parent)
+StickersBox::Inner::Inner(QWidget *parent, not_null<ChannelData*> megagroup) : TWidget(parent)
 , _section(StickersBox::Section::Installed)
 , _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
 , _a_shifting(animation(this, &Inner::step_shifting))
diff --git a/Telegram/SourceFiles/boxes/stickers_box.h b/Telegram/SourceFiles/boxes/stickers_box.h
index d2bc48ecdf..ba63e3f358 100644
--- a/Telegram/SourceFiles/boxes/stickers_box.h
+++ b/Telegram/SourceFiles/boxes/stickers_box.h
@@ -49,7 +49,7 @@ public:
 	};
 	StickersBox(QWidget*, Section section);
 	StickersBox(QWidget*, const Stickers::Order &archivedIds);
-	StickersBox(QWidget*, gsl::not_null<ChannelData*> megagroup);
+	StickersBox(QWidget*, not_null<ChannelData*> megagroup);
 
 	void setInnerFocus() override;
 
@@ -154,7 +154,7 @@ public:
 	using Section = StickersBox::Section;
 	Inner(QWidget *parent, Section section);
 	Inner(QWidget *parent, const Stickers::Order &archivedIds);
-	Inner(QWidget *parent, gsl::not_null<ChannelData*> megagroup);
+	Inner(QWidget *parent, not_null<ChannelData*> megagroup);
 
 	base::Observable<int> scrollToY;
 	void setInnerFocus();
diff --git a/Telegram/SourceFiles/calls/calls_box_controller.cpp b/Telegram/SourceFiles/calls/calls_box_controller.cpp
index 8af9d02c31..dca17afd8b 100644
--- a/Telegram/SourceFiles/calls/calls_box_controller.cpp
+++ b/Telegram/SourceFiles/calls/calls_box_controller.cpp
@@ -243,13 +243,13 @@ void BoxController::refreshAbout() {
 	setDescriptionText(delegate()->peerListFullRowsCount() ? QString() : lang(lng_call_box_about));
 }
 
-void BoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void BoxController::rowClicked(not_null<PeerListRow*> row) {
 	auto itemsRow = static_cast<Row*>(row.get());
 	auto itemId = itemsRow->maxItemId();
 	Ui::showPeerHistoryAsync(row->peer()->id, itemId);
 }
 
-void BoxController::rowActionClicked(gsl::not_null<PeerListRow*> row) {
+void BoxController::rowActionClicked(not_null<PeerListRow*> row) {
 	auto user = row->peer()->asUser();
 	t_assert(user != nullptr);
 
diff --git a/Telegram/SourceFiles/calls/calls_box_controller.h b/Telegram/SourceFiles/calls/calls_box_controller.h
index e32c998913..cbaf79d9d7 100644
--- a/Telegram/SourceFiles/calls/calls_box_controller.h
+++ b/Telegram/SourceFiles/calls/calls_box_controller.h
@@ -27,8 +27,8 @@ namespace Calls {
 class BoxController : public PeerListController, private base::Subscriber, private MTP::Sender {
 public:
 	void prepare() override;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
-	void rowActionClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
+	void rowActionClicked(not_null<PeerListRow*> row) override;
 	void loadMoreRows() override;
 
 private:
diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp
index e2a72052a3..84c6642000 100644
--- a/Telegram/SourceFiles/calls/calls_call.cpp
+++ b/Telegram/SourceFiles/calls/calls_call.cpp
@@ -77,7 +77,7 @@ uint64 ComputeFingerprint(const std::array<gsl::byte, kFingerprintDataSize> &aut
 
 } // namespace
 
-Call::Call(gsl::not_null<Delegate*> delegate, gsl::not_null<UserData*> user, Type type)
+Call::Call(not_null<Delegate*> delegate, not_null<UserData*> user, Type type)
 : _delegate(delegate)
 , _user(user)
 , _type(type) {
diff --git a/Telegram/SourceFiles/calls/calls_call.h b/Telegram/SourceFiles/calls/calls_call.h
index e5b8bc30e3..447463b37c 100644
--- a/Telegram/SourceFiles/calls/calls_call.h
+++ b/Telegram/SourceFiles/calls/calls_call.h
@@ -48,9 +48,9 @@ public:
 	class Delegate {
 	public:
 		virtual DhConfig getDhConfig() const = 0;
-		virtual void callFinished(gsl::not_null<Call*> call) = 0;
-		virtual void callFailed(gsl::not_null<Call*> call) = 0;
-		virtual void callRedial(gsl::not_null<Call*> call) = 0;
+		virtual void callFinished(not_null<Call*> call) = 0;
+		virtual void callFailed(not_null<Call*> call) = 0;
+		virtual void callRedial(not_null<Call*> call) = 0;
 
 		enum class Sound {
 			Connecting,
@@ -69,12 +69,12 @@ public:
 		Incoming,
 		Outgoing,
 	};
-	Call(gsl::not_null<Delegate*> delegate, gsl::not_null<UserData*> user, Type type);
+	Call(not_null<Delegate*> delegate, not_null<UserData*> user, Type type);
 
 	Type type() const {
 		return _type;
 	}
-	gsl::not_null<UserData*> user() const {
+	not_null<UserData*> user() const {
 		return _user;
 	}
 	bool isIncomingWaiting() const;
@@ -157,8 +157,8 @@ private:
 	void setFailedQueued(int error);
 	void destroyController();
 
-	gsl::not_null<Delegate*> _delegate;
-	gsl::not_null<UserData*> _user;
+	not_null<Delegate*> _delegate;
+	not_null<UserData*> _user;
 	Type _type = Type::Outgoing;
 	State _state = State::Starting;
 	FinishType _finishAfterRequestingCall = FinishType::None;
diff --git a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp
index ecaab45aec..0c0b0d929e 100644
--- a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp
+++ b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.cpp
@@ -126,7 +126,7 @@ uint64 ComputeEmojiIndex(base::const_byte_span bytes) {
 
 } // namespace
 
-std::vector<EmojiPtr> ComputeEmojiFingerprint(gsl::not_null<Call*> call) {
+std::vector<EmojiPtr> ComputeEmojiFingerprint(not_null<Call*> call) {
 	auto result = std::vector<EmojiPtr>();
 	constexpr auto EmojiCount = (base::array_size(Offsets) - 1);
 	for (auto index = 0; index != EmojiCount; ++index) {
diff --git a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.h b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.h
index cb432a911d..9fe4c7279d 100644
--- a/Telegram/SourceFiles/calls/calls_emoji_fingerprint.h
+++ b/Telegram/SourceFiles/calls/calls_emoji_fingerprint.h
@@ -24,6 +24,6 @@ namespace Calls {
 
 class Call;
 
-std::vector<EmojiPtr> ComputeEmojiFingerprint(gsl::not_null<Call*> call);
+std::vector<EmojiPtr> ComputeEmojiFingerprint(not_null<Call*> call);
 
 } // namespace Calls
diff --git a/Telegram/SourceFiles/calls/calls_instance.cpp b/Telegram/SourceFiles/calls/calls_instance.cpp
index 7275897f7f..9bb9447f8f 100644
--- a/Telegram/SourceFiles/calls/calls_instance.cpp
+++ b/Telegram/SourceFiles/calls/calls_instance.cpp
@@ -40,7 +40,7 @@ constexpr auto kServerConfigUpdateTimeoutMs = 24 * 3600 * TimeMs(1000);
 
 Instance::Instance() = default;
 
-void Instance::startOutgoingCall(gsl::not_null<UserData*> user) {
+void Instance::startOutgoingCall(not_null<UserData*> user) {
 	if (alreadyInCall()) { // Already in a call.
 		_currentCallPanel->showAndActivate();
 		return;
@@ -54,15 +54,15 @@ void Instance::startOutgoingCall(gsl::not_null<UserData*> user) {
 	createCall(user, Call::Type::Outgoing);
 }
 
-void Instance::callFinished(gsl::not_null<Call*> call) {
+void Instance::callFinished(not_null<Call*> call) {
 	destroyCall(call);
 }
 
-void Instance::callFailed(gsl::not_null<Call*> call) {
+void Instance::callFailed(not_null<Call*> call) {
 	destroyCall(call);
 }
 
-void Instance::callRedial(gsl::not_null<Call*> call) {
+void Instance::callRedial(not_null<Call*> call) {
 	if (_currentCall.get() == call) {
 		refreshDhConfig();
 	}
@@ -96,7 +96,7 @@ void Instance::playSound(Sound sound) {
 	}
 }
 
-void Instance::destroyCall(gsl::not_null<Call*> call) {
+void Instance::destroyCall(not_null<Call*> call) {
 	if (_currentCall.get() == call) {
 		destroyCurrentPanel();
 		_currentCall.reset();
@@ -117,7 +117,7 @@ void Instance::destroyCurrentPanel() {
 	_pendingPanels.back()->hideAndDestroy(); // Always queues the destruction.
 }
 
-void Instance::createCall(gsl::not_null<UserData*> user, Call::Type type) {
+void Instance::createCall(not_null<UserData*> user, Call::Type type) {
 	auto call = std::make_unique<Call>(getCallDelegate(), user, type);;
 	if (_currentCall) {
 		_currentCallPanel->replaceCall(call.get());
@@ -246,7 +246,7 @@ void Instance::handleUpdate(const MTPDupdatePhoneCall& update) {
 	handleCallUpdate(update.vphone_call);
 }
 
-void Instance::showInfoPanel(gsl::not_null<Call*> call) {
+void Instance::showInfoPanel(not_null<Call*> call) {
 	if (_currentCall.get() == call) {
 		_currentCallPanel->showAndActivate();
 	}
diff --git a/Telegram/SourceFiles/calls/calls_instance.h b/Telegram/SourceFiles/calls/calls_instance.h
index 914dbdb4cd..89c8c71630 100644
--- a/Telegram/SourceFiles/calls/calls_instance.h
+++ b/Telegram/SourceFiles/calls/calls_instance.h
@@ -37,9 +37,9 @@ class Instance : private MTP::Sender, private Call::Delegate, private base::Subs
 public:
 	Instance();
 
-	void startOutgoingCall(gsl::not_null<UserData*> user);
+	void startOutgoingCall(not_null<UserData*> user);
 	void handleUpdate(const MTPDupdatePhoneCall &update);
-	void showInfoPanel(gsl::not_null<Call*> call);
+	void showInfoPanel(not_null<Call*> call);
 
 	base::Observable<Call*> &currentCallChanged() {
 		return _currentCallChanged;
@@ -54,19 +54,19 @@ public:
 	~Instance();
 
 private:
-	gsl::not_null<Call::Delegate*> getCallDelegate() {
+	not_null<Call::Delegate*> getCallDelegate() {
 		return static_cast<Call::Delegate*>(this);
 	}
 	DhConfig getDhConfig() const override {
 		return _dhConfig;
 	}
-	void callFinished(gsl::not_null<Call*> call) override;
-	void callFailed(gsl::not_null<Call*> call) override;
-	void callRedial(gsl::not_null<Call*> call) override;
+	void callFinished(not_null<Call*> call) override;
+	void callFailed(not_null<Call*> call) override;
+	void callRedial(not_null<Call*> call) override;
 	using Sound = Call::Delegate::Sound;
 	void playSound(Sound sound) override;
-	void createCall(gsl::not_null<UserData*> user, Call::Type type);
-	void destroyCall(gsl::not_null<Call*> call);
+	void createCall(not_null<UserData*> user, Call::Type type);
+	void destroyCall(not_null<Call*> call);
 	void destroyCurrentPanel();
 
 	void refreshDhConfig();
diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp
index ea0f85f5d4..c13facca06 100644
--- a/Telegram/SourceFiles/calls/calls_panel.cpp
+++ b/Telegram/SourceFiles/calls/calls_panel.cpp
@@ -61,10 +61,10 @@ protected:
 	QPoint prepareRippleStartPosition() const override;
 
 private:
-	QPoint iconPosition(gsl::not_null<const style::CallButton*> st) const;
+	QPoint iconPosition(not_null<const style::CallButton*> st) const;
 	void mixIconMasks();
 
-	gsl::not_null<const style::CallButton*> _stFrom;
+	not_null<const style::CallButton*> _stFrom;
 	const style::CallButton *_stTo = nullptr;
 	float64 _progress = 0.;
 
@@ -192,7 +192,7 @@ void Panel::Button::paintEvent(QPaintEvent *e) {
 	}
 }
 
-QPoint Panel::Button::iconPosition(gsl::not_null<const style::CallButton*> st) const {
+QPoint Panel::Button::iconPosition(not_null<const style::CallButton*> st) const {
 	auto result = st->button.iconPosition;
 	if (result.x() < 0) {
 		result.setX((width() - st->button.icon.width()) / 2);
@@ -240,7 +240,7 @@ QImage Panel::Button::prepareRippleMask() const {
 	return Ui::RippleAnimation::ellipseMask(QSize(_stFrom->button.rippleAreaSize, _stFrom->button.rippleAreaSize));
 }
 
-Panel::Panel(gsl::not_null<Call*> call)
+Panel::Panel(not_null<Call*> call)
 : _call(call)
 , _user(call->user())
 , _answerHangupRedial(this, st::callAnswer, &st::callHangup)
@@ -264,7 +264,7 @@ void Panel::showAndActivate() {
 	setFocus();
 }
 
-void Panel::replaceCall(gsl::not_null<Call*> call) {
+void Panel::replaceCall(not_null<Call*> call) {
 	_call = call;
 	_user = call->user();
 	reinitControls();
diff --git a/Telegram/SourceFiles/calls/calls_panel.h b/Telegram/SourceFiles/calls/calls_panel.h
index 5b7a525412..c101ee38b7 100644
--- a/Telegram/SourceFiles/calls/calls_panel.h
+++ b/Telegram/SourceFiles/calls/calls_panel.h
@@ -36,10 +36,10 @@ namespace Calls {
 
 class Panel : public TWidget, private base::Subscriber, private Ui::AbstractTooltipShower {
 public:
-	Panel(gsl::not_null<Call*> call);
+	Panel(not_null<Call*> call);
 
 	void showAndActivate();
-	void replaceCall(gsl::not_null<Call*> call);
+	void replaceCall(not_null<Call*> call);
 	void hideAndDestroy();
 
 protected:
@@ -89,7 +89,7 @@ private:
 	void destroyDelayed();
 
 	Call *_call = nullptr;
-	gsl::not_null<UserData*> _user;
+	not_null<UserData*> _user;
 
 	bool _useTransparency = true;
 	style::margins _padding;
diff --git a/Telegram/SourceFiles/chat_helpers/bot_keyboard.cpp b/Telegram/SourceFiles/chat_helpers/bot_keyboard.cpp
index a64c200427..e933ba2b33 100644
--- a/Telegram/SourceFiles/chat_helpers/bot_keyboard.cpp
+++ b/Telegram/SourceFiles/chat_helpers/bot_keyboard.cpp
@@ -52,7 +52,7 @@ const style::TextStyle &BotKeyboard::Style::textStyle() const {
 	return st::botKbStyle;
 }
 
-void BotKeyboard::Style::repaint(gsl::not_null<const HistoryItem*> item) const {
+void BotKeyboard::Style::repaint(not_null<const HistoryItem*> item) const {
 	_parent->update();
 }
 
diff --git a/Telegram/SourceFiles/chat_helpers/bot_keyboard.h b/Telegram/SourceFiles/chat_helpers/bot_keyboard.h
index 519dd2323d..a307318251 100644
--- a/Telegram/SourceFiles/chat_helpers/bot_keyboard.h
+++ b/Telegram/SourceFiles/chat_helpers/bot_keyboard.h
@@ -92,7 +92,7 @@ private:
 
 		void startPaint(Painter &p) const override;
 		const style::TextStyle &textStyle() const override;
-		void repaint(gsl::not_null<const HistoryItem*> item) const override;
+		void repaint(not_null<const HistoryItem*> item) const override;
 
 	protected:
 		void paintButtonBg(Painter &p, const QRect &rect, float64 howMuchOver) const override;
diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp
index 7daefb071d..1c41a9cb3d 100644
--- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp
+++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp
@@ -35,7 +35,7 @@ constexpr auto kEmojiPanelRowsPerPage = Ui::Emoji::kPanelRowsPerPage;
 
 class EmojiListWidget::Footer : public TabbedSelector::InnerFooter {
 public:
-	Footer(gsl::not_null<EmojiListWidget*> parent);
+	Footer(not_null<EmojiListWidget*> parent);
 
 	void setCurrentSectionIcon(Section section);
 
@@ -46,12 +46,12 @@ private:
 	void prepareSection(int &left, int top, int _width, Ui::IconButton *sectionIcon, Section section);
 	void setActiveSection(Section section);
 
-	gsl::not_null<EmojiListWidget*> _pan;
+	not_null<EmojiListWidget*> _pan;
 	std::array<object_ptr<Ui::IconButton>, kEmojiSectionCount> _sections;
 
 };
 
-EmojiListWidget::Footer::Footer(gsl::not_null<EmojiListWidget*> parent) : InnerFooter(parent)
+EmojiListWidget::Footer::Footer(not_null<EmojiListWidget*> parent) : InnerFooter(parent)
 , _pan(parent)
 , _sections { {
 	object_ptr<Ui::IconButton>(this, st::emojiCategoryRecent),
@@ -302,7 +302,7 @@ void EmojiColorPicker::drawVariant(Painter &p, int variant) {
 	p.drawPixmapLeft(w.x() + (st::emojiPanSize.width() - (esize / cIntRetinaFactor())) / 2, w.y() + (st::emojiPanSize.height() - (esize / cIntRetinaFactor())) / 2, width(), App::emojiLarge(), QRect(_variants[variant]->x() * esize, _variants[variant]->y() * esize, esize, esize));
 }
 
-EmojiListWidget::EmojiListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Inner(parent, controller)
+EmojiListWidget::EmojiListWidget(QWidget *parent, not_null<Window::Controller*> controller) : Inner(parent, controller)
 , _picker(this) {
 	resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, countHeight());
 
diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.h b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.h
index 2e6f67df6e..42dcd7843e 100644
--- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.h
+++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.h
@@ -88,7 +88,7 @@ class EmojiListWidget : public TabbedSelector::Inner {
 	Q_OBJECT
 
 public:
-	EmojiListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	EmojiListWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	using Section = Ui::Emoji::Section;
 
diff --git a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp
index d6ea9012a4..38c99436aa 100644
--- a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp
+++ b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp
@@ -37,14 +37,14 @@ constexpr auto kRowLimit = 5;
 
 class SuggestionsWidget::Row {
 public:
-	Row(gsl::not_null<EmojiPtr> emoji, const QString &label, const QString &replacement);
+	Row(not_null<EmojiPtr> emoji, const QString &label, const QString &replacement);
 	Row(const Row &other) = delete;
 	Row &operator=(const Row &other) = delete;
 	Row(Row &&other) = default;
 	Row &operator=(Row &&other) = default;
 	~Row();
 
-	gsl::not_null<EmojiPtr> emoji() const {
+	not_null<EmojiPtr> emoji() const {
 		return _emoji;
 	}
 	const QString &label() const {
@@ -64,14 +64,14 @@ public:
 	}
 
 private:
-	gsl::not_null<EmojiPtr> _emoji;
+	not_null<EmojiPtr> _emoji;
 	QString _label;
 	QString _replacement;
 	std::unique_ptr<RippleAnimation> _ripple;
 
 };
 
-SuggestionsWidget::Row::Row(gsl::not_null<EmojiPtr> emoji, const QString &label, const QString &replacement)
+SuggestionsWidget::Row::Row(not_null<EmojiPtr> emoji, const QString &label, const QString &replacement)
 : _emoji(emoji)
 , _label(label)
 , _replacement(replacement) {
@@ -359,7 +359,7 @@ void SuggestionsWidget::leaveEventHook(QEvent *e) {
 	return TWidget::leaveEventHook(e);
 }
 
-SuggestionsController::SuggestionsController(QWidget *parent, gsl::not_null<QTextEdit*> field) : QObject(nullptr)
+SuggestionsController::SuggestionsController(QWidget *parent, not_null<QTextEdit*> field) : QObject(nullptr)
 , _field(field)
 , _container(parent, st::emojiSuggestionsDropdown)
 , _suggestions(_container->setOwnedWidget(object_ptr<Ui::Emoji::SuggestionsWidget>(parent, st::emojiSuggestionsMenu))) {
diff --git a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.h b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.h
index 0dd53f6710..5fce90a306 100644
--- a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.h
+++ b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.h
@@ -65,7 +65,7 @@ private:
 	void triggerSelectedRow();
 	void triggerRow(const Row &row);
 
-	gsl::not_null<const style::Menu*> _st;
+	not_null<const style::Menu*> _st;
 
 	QString _query;
 	std::vector<Row> _rows;
@@ -79,7 +79,7 @@ private:
 
 class SuggestionsController : public QObject, private base::Subscriber {
 public:
-	SuggestionsController(QWidget *parent, gsl::not_null<QTextEdit*> field);
+	SuggestionsController(QWidget *parent, not_null<QTextEdit*> field);
 
 	void raise();
 
diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp
index 113cb6984f..5e91e0bb19 100644
--- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp
+++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp
@@ -45,7 +45,7 @@ constexpr auto kSearchBotUsername = str_const("gif");
 
 class GifsListWidget::Footer : public TabbedSelector::InnerFooter {
 public:
-	Footer(gsl::not_null<GifsListWidget*> parent);
+	Footer(not_null<GifsListWidget*> parent);
 
 	void stealFocus();
 	void returnFocus();
@@ -59,7 +59,7 @@ protected:
 	void processPanelHideFinished() override;
 
 private:
-	gsl::not_null<GifsListWidget*> _pan;
+	not_null<GifsListWidget*> _pan;
 
 	object_ptr<Ui::InputField> _field;
 	object_ptr<Ui::CrossButton> _cancel;
@@ -68,7 +68,7 @@ private:
 
 };
 
-GifsListWidget::Footer::Footer(gsl::not_null<GifsListWidget*> parent) : InnerFooter(parent)
+GifsListWidget::Footer::Footer(not_null<GifsListWidget*> parent) : InnerFooter(parent)
 , _pan(parent)
 , _field(this, st::gifsSearchField, langFactory(lng_gifs_search))
 , _cancel(this, st::gifsSearchCancel) {
@@ -120,7 +120,7 @@ void GifsListWidget::Footer::processPanelHideFinished() {
 	//_field->setText(QString());
 }
 
-GifsListWidget::GifsListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Inner(parent, controller)
+GifsListWidget::GifsListWidget(QWidget *parent, not_null<Window::Controller*> controller) : Inner(parent, controller)
 , _section(Section::Gifs) {
 	resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, countHeight());
 
diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.h b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.h
index e1d6e1c7aa..6dfa4b3d85 100644
--- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.h
+++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.h
@@ -44,7 +44,7 @@ class GifsListWidget : public TabbedSelector::Inner, public InlineBots::Layout::
 	Q_OBJECT
 
 public:
-	GifsListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	GifsListWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void refreshRecent() override;
 	void preloadImages() override;
diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp
index f5e05f1e03..5a03876d67 100644
--- a/Telegram/SourceFiles/chat_helpers/message_field.cpp
+++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp
@@ -111,7 +111,7 @@ std::unique_ptr<QMimeData> MimeDataFromTextWithEntities(const TextWithEntities &
 	return result;
 }
 
-MessageField::MessageField(QWidget *parent, gsl::not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory, const QString &val) : Ui::FlatTextarea(parent, st, std::move(placeholderFactory), val)
+MessageField::MessageField(QWidget *parent, not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory, const QString &val) : Ui::FlatTextarea(parent, st, std::move(placeholderFactory), val)
 , _controller(controller) {
 	setMinHeight(st::historySendSize.height() - 2 * st::historySendPadding);
 	setMaxHeight(st::historyComposeFieldMaxHeight);
diff --git a/Telegram/SourceFiles/chat_helpers/message_field.h b/Telegram/SourceFiles/chat_helpers/message_field.h
index 88cee7f9d5..3b983a91c3 100644
--- a/Telegram/SourceFiles/chat_helpers/message_field.h
+++ b/Telegram/SourceFiles/chat_helpers/message_field.h
@@ -37,7 +37,7 @@ class MessageField final : public Ui::FlatTextarea {
 	Q_OBJECT
 
 public:
-	MessageField(QWidget *parent, gsl::not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory = base::lambda<QString()>(), const QString &val = QString());
+	MessageField(QWidget *parent, not_null<Window::Controller*> controller, const style::FlatTextarea &st, base::lambda<QString()> placeholderFactory = base::lambda<QString()>(), const QString &val = QString());
 
 	bool hasSendText() const;
 
@@ -58,7 +58,7 @@ protected:
 	void insertFromMimeData(const QMimeData *source) override;
 
 private:
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 	base::lambda<bool(const QMimeData *data)> _insertFromMimeDataHook;
 
 };
diff --git a/Telegram/SourceFiles/chat_helpers/stickers.cpp b/Telegram/SourceFiles/chat_helpers/stickers.cpp
index ef796ed3c7..d3043ff854 100644
--- a/Telegram/SourceFiles/chat_helpers/stickers.cpp
+++ b/Telegram/SourceFiles/chat_helpers/stickers.cpp
@@ -183,7 +183,7 @@ void MarkFeaturedAsRead(uint64 setId) {
 	FeaturedReaderInstance->scheduleRead(setId);
 }
 
-bool IsFaved(gsl::not_null<DocumentData*> document) {
+bool IsFaved(not_null<DocumentData*> document) {
 	auto it = Global::StickerSets().constFind(FavedSetId);
 	return (it != Global::StickerSets().cend()) && it->stickers.contains(document);
 }
@@ -209,8 +209,8 @@ void CheckFavedLimit(Set &set) {
 
 void PushFavedToFront(
 		Set &set,
-		gsl::not_null<DocumentData*> document,
-		const std::vector<gsl::not_null<EmojiPtr>> &emojiList) {
+		not_null<DocumentData*> document,
+		const std::vector<not_null<EmojiPtr>> &emojiList) {
 	set.stickers.push_front(document);
 	for (auto emoji : emojiList) {
 		set.emoji[emoji].push_front(document);
@@ -236,9 +236,9 @@ void MoveFavedToFront(Set &set, int index) {
 	}
 }
 
-void RequestSetToPushFaved(gsl::not_null<DocumentData*> document);
+void RequestSetToPushFaved(not_null<DocumentData*> document);
 
-void SetIsFaved(gsl::not_null<DocumentData*> document, base::optional<std::vector<gsl::not_null<EmojiPtr>>> emojiList = base::none) {
+void SetIsFaved(not_null<DocumentData*> document, base::optional<std::vector<not_null<EmojiPtr>>> emojiList = base::none) {
 	auto &sets = Global::RefStickerSets();
 	auto it = sets.find(FavedSetId);
 	if (it == sets.end()) {
@@ -263,8 +263,8 @@ void SetIsFaved(gsl::not_null<DocumentData*> document, base::optional<std::vecto
 	App::main()->onStickersInstalled(FavedSetId);
 }
 
-void RequestSetToPushFaved(gsl::not_null<DocumentData*> document) {
-	auto addAnyway = [document](std::vector<gsl::not_null<EmojiPtr>> list) {
+void RequestSetToPushFaved(not_null<DocumentData*> document) {
+	auto addAnyway = [document](std::vector<not_null<EmojiPtr>> list) {
 		if (list.empty()) {
 			if (auto sticker = document->sticker()) {
 				if (auto emoji = Ui::Emoji::Find(sticker->alt)) {
@@ -276,7 +276,7 @@ void RequestSetToPushFaved(gsl::not_null<DocumentData*> document) {
 	};
 	MTP::send(MTPmessages_GetStickerSet(document->sticker()->set), rpcDone([document, addAnyway](const MTPmessages_StickerSet &result) {
 		Expects(result.type() == mtpc_messages_stickerSet);
-		auto list = std::vector<gsl::not_null<EmojiPtr>>();
+		auto list = std::vector<not_null<EmojiPtr>>();
 		auto &d = result.c_messages_stickerSet();
 		list.reserve(d.vpacks.v.size());
 		for_const (auto &mtpPack, d.vpacks.v) {
@@ -301,7 +301,7 @@ void RequestSetToPushFaved(gsl::not_null<DocumentData*> document) {
 	}));
 }
 
-void SetIsNotFaved(gsl::not_null<DocumentData*> document) {
+void SetIsNotFaved(not_null<DocumentData*> document) {
 	auto &sets = Global::RefStickerSets();
 	auto it = sets.find(FavedSetId);
 	if (it == sets.end()) {
@@ -330,7 +330,7 @@ void SetIsNotFaved(gsl::not_null<DocumentData*> document) {
 	Auth().data().stickersUpdated().notify(true);
 }
 
-void SetFaved(gsl::not_null<DocumentData*> document, bool faved) {
+void SetFaved(not_null<DocumentData*> document, bool faved) {
 	if (faved) {
 		SetIsFaved(document);
 	} else {
@@ -629,7 +629,7 @@ void GifsReceived(const QVector<MTPDocument> &items, int32 hash) {
 	Auth().data().savedGifsUpdated().notify();
 }
 
-StickerPack GetListByEmoji(gsl::not_null<EmojiPtr> emoji) {
+StickerPack GetListByEmoji(not_null<EmojiPtr> emoji) {
 	auto original = emoji->original();
 	auto result = StickerPack();
 	auto setsToRequest = QMap<uint64, uint64>();
@@ -673,8 +673,8 @@ StickerPack GetListByEmoji(gsl::not_null<EmojiPtr> emoji) {
 	return result;
 }
 
-base::optional<std::vector<gsl::not_null<EmojiPtr>>> GetEmojiListFromSet(
-		gsl::not_null<DocumentData*> document) {
+base::optional<std::vector<not_null<EmojiPtr>>> GetEmojiListFromSet(
+		not_null<DocumentData*> document) {
 	if (auto sticker = document->sticker()) {
 		auto &inputSet = sticker->set;
 		if (inputSet.type() != mtpc_inputStickerSetID) {
@@ -685,7 +685,7 @@ base::optional<std::vector<gsl::not_null<EmojiPtr>>> GetEmojiListFromSet(
 		if (it == sets.cend()) {
 			return base::none;
 		}
-		auto result = std::vector<gsl::not_null<EmojiPtr>>();
+		auto result = std::vector<not_null<EmojiPtr>>();
 		for (auto i = it->emoji.cbegin(), e = it->emoji.cend(); i != e; ++i) {
 			if (i->contains(document)) {
 				result.push_back(i.key());
diff --git a/Telegram/SourceFiles/chat_helpers/stickers.h b/Telegram/SourceFiles/chat_helpers/stickers.h
index 22d5bf357a..4d9b737c0b 100644
--- a/Telegram/SourceFiles/chat_helpers/stickers.h
+++ b/Telegram/SourceFiles/chat_helpers/stickers.h
@@ -31,17 +31,17 @@ bool ApplyArchivedResultFake(); // For testing.
 void InstallLocally(uint64 setId);
 void UndoInstallLocally(uint64 setId);
 void MarkFeaturedAsRead(uint64 setId);
-bool IsFaved(gsl::not_null<DocumentData*> document);
-void SetFaved(gsl::not_null<DocumentData*> document, bool faved);
+bool IsFaved(not_null<DocumentData*> document);
+void SetFaved(not_null<DocumentData*> document, bool faved);
 
 void SetsReceived(const QVector<MTPStickerSet> &data, int32 hash);
 void SpecialSetReceived(uint64 setId, const QString &setTitle, const QVector<MTPDocument> &items, int32 hash, const QVector<MTPStickerPack> &packs = QVector<MTPStickerPack>());
 void FeaturedSetsReceived(const QVector<MTPStickerSetCovered> &data, const QVector<MTPlong> &unread, int32 hash);
 void GifsReceived(const QVector<MTPDocument> &items, int32 hash);
 
-StickerPack GetListByEmoji(gsl::not_null<EmojiPtr> emoji);
-base::optional<std::vector<gsl::not_null<EmojiPtr>>> GetEmojiListFromSet(
-	gsl::not_null<DocumentData*> document);
+StickerPack GetListByEmoji(not_null<EmojiPtr> emoji);
+base::optional<std::vector<not_null<EmojiPtr>>> GetEmojiListFromSet(
+	not_null<DocumentData*> document);
 
 Set *FeedSet(const MTPDstickerSet &data);
 Set *FeedSetFull(const MTPmessages_StickerSet &data);
diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp
index 7f175cea07..6b8650feab 100644
--- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp
+++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp
@@ -60,7 +60,7 @@ struct StickerIcon {
 
 class StickersListWidget::Footer : public TabbedSelector::InnerFooter, private base::Subscriber {
 public:
-	Footer(gsl::not_null<StickersListWidget*> parent);
+	Footer(not_null<StickersListWidget*> parent);
 
 	void preloadImages();
 	void validateSelectedIcon(uint64 setId, ValidateIconAnimations animations);
@@ -88,7 +88,7 @@ private:
 	void paintStickerSettingsIcon(Painter &p) const;
 	void paintFeaturedStickerSetsBadge(Painter &p, int iconLeft) const;
 
-	gsl::not_null<StickersListWidget*> _pan;
+	not_null<StickersListWidget*> _pan;
 
 	static constexpr auto kVisibleIconsCount = 8;
 
@@ -111,7 +111,7 @@ private:
 
 };
 
-StickersListWidget::Footer::Footer(gsl::not_null<StickersListWidget*> parent) : InnerFooter(parent)
+StickersListWidget::Footer::Footer(not_null<StickersListWidget*> parent) : InnerFooter(parent)
 , _pan(parent)
 , _a_icons(animation(this, &Footer::step_icons)) {
 	setMouseTracking(true);
@@ -434,7 +434,7 @@ void StickersListWidget::Footer::step_icons(TimeMs ms, bool timer) {
 	}
 }
 
-StickersListWidget::StickersListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Inner(parent, controller)
+StickersListWidget::StickersListWidget(QWidget *parent, not_null<Window::Controller*> controller) : Inner(parent, controller)
 , _section(Section::Stickers)
 , _megagroupSetAbout(st::emojiPanWidth - st::emojiScroll.width - st::emojiPanHeaderLeft)
 , _addText(lang(lng_stickers_featured_add).toUpper())
diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h
index c92ab2cb8d..4b27588e10 100644
--- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h
+++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h
@@ -39,7 +39,7 @@ class StickersListWidget : public TabbedSelector::Inner, private base::Subscribe
 	Q_OBJECT
 
 public:
-	StickersListWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	StickersListWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void refreshRecent() override;
 	void preloadImages() override;
diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp
index a18c2818c5..84b8118f85 100644
--- a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp
+++ b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp
@@ -34,10 +34,10 @@ constexpr auto kDelayedHideTimeoutMs = 3000;
 
 } // namespace
 
-TabbedPanel::TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TabbedPanel(parent, controller, object_ptr<TabbedSelector>(nullptr, controller)) {
+TabbedPanel::TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller) : TabbedPanel(parent, controller, object_ptr<TabbedSelector>(nullptr, controller)) {
 }
 
-TabbedPanel::TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : TWidget(parent)
+TabbedPanel::TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : TWidget(parent)
 , _controller(controller)
 , _selector(std::move(selector)) {
 	_selector->setParent(this);
diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_panel.h b/Telegram/SourceFiles/chat_helpers/tabbed_panel.h
index fcbfa57226..32438d3022 100644
--- a/Telegram/SourceFiles/chat_helpers/tabbed_panel.h
+++ b/Telegram/SourceFiles/chat_helpers/tabbed_panel.h
@@ -39,8 +39,8 @@ class TabbedPanel : public TWidget {
 	Q_OBJECT
 
 public:
-	TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller);
-	TabbedPanel(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
+	TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller);
+	TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
 
 	object_ptr<TabbedSelector> takeSelector();
 	QPointer<TabbedSelector> getSelector() const;
@@ -106,7 +106,7 @@ private:
 	bool preventAutoHide() const;
 	void updateContentHeight();
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 	object_ptr<TabbedSelector> _selector;
 
 	int _contentMaxHeight = 0;
diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp
index bdf839b47d..5826c1ab2d 100644
--- a/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp
+++ b/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp
@@ -25,10 +25,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace ChatHelpers {
 
-TabbedSection::TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TabbedSection(parent, controller, object_ptr<TabbedSelector>(this, controller)) {
+TabbedSection::TabbedSection(QWidget *parent, not_null<Window::Controller*> controller) : TabbedSection(parent, controller, object_ptr<TabbedSelector>(this, controller)) {
 }
 
-TabbedSection::TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : Window::AbstractSectionWidget(parent, controller)
+TabbedSection::TabbedSection(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector) : Window::AbstractSectionWidget(parent, controller)
 , _selector(std::move(selector)) {
 	resize(st::emojiPanWidth, st::emojiPanMaxHeight);
 
diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_section.h b/Telegram/SourceFiles/chat_helpers/tabbed_section.h
index 2b78cbda2f..b155fe88bc 100644
--- a/Telegram/SourceFiles/chat_helpers/tabbed_section.h
+++ b/Telegram/SourceFiles/chat_helpers/tabbed_section.h
@@ -28,8 +28,8 @@ class TabbedSelector;
 
 class TabbedSection : public Window::AbstractSectionWidget {
 public:
-	TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller);
-	TabbedSection(QWidget *parent, gsl::not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
+	TabbedSection(QWidget *parent, not_null<Window::Controller*> controller);
+	TabbedSection(QWidget *parent, not_null<Window::Controller*> controller, object_ptr<TabbedSelector> selector);
 
 	void beforeHiding();
 	void afterShown();
diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp
index df119ddfff..81d1873e2a 100644
--- a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp
+++ b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp
@@ -285,7 +285,7 @@ void TabbedSelector::Tab::saveScrollTop() {
 	_scrollTop = widget()->getVisibleTop();
 }
 
-TabbedSelector::TabbedSelector(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
+TabbedSelector::TabbedSelector(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
 , _tabsSlider(this, st::emojiTabs)
 , _topShadow(this, st::shadowFg)
 , _bottomShadow(this, st::shadowFg)
@@ -669,15 +669,15 @@ void TabbedSelector::switchTab() {
 	Auth().saveDataDelayed(kSaveChosenTabTimeout);
 }
 
-gsl::not_null<EmojiListWidget*> TabbedSelector::emoji() const {
+not_null<EmojiListWidget*> TabbedSelector::emoji() const {
 	return static_cast<EmojiListWidget*>(getTab(SelectorTab::Emoji)->widget().get());
 }
 
-gsl::not_null<StickersListWidget*> TabbedSelector::stickers() const {
+not_null<StickersListWidget*> TabbedSelector::stickers() const {
 	return static_cast<StickersListWidget*>(getTab(SelectorTab::Stickers)->widget().get());
 }
 
-gsl::not_null<GifsListWidget*> TabbedSelector::gifs() const {
+not_null<GifsListWidget*> TabbedSelector::gifs() const {
 	return static_cast<GifsListWidget*>(getTab(SelectorTab::Gifs)->widget().get());
 }
 
@@ -697,7 +697,7 @@ void TabbedSelector::scrollToY(int y) {
 	_topShadow->update();
 }
 
-TabbedSelector::Inner::Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
+TabbedSelector::Inner::Inner(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
 , _controller(controller) {
 }
 
diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_selector.h b/Telegram/SourceFiles/chat_helpers/tabbed_selector.h
index d773eacec9..b03d6d2f40 100644
--- a/Telegram/SourceFiles/chat_helpers/tabbed_selector.h
+++ b/Telegram/SourceFiles/chat_helpers/tabbed_selector.h
@@ -56,7 +56,7 @@ class TabbedSelector : public TWidget, private base::Subscriber {
 	Q_OBJECT
 
 public:
-	TabbedSelector(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	TabbedSelector(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void setRoundRadius(int radius);
 	void refreshStickers();
@@ -123,10 +123,10 @@ private:
 		SelectorTab type() const {
 			return _type;
 		}
-		gsl::not_null<Inner*> widget() const {
+		not_null<Inner*> widget() const {
 			return _weak;
 		}
-		gsl::not_null<InnerFooter*> footer() const {
+		not_null<InnerFooter*> footer() const {
 			return _footer;
 		}
 
@@ -164,21 +164,21 @@ private:
 	void setWidgetToScrollArea();
 	void createTabsSlider();
 	void switchTab();
-	gsl::not_null<Tab*> getTab(SelectorTab type) {
+	not_null<Tab*> getTab(SelectorTab type) {
 		return &_tabs[static_cast<int>(type)];
 	}
-	gsl::not_null<const Tab*> getTab(SelectorTab type) const {
+	not_null<const Tab*> getTab(SelectorTab type) const {
 		return &_tabs[static_cast<int>(type)];
 	}
-	gsl::not_null<Tab*> currentTab() {
+	not_null<Tab*> currentTab() {
 		return getTab(_currentTabType);
 	}
-	gsl::not_null<const Tab*> currentTab() const {
+	not_null<const Tab*> currentTab() const {
 		return getTab(_currentTabType);
 	}
-	gsl::not_null<EmojiListWidget*> emoji() const;
-	gsl::not_null<StickersListWidget*> stickers() const;
-	gsl::not_null<GifsListWidget*> gifs() const;
+	not_null<EmojiListWidget*> emoji() const;
+	not_null<StickersListWidget*> stickers() const;
+	not_null<GifsListWidget*> gifs() const;
 
 	int _roundRadius = 0;
 	int _footerTop = 0;
@@ -205,7 +205,7 @@ class TabbedSelector::Inner : public TWidget {
 	Q_OBJECT
 
 public:
-	Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	Inner(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void setVisibleTopBottom(int visibleTop, int visibleBottom) override;
 
@@ -235,7 +235,7 @@ signals:
 	void disableScroll(bool disabled);
 
 protected:
-	gsl::not_null<Window::Controller*> controller() const {
+	not_null<Window::Controller*> controller() const {
 		return _controller;
 	}
 
@@ -247,7 +247,7 @@ protected:
 	}
 
 private:
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 	int _visibleTop = 0;
 	int _visibleBottom = 0;
diff --git a/Telegram/SourceFiles/core/basic_types.h b/Telegram/SourceFiles/core/basic_types.h
index 859672224c..fa4f93f8f9 100644
--- a/Telegram/SourceFiles/core/basic_types.h
+++ b/Telegram/SourceFiles/core/basic_types.h
@@ -27,6 +27,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 #include "base/build_config.h"
 
+template <typename Type>
+using not_null = gsl::not_null<Type>;
+
 // Custom libc++ build used for old OS X versions already has this.
 #ifndef OS_MAC_OLD
 
diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h
index a214a8b784..3c729513d2 100644
--- a/Telegram/SourceFiles/core/utils.h
+++ b/Telegram/SourceFiles/core/utils.h
@@ -415,7 +415,7 @@ inline void memsetrnd_bad(T &value) {
 
 class ReadLockerAttempt {
 public:
-	ReadLockerAttempt(gsl::not_null<QReadWriteLock*> lock) : _lock(lock), _locked(_lock->tryLockForRead()) {
+	ReadLockerAttempt(not_null<QReadWriteLock*> lock) : _lock(lock), _locked(_lock->tryLockForRead()) {
 	}
 	ReadLockerAttempt(const ReadLockerAttempt &other) = delete;
 	ReadLockerAttempt &operator=(const ReadLockerAttempt &other) = delete;
@@ -437,7 +437,7 @@ public:
 	}
 
 private:
-	gsl::not_null<QReadWriteLock*> _lock;
+	not_null<QReadWriteLock*> _lock;
 	bool _locked = false;
 
 };
diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
index bbde3305cc..46ec6f733d 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
+++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
@@ -65,7 +65,7 @@ struct DialogsInner::PeerSearchResult {
 	Dialogs::RippleRow row;
 };
 
-DialogsInner::DialogsInner(QWidget *parent, gsl::not_null<Window::Controller*> controller, QWidget *main) : SplittedWidget(parent)
+DialogsInner::DialogsInner(QWidget *parent, not_null<Window::Controller*> controller, QWidget *main) : SplittedWidget(parent)
 , _controller(controller)
 , _dialogs(std::make_unique<Dialogs::IndexedList>(Dialogs::SortMode::Date))
 , _contactsNoDialogs(std::make_unique<Dialogs::IndexedList>(Dialogs::SortMode::Name))
@@ -464,7 +464,7 @@ void DialogsInner::paintSearchInPeer(Painter &p, int fullWidth, bool onlyBackgro
 	}
 }
 
-void DialogsInner::paintSearchInFilter(Painter &p, gsl::not_null<PeerData*> peer, int top, int fullWidth, const Text &text) const {
+void DialogsInner::paintSearchInFilter(Painter &p, not_null<PeerData*> peer, int top, int fullWidth, const Text &text) const {
 	auto pen = p.pen();
 	peer->paintUserpicLeft(p, st::dialogsPadding.x(), top + (st::dialogsSearchInHeight - st::dialogsSearchInPhotoSize) / 2, getFullWidth(), st::dialogsSearchInPhotoSize);
 
@@ -1264,7 +1264,7 @@ void DialogsInner::onParentGeometryChanged() {
 	}
 }
 
-void DialogsInner::handlePeerNameChange(gsl::not_null<PeerData*> peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars) {
+void DialogsInner::handlePeerNameChange(not_null<PeerData*> peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars) {
 	_dialogs->peerNameChanged(Dialogs::Mode::All, peer, oldNames, oldChars);
 	if (_dialogsImportant) {
 		_dialogsImportant->peerNameChanged(Dialogs::Mode::Important, peer, oldNames, oldChars);
diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h
index b15cab9eb8..962a1e8905 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h
+++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h
@@ -42,7 +42,7 @@ class DialogsInner : public Ui::SplittedWidget, public RPCSender, private base::
 	Q_OBJECT
 
 public:
-	DialogsInner(QWidget *parent, gsl::not_null<Window::Controller*> controller, QWidget *main);
+	DialogsInner(QWidget *parent, not_null<Window::Controller*> controller, QWidget *main);
 
 	void dialogsReceived(const QVector<MTPDialog> &dialogs);
 	void addSavedPeersAfter(const QDateTime &date);
@@ -170,7 +170,7 @@ private:
 	bool isSelected() const {
 		return _importantSwitchSelected || _selected || (_hashtagSelected >= 0) || (_filteredSelected >= 0) || (_peerSearchSelected >= 0) || (_searchedSelected >= 0);
 	}
-	void handlePeerNameChange(gsl::not_null<PeerData*> peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars);
+	void handlePeerNameChange(not_null<PeerData*> peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars);
 
 	void itemRemoved(HistoryItem *item);
 	enum class UpdateRowSection {
@@ -193,7 +193,7 @@ private:
 	void paintDialog(Painter &p, Dialogs::Row *row, int fullWidth, PeerData *active, PeerData *selected, bool onlyBackground, TimeMs ms);
 	void paintPeerSearchResult(Painter &p, const PeerSearchResult *result, int fullWidth, bool active, bool selected, bool onlyBackground, TimeMs ms) const;
 	void paintSearchInPeer(Painter &p, int fullWidth, bool onlyBackground, TimeMs ms) const;
-	void paintSearchInFilter(Painter &p, gsl::not_null<PeerData*> peer, int top, int fullWidth, const Text &text) const;
+	void paintSearchInFilter(Painter &p, not_null<PeerData*> peer, int top, int fullWidth, const Text &text) const;
 
 	void clearSelection();
 	void clearSearchResults(bool clearPeerSearchResults = true);
@@ -213,7 +213,7 @@ private:
 	void savePinnedOrder();
 	void step_pinnedShifting(TimeMs ms, bool timer);
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 	DialogsList _dialogs;
 	DialogsList _dialogsImportant;
diff --git a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp
index a82382d575..43d0e38d12 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp
+++ b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp
@@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace Dialogs {
 
-void ShowSearchFromBox(PeerData *peer, base::lambda<void(gsl::not_null<UserData*>)> callback, base::lambda<void()> closedCallback) {
+void ShowSearchFromBox(PeerData *peer, base::lambda<void(not_null<UserData*>)> callback, base::lambda<void()> closedCallback) {
 	auto createController = [peer, callback = std::move(callback)]() -> std::unique_ptr<PeerListController> {
 		if (peer) {
 			if (auto chat = peer->asChat()) {
@@ -40,14 +40,14 @@ void ShowSearchFromBox(PeerData *peer, base::lambda<void(gsl::not_null<UserData*
 	};
 	if (auto controller = createController()) {
 		auto subscription = std::make_shared<base::Subscription>();
-		auto box = Ui::show(Box<PeerListBox>(std::move(controller), [subscription](gsl::not_null<PeerListBox*> box) {
+		auto box = Ui::show(Box<PeerListBox>(std::move(controller), [subscription](not_null<PeerListBox*> box) {
 			box->addButton(langFactory(lng_cancel), [box, subscription] { box->closeBox(); });
 		}), KeepOtherLayers);
 		*subscription = box->boxClosing.add_subscription(std::move(closedCallback));
 	}
 }
 
-ChatSearchFromController::ChatSearchFromController(gsl::not_null<ChatData*> chat, base::lambda<void(gsl::not_null<UserData*>)> callback) : PeerListController()
+ChatSearchFromController::ChatSearchFromController(not_null<ChatData*> chat, base::lambda<void(not_null<UserData*>)> callback) : PeerListController()
 , _chat(chat)
 , _callback(std::move(callback)) {
 }
@@ -66,7 +66,7 @@ void ChatSearchFromController::prepare() {
 	}));
 }
 
-void ChatSearchFromController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void ChatSearchFromController::rowClicked(not_null<PeerListRow*> row) {
 	Expects(row->peer()->isUser());
 	_callback(row->peer()->asUser());
 }
@@ -109,13 +109,13 @@ void ChatSearchFromController::checkForEmptyRows() {
 	}
 }
 
-void ChatSearchFromController::appendRow(gsl::not_null<UserData*> user) {
+void ChatSearchFromController::appendRow(not_null<UserData*> user) {
 	if (!delegate()->peerListFindRow(user->id)) {
 		delegate()->peerListAppendRow(std::make_unique<PeerListRow>(user));
 	}
 }
 
-ChannelSearchFromController::ChannelSearchFromController(gsl::not_null<ChannelData*> channel, base::lambda<void(gsl::not_null<UserData*>)> callback) : ParticipantsBoxController(channel, ParticipantsBoxController::Role::Members)
+ChannelSearchFromController::ChannelSearchFromController(not_null<ChannelData*> channel, base::lambda<void(not_null<UserData*>)> callback) : ParticipantsBoxController(channel, ParticipantsBoxController::Role::Members)
 , _callback(std::move(callback)) {
 }
 
@@ -124,12 +124,12 @@ void ChannelSearchFromController::prepare() {
 	delegate()->peerListSetTitle(langFactory(lng_search_messages_from));
 }
 
-void ChannelSearchFromController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void ChannelSearchFromController::rowClicked(not_null<PeerListRow*> row) {
 	Expects(row->peer()->isUser());
 	_callback(row->peer()->asUser());
 }
 
-std::unique_ptr<PeerListRow> ChannelSearchFromController::createRow(gsl::not_null<UserData*> user) const {
+std::unique_ptr<PeerListRow> ChannelSearchFromController::createRow(not_null<UserData*> user) const {
 	return std::make_unique<PeerListRow>(user);
 }
 
diff --git a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h
index febcaac883..bebccb5e01 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h
+++ b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h
@@ -25,37 +25,37 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace Dialogs {
 
-void ShowSearchFromBox(PeerData *peer, base::lambda<void(gsl::not_null<UserData*>)> callback, base::lambda<void()> closedCallback);
+void ShowSearchFromBox(PeerData *peer, base::lambda<void(not_null<UserData*>)> callback, base::lambda<void()> closedCallback);
 
 class ChatSearchFromController : public PeerListController, protected base::Subscriber {
 public:
-	ChatSearchFromController(gsl::not_null<ChatData*> chat, base::lambda<void(gsl::not_null<UserData*>)> callback);
+	ChatSearchFromController(not_null<ChatData*> chat, base::lambda<void(not_null<UserData*>)> callback);
 
 	void prepare() override;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
 
 private:
 	void rebuildRows();
 	void checkForEmptyRows();
-	void appendRow(gsl::not_null<UserData*> user);
+	void appendRow(not_null<UserData*> user);
 
-	gsl::not_null<ChatData*> _chat;
-	base::lambda<void(gsl::not_null<UserData*>)> _callback;
+	not_null<ChatData*> _chat;
+	base::lambda<void(not_null<UserData*>)> _callback;
 
 };
 
 class ChannelSearchFromController : public Profile::ParticipantsBoxController {
 public:
-	ChannelSearchFromController(gsl::not_null<ChannelData*> channel, base::lambda<void(gsl::not_null<UserData*>)> callback);
+	ChannelSearchFromController(not_null<ChannelData*> channel, base::lambda<void(not_null<UserData*>)> callback);
 
 	void prepare() override;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
 
 protected:
-	std::unique_ptr<PeerListRow> createRow(gsl::not_null<UserData*> user) const override;
+	std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user) const override;
 
 private:
-	base::lambda<void(gsl::not_null<UserData*>)> _callback;
+	base::lambda<void(not_null<UserData*>)> _callback;
 
 };
 
diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp
index 4730107b98..f9d017ebcd 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp
+++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp
@@ -91,7 +91,7 @@ void DialogsWidget::UpdateButton::paintEvent(QPaintEvent *e) {
 	}
 }
 
-DialogsWidget::DialogsWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Window::AbstractSectionWidget(parent, controller)
+DialogsWidget::DialogsWidget(QWidget *parent, not_null<Window::Controller*> controller) : Window::AbstractSectionWidget(parent, controller)
 , _mainMenuToggle(this, st::dialogsMenuToggle)
 , _filter(this, st::dialogsFilter, langFactory(lng_dlg_filter))
 , _chooseFromUser(this, object_ptr<Ui::IconButton>(this, st::dialogsSearchFrom))
@@ -870,7 +870,7 @@ void DialogsWidget::clearSearchCache() {
 
 void DialogsWidget::showSearchFrom() {
 	auto peer = _searchInPeer;
-	Dialogs::ShowSearchFromBox(peer, base::lambda_guarded(this, [this, peer](gsl::not_null<UserData*> user) {
+	Dialogs::ShowSearchFromBox(peer, base::lambda_guarded(this, [this, peer](not_null<UserData*> user) {
 		Ui::hideLayer();
 		setSearchInPeer(peer, user);
 		onFilterUpdate(true);
diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.h b/Telegram/SourceFiles/dialogs/dialogs_widget.h
index bfb188b01a..1f0b27a916 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_widget.h
+++ b/Telegram/SourceFiles/dialogs/dialogs_widget.h
@@ -59,7 +59,7 @@ class DialogsWidget : public Window::AbstractSectionWidget, public RPCSender {
 	Q_OBJECT
 
 public:
-	DialogsWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	DialogsWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void updateDragInScroll(bool inScroll);
 
diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp
index ae66c1806f..76e0080717 100644
--- a/Telegram/SourceFiles/facades.cpp
+++ b/Telegram/SourceFiles/facades.cpp
@@ -241,7 +241,7 @@ bool isLayerShown() {
 	return false;
 }
 
-void repaintHistoryItem(gsl::not_null<const HistoryItem*> item) {
+void repaintHistoryItem(not_null<const HistoryItem*> item) {
 	if (auto main = App::main()) {
 		main->ui_repaintHistoryItem(item);
 	}
diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h
index 6959df99f6..287dd7dba9 100644
--- a/Telegram/SourceFiles/facades.h
+++ b/Telegram/SourceFiles/facades.h
@@ -104,7 +104,7 @@ void hideLayer(bool fast = false);
 void hideSettingsAndLayer(bool fast = false);
 bool isLayerShown();
 
-void repaintHistoryItem(gsl::not_null<const HistoryItem*> item);
+void repaintHistoryItem(not_null<const HistoryItem*> item);
 void autoplayMediaInlineAsync(const FullMsgId &msgId);
 
 void showPeerProfile(const PeerId &peer);
diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp
index 19609499aa..60053989f4 100644
--- a/Telegram/SourceFiles/history/history.cpp
+++ b/Telegram/SourceFiles/history/history.cpp
@@ -764,7 +764,7 @@ void Histories::savePinnedToServer() const {
 	MTP::send(MTPmessages_ReorderPinnedDialogs(MTP_flags(flags), MTP_vector(peers)));
 }
 
-void Histories::selfDestructIn(gsl::not_null<HistoryItem*> item, TimeMs delay) {
+void Histories::selfDestructIn(not_null<HistoryItem*> item, TimeMs delay) {
 	_selfDestructItems.push_back(item->fullId());
 	if (!_selfDestructTimer.isActive() || _selfDestructTimer.remainingTime() > delay) {
 		_selfDestructTimer.callOnce(delay);
@@ -1257,7 +1257,7 @@ HistoryItem *History::addNewItem(HistoryItem *adding, bool newMsg) {
 	adding->addToOverview(AddToOverviewNew);
 	if (adding->from()->id) {
 		if (auto user = adding->from()->asUser()) {
-			auto getLastAuthors = [this]() -> QList<gsl::not_null<UserData*>>* {
+			auto getLastAuthors = [this]() -> QList<not_null<UserData*>>* {
 				if (auto chat = peer->asChat()) {
 					return &chat->lastAuthors;
 				} else if (auto channel = peer->asMegagroup()) {
@@ -1291,7 +1291,7 @@ HistoryItem *History::addNewItem(HistoryItem *adding, bool newMsg) {
 		if (adding->definesReplyKeyboard()) {
 			auto markupFlags = adding->replyKeyboardFlags();
 			if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || adding->mentionsMe()) {
-				auto getMarkupSenders = [this]() -> OrderedSet<gsl::not_null<PeerData*>>* {
+				auto getMarkupSenders = [this]() -> OrderedSet<not_null<PeerData*>>* {
 					if (auto chat = peer->asChat()) {
 						return &chat->markupSenders;
 					} else if (auto channel = peer->asMegagroup()) {
@@ -1444,8 +1444,8 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice) {
 	} else if (loadedAtBottom()) { // add photos to overview and authors to lastAuthors
 		bool channel = isChannel();
 		int32 mask = 0;
-		QList<gsl::not_null<UserData*>> *lastAuthors = nullptr;
-		OrderedSet<gsl::not_null<PeerData*>> *markupSenders = nullptr;
+		QList<not_null<UserData*>> *lastAuthors = nullptr;
+		OrderedSet<not_null<PeerData*>> *markupSenders = nullptr;
 		if (peer->isChat()) {
 			lastAuthors = &peer->asChat()->lastAuthors;
 			markupSenders = &peer->asChat()->markupSenders;
diff --git a/Telegram/SourceFiles/history/history.h b/Telegram/SourceFiles/history/history.h
index e38a38ca80..0c0b56aaba 100644
--- a/Telegram/SourceFiles/history/history.h
+++ b/Telegram/SourceFiles/history/history.h
@@ -31,7 +31,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 void HistoryInit();
 
 class HistoryItem;
-using SelectedItemSet = QMap<int, gsl::not_null<HistoryItem*>>;
+using SelectedItemSet = QMap<int, not_null<HistoryItem*>>;
 
 enum NewMessageType {
 	NewMessageUnread,
@@ -99,7 +99,7 @@ public:
 	base::Observable<SendActionAnimationUpdate> &sendActionAnimationUpdated() {
 		return _sendActionAnimationUpdated;
 	}
-	void selfDestructIn(gsl::not_null<HistoryItem*> item, TimeMs delay);
+	void selfDestructIn(not_null<HistoryItem*> item, TimeMs delay);
 
 private:
 	void checkSelfDestructItems();
@@ -646,7 +646,7 @@ private:
 
 class HistoryBlock {
 public:
-	HistoryBlock(gsl::not_null<History*> history) : _history(history) {
+	HistoryBlock(not_null<History*> history) : _history(history) {
 	}
 
 	HistoryBlock(const HistoryBlock &) = delete;
@@ -670,7 +670,7 @@ public:
 	int height() const {
 		return _height;
 	}
-	gsl::not_null<History*> history() const {
+	not_null<History*> history() const {
 		return _history;
 	}
 
@@ -696,7 +696,7 @@ public:
 	}
 
 protected:
-	const gsl::not_null<History*> _history;
+	const not_null<History*> _history;
 
 	int _y = 0;
 	int _height = 0;
diff --git a/Telegram/SourceFiles/history/history_admin_log_filter.cpp b/Telegram/SourceFiles/history/history_admin_log_filter.cpp
index 02759901ad..c27f8daec0 100644
--- a/Telegram/SourceFiles/history/history_admin_log_filter.cpp
+++ b/Telegram/SourceFiles/history/history_admin_log_filter.cpp
@@ -30,7 +30,7 @@ namespace {
 
 class UserCheckbox : public Ui::RippleButton {
 public:
-	UserCheckbox(QWidget *parent, gsl::not_null<UserData*> user, bool checked);
+	UserCheckbox(QWidget *parent, not_null<UserData*> user, bool checked);
 
 	bool checked() const {
 		return _check->checked();
@@ -63,13 +63,13 @@ private:
 
 	QRect _checkRect;
 
-	gsl::not_null<UserData*> _user;
+	not_null<UserData*> _user;
 	QString _statusText;
 	bool _statusOnline = false;
 
 };
 
-UserCheckbox::UserCheckbox(QWidget *parent, gsl::not_null<UserData*> user, bool checked) : Ui::RippleButton(parent, st::defaultBoxCheckbox.ripple)
+UserCheckbox::UserCheckbox(QWidget *parent, not_null<UserData*> user, bool checked) : Ui::RippleButton(parent, st::defaultBoxCheckbox.ripple)
 , _st(st::adminLogFilterUserCheckbox)
 , _check(std::make_unique<Ui::CheckView>(st::defaultCheck, checked, [this] { rtlupdate(_checkRect); }))
 , _user(user) {
@@ -146,7 +146,7 @@ QPoint UserCheckbox::prepareRippleStartPosition() const {
 
 class FilterBox::Inner : public TWidget, private base::Subscriber {
 public:
-	Inner(QWidget *parent, gsl::not_null<ChannelData*> channel, const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void()> changedCallback);
+	Inner(QWidget *parent, not_null<ChannelData*> channel, const std::vector<not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void()> changedCallback);
 
 	template <typename Widget>
 	QPointer<Widget> addRow(object_ptr<Widget> widget, int marginTop) {
@@ -167,19 +167,19 @@ protected:
 	void resizeEvent(QResizeEvent *e) override;
 
 private:
-	void createControls(const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter);
+	void createControls(const std::vector<not_null<UserData*>> &admins, const FilterValue &filter);
 	void createAllActionsCheckbox(const FilterValue &filter);
 	void createActionsCheckboxes(const FilterValue &filter);
 	void createAllUsersCheckbox(const FilterValue &filter);
-	void createAdminsCheckboxes(const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter);
+	void createAdminsCheckboxes(const std::vector<not_null<UserData*>> &admins, const FilterValue &filter);
 
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 
 	QPointer<Ui::Checkbox> _allFlags;
 	QMap<MTPDchannelAdminLogEventsFilter::Flags, QPointer<Ui::Checkbox>> _filterFlags;
 
 	QPointer<Ui::Checkbox> _allUsers;
-	QMap<gsl::not_null<UserData*>, QPointer<UserCheckbox>> _admins;
+	QMap<not_null<UserData*>, QPointer<UserCheckbox>> _admins;
 	bool _restoringInvariant = false;
 
 	struct Row {
@@ -192,13 +192,13 @@ private:
 
 };
 
-FilterBox::Inner::Inner(QWidget *parent, gsl::not_null<ChannelData*> channel, const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void()> changedCallback) : TWidget(parent)
+FilterBox::Inner::Inner(QWidget *parent, not_null<ChannelData*> channel, const std::vector<not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void()> changedCallback) : TWidget(parent)
 , _channel(channel)
 , _changedCallback(std::move(changedCallback)) {
 	createControls(admins, filter);
 }
 
-void FilterBox::Inner::createControls(const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter) {
+void FilterBox::Inner::createControls(const std::vector<not_null<UserData*>> &admins, const FilterValue &filter) {
 	createAllActionsCheckbox(filter);
 	createActionsCheckboxes(filter);
 	createAllUsersCheckbox(filter);
@@ -276,7 +276,7 @@ void FilterBox::Inner::createAllUsersCheckbox(const FilterValue &filter) {
 	});
 }
 
-void FilterBox::Inner::createAdminsCheckboxes(const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter) {
+void FilterBox::Inner::createAdminsCheckboxes(const std::vector<not_null<UserData*>> &admins, const FilterValue &filter) {
 	for (auto user : admins) {
 		auto checked = filter.allUsers || base::contains(filter.admins, user);
 		auto checkbox = addRow(object_ptr<UserCheckbox>(this, user, checked), st::adminLogFilterLittleSkip);
@@ -356,7 +356,7 @@ void FilterBox::Inner::resizeEvent(QResizeEvent *e) {
 	}
 }
 
-FilterBox::FilterBox(QWidget*, gsl::not_null<ChannelData*> channel, const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void(FilterValue &&filter)> saveCallback) : BoxContent()
+FilterBox::FilterBox(QWidget*, not_null<ChannelData*> channel, const std::vector<not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void(FilterValue &&filter)> saveCallback) : BoxContent()
 , _channel(channel)
 , _admins(admins)
 , _initialFilter(filter)
diff --git a/Telegram/SourceFiles/history/history_admin_log_filter.h b/Telegram/SourceFiles/history/history_admin_log_filter.h
index 6c89a537f5..b79a0d839e 100644
--- a/Telegram/SourceFiles/history/history_admin_log_filter.h
+++ b/Telegram/SourceFiles/history/history_admin_log_filter.h
@@ -27,7 +27,7 @@ namespace AdminLog {
 
 class FilterBox : public BoxContent {
 public:
-	FilterBox(QWidget*, gsl::not_null<ChannelData*> channel, const std::vector<gsl::not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void(FilterValue &&filter)> saveCallback);
+	FilterBox(QWidget*, not_null<ChannelData*> channel, const std::vector<not_null<UserData*>> &admins, const FilterValue &filter, base::lambda<void(FilterValue &&filter)> saveCallback);
 
 protected:
 	void prepare() override;
@@ -36,8 +36,8 @@ private:
 	void resizeToContent();
 	void refreshButtons();
 
-	gsl::not_null<ChannelData*> _channel;
-	std::vector<gsl::not_null<UserData*>> _admins;
+	not_null<ChannelData*> _channel;
+	std::vector<not_null<UserData*>> _admins;
 	FilterValue _initialFilter;
 	base::lambda<void(FilterValue &&filter)> _saveCallback;
 
diff --git a/Telegram/SourceFiles/history/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/history_admin_log_inner.cpp
index 6011b84440..bd714042a2 100644
--- a/Telegram/SourceFiles/history/history_admin_log_inner.cpp
+++ b/Telegram/SourceFiles/history/history_admin_log_inner.cpp
@@ -205,7 +205,7 @@ void InnerWidget::enumerateDates(Method method) {
 	enumerateItems<EnumItemsDirection::BottomToTop>(dateCallback);
 }
 
-InnerWidget::InnerWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, gsl::not_null<ChannelData*> channel) : TWidget(parent)
+InnerWidget::InnerWidget(QWidget *parent, not_null<Window::Controller*> controller, not_null<ChannelData*> channel) : TWidget(parent)
 , _controller(controller)
 , _channel(channel)
 , _history(App::history(channel))
@@ -213,7 +213,7 @@ InnerWidget::InnerWidget(QWidget *parent, gsl::not_null<Window::Controller*> con
 , _emptyText(st::historyAdminLogEmptyWidth - st::historyAdminLogEmptyPadding.left() - st::historyAdminLogEmptyPadding.left()) {
 	setMouseTracking(true);
 	_scrollDateHideTimer.setCallback([this] { scrollDateHideByTimer(); });
-	subscribe(Auth().data().repaintLogEntry(), [this](gsl::not_null<const HistoryItem*> historyItem) {
+	subscribe(Auth().data().repaintLogEntry(), [this](not_null<const HistoryItem*> historyItem) {
 		if (_history == historyItem->history()) {
 			repaintItem(historyItem);
 		}
@@ -421,7 +421,7 @@ QPoint InnerWidget::tooltipPos() const {
 	return _mousePosition;
 }
 
-void InnerWidget::saveState(gsl::not_null<SectionMemento*> memento) {
+void InnerWidget::saveState(not_null<SectionMemento*> memento) {
 	memento->setFilter(std::move(_filter));
 	memento->setAdmins(std::move(_admins));
 	memento->setAdminsCanEdit(std::move(_adminsCanEdit));
@@ -433,7 +433,7 @@ void InnerWidget::saveState(gsl::not_null<SectionMemento*> memento) {
 	_upLoaded = _downLoaded = true; // Don't load or handle anything anymore.
 }
 
-void InnerWidget::restoreState(gsl::not_null<SectionMemento*> memento) {
+void InnerWidget::restoreState(not_null<SectionMemento*> memento) {
 	_items = memento->takeItems();
 	_itemsByIds = memento->takeItemsByIds();
 	_idManager = memento->takeIdManager();
@@ -635,7 +635,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
 			}
 			p.translate(0, -top);
 
-			enumerateUserpics([&p, &clip](gsl::not_null<HistoryMessage*> message, int userpicTop) {
+			enumerateUserpics([&p, &clip](not_null<HistoryMessage*> message, int userpicTop) {
 				// stop the enumeration if the userpic is below the painted rect
 				if (userpicTop >= clip.top() + clip.height()) {
 					return false;
@@ -650,7 +650,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
 
 			auto dateHeight = st::msgServicePadding.bottom() + st::msgServiceFont->height + st::msgServicePadding.top();
 			auto scrollDateOpacity = _scrollDateOpacity.current(ms, _scrollDateShown ? 1. : 0.);
-			enumerateDates([&p, &clip, scrollDateOpacity, dateHeight/*, lastDate, showFloatingBefore*/](gsl::not_null<HistoryItem*> item, int itemtop, int dateTop) {
+			enumerateDates([&p, &clip, scrollDateOpacity, dateHeight/*, lastDate, showFloatingBefore*/](not_null<HistoryItem*> item, int itemtop, int dateTop) {
 				// stop the enumeration if the date is above the painted rect
 				if (dateTop + dateHeight <= clip.top()) {
 					return false;
@@ -1008,7 +1008,7 @@ void InnerWidget::setToClipboard(const TextWithEntities &forClipboard, QClipboar
 	}
 }
 
-void InnerWidget::suggestRestrictUser(gsl::not_null<UserData*> user) {
+void InnerWidget::suggestRestrictUser(not_null<UserData*> user) {
 	Expects(_menu != nullptr);
 	if (!_channel->isMegagroup() || !_channel->canBanMembers() || _admins.empty()) {
 		return;
@@ -1054,7 +1054,7 @@ void InnerWidget::suggestRestrictUser(gsl::not_null<UserData*> user) {
 	});
 }
 
-void InnerWidget::restrictUser(gsl::not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights) {
+void InnerWidget::restrictUser(not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights) {
 	auto weak = QPointer<InnerWidget>(this);
 	MTP::send(MTPchannels_EditBanned(_channel->inputChannel, user->inputUser, newRights), rpcDone([megagroup = _channel.get(), user, weak, oldRights, newRights](const MTPUpdates &result) {
 		Auth().api().applyUpdates(result);
@@ -1065,7 +1065,7 @@ void InnerWidget::restrictUser(gsl::not_null<UserData*> user, const MTPChannelBa
 	}));
 }
 
-void InnerWidget::restrictUserDone(gsl::not_null<UserData*> user, const MTPChannelBannedRights &rights) {
+void InnerWidget::restrictUserDone(not_null<UserData*> user, const MTPChannelBannedRights &rights) {
 	Expects(rights.type() == mtpc_channelBannedRights);
 	if (rights.c_channelBannedRights().vflags.v) {
 		_admins.erase(std::remove(_admins.begin(), _admins.end(), user), _admins.end());
@@ -1290,7 +1290,7 @@ void InnerWidget::updateSelected() {
 		if (!dragState.link && itemPoint.x() >= st::historyPhotoLeft && itemPoint.x() < st::historyPhotoLeft + st::msgPhotoSize) {
 			if (auto message = item->toHistoryMessage()) {
 				if (message->hasFromPhoto()) {
-					enumerateUserpics([&dragState, &lnkhost, &point](gsl::not_null<HistoryMessage*> message, int userpicTop) -> bool {
+					enumerateUserpics([&dragState, &lnkhost, &point](not_null<HistoryMessage*> message, int userpicTop) -> bool {
 						// stop enumeration if the userpic is below our point
 						if (userpicTop > point.y()) {
 							return false;
@@ -1468,7 +1468,7 @@ void InnerWidget::performDrag() {
 	//} // TODO
 }
 
-int InnerWidget::itemTop(gsl::not_null<const HistoryItem*> item) const {
+int InnerWidget::itemTop(not_null<const HistoryItem*> item) const {
 	return _itemsTop + item->y();
 }
 
diff --git a/Telegram/SourceFiles/history/history_admin_log_inner.h b/Telegram/SourceFiles/history/history_admin_log_inner.h
index b79cf2bc89..b9a427c40a 100644
--- a/Telegram/SourceFiles/history/history_admin_log_inner.h
+++ b/Telegram/SourceFiles/history/history_admin_log_inner.h
@@ -40,13 +40,13 @@ class SectionMemento;
 
 class InnerWidget final : public TWidget, public Ui::AbstractTooltipShower, private MTP::Sender, private base::Subscriber {
 public:
-	InnerWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, gsl::not_null<ChannelData*> channel);
+	InnerWidget(QWidget *parent, not_null<Window::Controller*> controller, not_null<ChannelData*> channel);
 
 	base::Observable<void> showSearchSignal;
 	base::Observable<int> scrollToSignal;
 	base::Observable<void> cancelledSignal;
 
-	gsl::not_null<ChannelData*> channel() const {
+	not_null<ChannelData*> channel() const {
 		return _channel;
 	}
 
@@ -61,8 +61,8 @@ public:
 		return TWidget::resizeToWidth(newWidth);
 	}
 
-	void saveState(gsl::not_null<SectionMemento*> memento);
-	void restoreState(gsl::not_null<SectionMemento*> memento);
+	void saveState(not_null<SectionMemento*> memento);
+	void restoreState(not_null<SectionMemento*> memento);
 
 	// Empty "flags" means all events.
 	void applyFilter(FilterValue &&value);
@@ -111,7 +111,7 @@ private:
 	void mouseActionCancel();
 	void updateSelected();
 	void performDrag();
-	int itemTop(gsl::not_null<const HistoryItem*> item) const;
+	int itemTop(not_null<const HistoryItem*> item) const;
 	void repaintItem(const HistoryItem *item);
 	QPoint mapPointToItem(QPoint point, const HistoryItem *item) const;
 	void handlePendingHistoryResize();
@@ -129,9 +129,9 @@ private:
 	void copySelectedText();
 	TextWithEntities getSelectedText() const;
 	void setToClipboard(const TextWithEntities &forClipboard, QClipboard::Mode mode = QClipboard::Clipboard);
-	void suggestRestrictUser(gsl::not_null<UserData*> user);
-	void restrictUser(gsl::not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights);
-	void restrictUserDone(gsl::not_null<UserData*> user, const MTPChannelBannedRights &rights);
+	void suggestRestrictUser(not_null<UserData*> user);
+	void restrictUser(not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights);
+	void restrictUserDone(not_null<UserData*> user, const MTPChannelBannedRights &rights);
 
 	void requestAdmins();
 	void checkPreloadMore();
@@ -164,7 +164,7 @@ private:
 	// This function finds all userpics on the left that are displayed and calls template method
 	// for each found userpic (from the top to the bottom) using enumerateItems() method.
 	//
-	// Method has "bool (*Method)(gsl::not_null<HistoryMessage*> message, int userpicTop)" signature
+	// Method has "bool (*Method)(not_null<HistoryMessage*> message, int userpicTop)" signature
 	// if it returns false the enumeration stops immidiately.
 	template <typename Method>
 	void enumerateUserpics(Method method);
@@ -172,14 +172,14 @@ private:
 	// This function finds all date elements that are displayed and calls template method
 	// for each found date element (from the bottom to the top) using enumerateItems() method.
 	//
-	// Method has "bool (*Method)(gsl::not_null<HistoryItem*> item, int itemtop, int dateTop)" signature
+	// Method has "bool (*Method)(not_null<HistoryItem*> item, int itemtop, int dateTop)" signature
 	// if it returns false the enumeration stops immidiately.
 	template <typename Method>
 	void enumerateDates(Method method);
 
-	gsl::not_null<Window::Controller*> _controller;
-	gsl::not_null<ChannelData*> _channel;
-	gsl::not_null<History*> _history;
+	not_null<Window::Controller*> _controller;
+	not_null<ChannelData*> _channel;
+	not_null<History*> _history;
 	std::vector<HistoryItemOwned> _items;
 	std::map<uint64, HistoryItem*> _itemsByIds;
 	int _itemsTop = 0;
@@ -235,8 +235,8 @@ private:
 
 	FilterValue _filter;
 	QString _searchQuery;
-	std::vector<gsl::not_null<UserData*>> _admins;
-	std::vector<gsl::not_null<UserData*>> _adminsCanEdit;
+	std::vector<not_null<UserData*>> _admins;
+	std::vector<not_null<UserData*>> _adminsCanEdit;
 	base::lambda<void(FilterValue &&filter)> _showFilterCallback;
 
 };
diff --git a/Telegram/SourceFiles/history/history_admin_log_item.cpp b/Telegram/SourceFiles/history/history_admin_log_item.cpp
index 918a12483c..2db8252a40 100644
--- a/Telegram/SourceFiles/history/history_admin_log_item.cpp
+++ b/Telegram/SourceFiles/history/history_admin_log_item.cpp
@@ -113,7 +113,7 @@ const auto CollectChanges = [](auto &phraseMap, auto plusFlags, auto minusFlags)
 	return withPrefix(plusFlags & ~minusFlags, '+') + withPrefix(minusFlags & ~plusFlags, kMinus);
 };
 
-auto GenerateAdminChangeText(gsl::not_null<ChannelData*> channel, const TextWithEntities &user, const MTPChannelAdminRights *newRights, const MTPChannelAdminRights *prevRights) {
+auto GenerateAdminChangeText(not_null<ChannelData*> channel, const TextWithEntities &user, const MTPChannelAdminRights *newRights, const MTPChannelAdminRights *prevRights) {
 	using Flag = MTPDchannelAdminRights::Flag;
 	using Flags = MTPDchannelAdminRights::Flags;
 
@@ -197,7 +197,7 @@ auto GenerateUserString(MTPint userId) {
 	return lng_admin_log_user_with_username__generic(lt_name, name, lt_mention, mention);
 }
 
-auto GenerateParticipantChangeTextInner(gsl::not_null<ChannelData*> channel, const MTPChannelParticipant &participant, const MTPChannelParticipant *oldParticipant) {
+auto GenerateParticipantChangeTextInner(not_null<ChannelData*> channel, const MTPChannelParticipant &participant, const MTPChannelParticipant *oldParticipant) {
 	auto oldType = oldParticipant ? oldParticipant->type() : 0;
 
 	auto resultForParticipant = [channel, oldParticipant, oldType](auto &&data) {
@@ -236,7 +236,7 @@ auto GenerateParticipantChangeTextInner(gsl::not_null<ChannelData*> channel, con
 	Unexpected("Participant type in GenerateParticipantChangeTextInner()");
 }
 
-TextWithEntities GenerateParticipantChangeText(gsl::not_null<ChannelData*> channel, const MTPChannelParticipant &participant, const MTPChannelParticipant *oldParticipant = nullptr) {
+TextWithEntities GenerateParticipantChangeText(not_null<ChannelData*> channel, const MTPChannelParticipant &participant, const MTPChannelParticipant *oldParticipant = nullptr) {
 	auto result = GenerateParticipantChangeTextInner(channel, participant, oldParticipant);
 	result.entities.push_front(EntityInText(EntityInTextItalic, 0, result.text.size()));
 	return result;
@@ -244,7 +244,7 @@ TextWithEntities GenerateParticipantChangeText(gsl::not_null<ChannelData*> chann
 
 } // namespace
 
-void GenerateItems(gsl::not_null<History*> history, LocalIdManager &idManager, const MTPDchannelAdminLogEvent &event, base::lambda<void(HistoryItemOwned item)> callback) {
+void GenerateItems(not_null<History*> history, LocalIdManager &idManager, const MTPDchannelAdminLogEvent &event, base::lambda<void(HistoryItemOwned item)> callback) {
 	Expects(history->peer->isChannel());
 
 	auto id = event.vid.v;
@@ -252,7 +252,7 @@ void GenerateItems(gsl::not_null<History*> history, LocalIdManager &idManager, c
 	auto channel = history->peer->asChannel();
 	auto &action = event.vaction;
 	auto date = event.vdate;
-	auto addPart = [&callback](gsl::not_null<HistoryItem*> item) {
+	auto addPart = [&callback](not_null<HistoryItem*> item) {
 		return callback(HistoryItemOwned(item));
 	};
 
diff --git a/Telegram/SourceFiles/history/history_admin_log_item.h b/Telegram/SourceFiles/history/history_admin_log_item.h
index cd617884d7..d239d0cfd7 100644
--- a/Telegram/SourceFiles/history/history_admin_log_item.h
+++ b/Telegram/SourceFiles/history/history_admin_log_item.h
@@ -25,12 +25,12 @@ namespace AdminLog {
 class HistoryItemOwned;
 class LocalIdManager;
 
-void GenerateItems(gsl::not_null<History*> history, LocalIdManager &idManager, const MTPDchannelAdminLogEvent &event, base::lambda<void(HistoryItemOwned item)> callback);
+void GenerateItems(not_null<History*> history, LocalIdManager &idManager, const MTPDchannelAdminLogEvent &event, base::lambda<void(HistoryItemOwned item)> callback);
 
 // Smart pointer wrapper for HistoryItem* that destroys the owned item.
 class HistoryItemOwned {
 public:
-	explicit HistoryItemOwned(gsl::not_null<HistoryItem*> data) : _data(data) {
+	explicit HistoryItemOwned(not_null<HistoryItem*> data) : _data(data) {
 	}
 	HistoryItemOwned(const HistoryItemOwned &other) = delete;
 	HistoryItemOwned &operator=(const HistoryItemOwned &other) = delete;
diff --git a/Telegram/SourceFiles/history/history_admin_log_section.cpp b/Telegram/SourceFiles/history/history_admin_log_section.cpp
index 2cfd10cfea..1e1d9175f7 100644
--- a/Telegram/SourceFiles/history/history_admin_log_section.cpp
+++ b/Telegram/SourceFiles/history/history_admin_log_section.cpp
@@ -41,7 +41,7 @@ namespace AdminLog {
 
 class FixedBar final : public TWidget, private base::Subscriber {
 public:
-	FixedBar(QWidget *parent, gsl::not_null<ChannelData*> channel);
+	FixedBar(QWidget *parent, not_null<ChannelData*> channel);
 
 	base::Observable<void> showFilterSignal;
 	base::Observable<void> searchCancelledSignal;
@@ -74,7 +74,7 @@ private:
 	void applySearch();
 	void searchAnimationCallback();
 
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 	object_ptr<Ui::FlatInput> _field;
 	object_ptr<Profile::BackButton> _backButton;
 	object_ptr<Ui::IconButton> _search;
@@ -88,13 +88,13 @@ private:
 
 };
 
-object_ptr<Window::SectionWidget> SectionMemento::createWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, const QRect &geometry) {
+object_ptr<Window::SectionWidget> SectionMemento::createWidget(QWidget *parent, not_null<Window::Controller*> controller, const QRect &geometry) {
 	auto result = object_ptr<Widget>(parent, controller, _channel);
 	result->setInternalState(geometry, this);
 	return std::move(result);
 }
 
-FixedBar::FixedBar(QWidget *parent, gsl::not_null<ChannelData*> channel) : TWidget(parent)
+FixedBar::FixedBar(QWidget *parent, not_null<ChannelData*> channel) : TWidget(parent)
 , _channel(channel)
 , _field(this, st::historyAdminLogSearchField, langFactory(lng_dlg_filter))
 , _backButton(this, lang(lng_admin_log_title_all))
@@ -232,7 +232,7 @@ void FixedBar::mousePressEvent(QMouseEvent *e) {
 	}
 }
 
-Widget::Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller, gsl::not_null<ChannelData*> channel) : Window::SectionWidget(parent, controller)
+Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller, not_null<ChannelData*> channel) : Window::SectionWidget(parent, controller)
 , _scroll(this, st::historyScroll, false)
 , _fixedBar(this, channel)
 , _fixedBarShadow(this, st::shadowFg)
@@ -271,7 +271,7 @@ void Widget::updateAdaptiveLayout() {
 	_fixedBarShadow->moveToLeft(Adaptive::OneColumn() ? 0 : st::lineWidth, _fixedBar->height());
 }
 
-gsl::not_null<ChannelData*> Widget::channel() const {
+not_null<ChannelData*> Widget::channel() const {
 	return _inner->channel();
 }
 
@@ -288,7 +288,7 @@ void Widget::doSetInnerFocus() {
 	}
 }
 
-bool Widget::showInternal(gsl::not_null<Window::SectionMemento*> memento) {
+bool Widget::showInternal(not_null<Window::SectionMemento*> memento) {
 	if (auto logMemento = dynamic_cast<SectionMemento*>(memento.get())) {
 		if (logMemento->getChannel() == channel()) {
 			restoreState(logMemento);
@@ -298,7 +298,7 @@ bool Widget::showInternal(gsl::not_null<Window::SectionMemento*> memento) {
 	return false;
 }
 
-void Widget::setInternalState(const QRect &geometry, gsl::not_null<SectionMemento*> memento) {
+void Widget::setInternalState(const QRect &geometry, not_null<SectionMemento*> memento) {
 	setGeometry(geometry);
 	myEnsureResized(this);
 	restoreState(memento);
@@ -318,12 +318,12 @@ std::unique_ptr<Window::SectionMemento> Widget::createMemento() {
 	return std::move(result);
 }
 
-void Widget::saveState(gsl::not_null<SectionMemento*> memento) {
+void Widget::saveState(not_null<SectionMemento*> memento) {
 	memento->setScrollTop(_scroll->scrollTop());
 	_inner->saveState(memento);
 }
 
-void Widget::restoreState(gsl::not_null<SectionMemento*> memento) {
+void Widget::restoreState(not_null<SectionMemento*> memento) {
 	_inner->restoreState(memento);
 	auto scrollTop = memento->getScrollTop();
 	_scroll->scrollToY(scrollTop);
diff --git a/Telegram/SourceFiles/history/history_admin_log_section.h b/Telegram/SourceFiles/history/history_admin_log_section.h
index d213eec0ae..327f22a4f3 100644
--- a/Telegram/SourceFiles/history/history_admin_log_section.h
+++ b/Telegram/SourceFiles/history/history_admin_log_section.h
@@ -48,7 +48,7 @@ class SectionMemento;
 struct FilterValue {
 	// Empty "flags" means all events.
 	MTPDchannelAdminLogEventsFilter::Flags flags = 0;
-	std::vector<gsl::not_null<UserData*>> admins;
+	std::vector<not_null<UserData*>> admins;
 	bool allUsers = true;
 };
 
@@ -82,9 +82,9 @@ private:
 
 class Widget final : public Window::SectionWidget {
 public:
-	Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller, gsl::not_null<ChannelData*> channel);
+	Widget(QWidget *parent, not_null<Window::Controller*> controller, not_null<ChannelData*> channel);
 
-	gsl::not_null<ChannelData*> channel() const;
+	not_null<ChannelData*> channel() const;
 	PeerData *peerForDialogs() const override {
 		return channel();
 	}
@@ -95,10 +95,10 @@ public:
 
 	QPixmap grabForShowAnimation(const Window::SectionSlideParams &params) override;
 
-	bool showInternal(gsl::not_null<Window::SectionMemento*> memento) override;
+	bool showInternal(not_null<Window::SectionMemento*> memento) override;
 	std::unique_ptr<Window::SectionMemento> createMemento() override;
 
-	void setInternalState(const QRect &geometry, gsl::not_null<SectionMemento*> memento);
+	void setInternalState(const QRect &geometry, not_null<SectionMemento*> memento);
 
 	// Float player interface.
 	bool wheelEventFromFloatPlayer(QEvent *e, Window::Column myColumn, Window::Column playerColumn) override;
@@ -120,8 +120,8 @@ private:
 	void showFilter();
 	void onScroll();
 	void updateAdaptiveLayout();
-	void saveState(gsl::not_null<SectionMemento*> memento);
-	void restoreState(gsl::not_null<SectionMemento*> memento);
+	void saveState(not_null<SectionMemento*> memento);
+	void restoreState(not_null<SectionMemento*> memento);
 
 	object_ptr<Ui::ScrollArea> _scroll;
 	QPointer<InnerWidget> _inner;
@@ -133,12 +133,12 @@ private:
 
 class SectionMemento : public Window::SectionMemento {
 public:
-	SectionMemento(gsl::not_null<ChannelData*> channel) : _channel(channel) {
+	SectionMemento(not_null<ChannelData*> channel) : _channel(channel) {
 	}
 
-	object_ptr<Window::SectionWidget> createWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, const QRect &geometry) override;
+	object_ptr<Window::SectionWidget> createWidget(QWidget *parent, not_null<Window::Controller*> controller, const QRect &geometry) override;
 
-	gsl::not_null<ChannelData*> getChannel() const {
+	not_null<ChannelData*> getChannel() const {
 		return _channel;
 	}
 	void setScrollTop(int scrollTop) {
@@ -148,16 +148,16 @@ public:
 		return _scrollTop;
 	}
 
-	void setAdmins(std::vector<gsl::not_null<UserData*>> admins) {
+	void setAdmins(std::vector<not_null<UserData*>> admins) {
 		_admins = std::move(admins);
 	}
-	void setAdminsCanEdit(std::vector<gsl::not_null<UserData*>> admins) {
+	void setAdminsCanEdit(std::vector<not_null<UserData*>> admins) {
 		_adminsCanEdit = std::move(admins);
 	}
-	std::vector<gsl::not_null<UserData*>> takeAdmins() {
+	std::vector<not_null<UserData*>> takeAdmins() {
 		return std::move(_admins);
 	}
-	std::vector<gsl::not_null<UserData*>> takeAdminsCanEdit() {
+	std::vector<not_null<UserData*>> takeAdminsCanEdit() {
 		return std::move(_adminsCanEdit);
 	}
 
@@ -199,10 +199,10 @@ public:
 	}
 
 private:
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 	int _scrollTop = 0;
-	std::vector<gsl::not_null<UserData*>> _admins;
-	std::vector<gsl::not_null<UserData*>> _adminsCanEdit;
+	std::vector<not_null<UserData*>> _admins;
+	std::vector<not_null<UserData*>> _adminsCanEdit;
 	std::vector<HistoryItemOwned> _items;
 	std::map<uint64, HistoryItem*> _itemsByIds;
 	bool _upLoaded = false;
diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp
index f38402d762..916e20b0d3 100644
--- a/Telegram/SourceFiles/history/history_inner_widget.cpp
+++ b/Telegram/SourceFiles/history/history_inner_widget.cpp
@@ -84,7 +84,7 @@ int BinarySearchBlocksOrItems(const T &list, int edge) {
 
 // flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html
 
-HistoryInner::HistoryInner(HistoryWidget *historyWidget, gsl::not_null<Window::Controller*> controller, Ui::ScrollArea *scroll, History *history) : TWidget(nullptr)
+HistoryInner::HistoryInner(HistoryWidget *historyWidget, not_null<Window::Controller*> controller, Ui::ScrollArea *scroll, History *history) : TWidget(nullptr)
 , _controller(controller)
 , _peer(history->peer)
 , _migrated(history->peer->migrateFrom() ? App::history(history->peer->migrateFrom()->id) : nullptr)
@@ -116,7 +116,7 @@ HistoryInner::HistoryInner(HistoryWidget *historyWidget, gsl::not_null<Window::C
 	subscribe(_controller->window()->dragFinished(), [this] {
 		mouseActionUpdate(QCursor::pos());
 	});
-	subscribe(Auth().data().historyCleared(), [this](gsl::not_null<History*> history) {
+	subscribe(Auth().data().historyCleared(), [this](not_null<History*> history) {
 		if (_history == history) {
 			mouseActionCancel();
 		}
@@ -256,7 +256,7 @@ void HistoryInner::enumerateUserpics(Method method) {
 	// -1 means we didn't find an attached to next message yet.
 	int lowestAttachedItemTop = -1;
 
-	auto userpicCallback = [this, &lowestAttachedItemTop, &method](gsl::not_null<HistoryItem*> item, int itemtop, int itembottom) {
+	auto userpicCallback = [this, &lowestAttachedItemTop, &method](not_null<HistoryItem*> item, int itemtop, int itembottom) {
 		// Skip all service messages.
 		auto message = item->toHistoryMessage();
 		if (!message) return true;
@@ -304,7 +304,7 @@ void HistoryInner::enumerateDates(Method method) {
 	// -1 means we didn't find a same-day with previous message yet.
 	auto lowestInOneDayItemBottom = -1;
 
-	auto dateCallback = [this, &lowestInOneDayItemBottom, &method, drawtop](gsl::not_null<HistoryItem*> item, int itemtop, int itembottom) {
+	auto dateCallback = [this, &lowestInOneDayItemBottom, &method, drawtop](not_null<HistoryItem*> item, int itemtop, int itembottom) {
 		if (lowestInOneDayItemBottom < 0 && item->isInOneDayWithPrevious()) {
 			lowestInOneDayItemBottom = itembottom - item->marginBottom();
 		}
@@ -506,7 +506,7 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
 		}
 
 		if (mtop >= 0 || htop >= 0) {
-			enumerateUserpics([&p, &clip](gsl::not_null<HistoryMessage*> message, int userpicTop) {
+			enumerateUserpics([&p, &clip](not_null<HistoryMessage*> message, int userpicTop) {
 				// stop the enumeration if the userpic is below the painted rect
 				if (userpicTop >= clip.top() + clip.height()) {
 					return false;
@@ -529,7 +529,7 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
 			//int showFloatingBefore = height() - 2 * (_visibleAreaBottom - _visibleAreaTop) - dateHeight;
 
 			auto scrollDateOpacity = _scrollDateOpacity.current(ms, _scrollDateShown ? 1. : 0.);
-			enumerateDates([&p, &clip, scrollDateOpacity, dateHeight/*, lastDate, showFloatingBefore*/](gsl::not_null<HistoryItem*> item, int itemtop, int dateTop) {
+			enumerateDates([&p, &clip, scrollDateOpacity, dateHeight/*, lastDate, showFloatingBefore*/](not_null<HistoryItem*> item, int itemtop, int dateTop) {
 				// stop the enumeration if the date is above the painted rect
 				if (dateTop + dateHeight <= clip.top()) {
 					return false;
@@ -2053,7 +2053,7 @@ void HistoryInner::onUpdateSelected() {
 
 		auto dateHeight = st::msgServicePadding.bottom() + st::msgServiceFont->height + st::msgServicePadding.top();
 		auto scrollDateOpacity = _scrollDateOpacity.current(_scrollDateShown ? 1. : 0.);
-		enumerateDates([this, &dragState, &lnkhost, &point, scrollDateOpacity, dateHeight/*, lastDate, showFloatingBefore*/](gsl::not_null<HistoryItem*> item, int itemtop, int dateTop) {
+		enumerateDates([this, &dragState, &lnkhost, &point, scrollDateOpacity, dateHeight/*, lastDate, showFloatingBefore*/](not_null<HistoryItem*> item, int itemtop, int dateTop) {
 			// stop enumeration if the date is above our point
 			if (dateTop + dateHeight <= point.y()) {
 				return false;
@@ -2112,7 +2112,7 @@ void HistoryInner::onUpdateSelected() {
 			if (!dragState.link && m.x() >= st::historyPhotoLeft && m.x() < st::historyPhotoLeft + st::msgPhotoSize) {
 				if (auto msg = item->toHistoryMessage()) {
 					if (msg->hasFromPhoto()) {
-						enumerateUserpics([&dragState, &lnkhost, &point](gsl::not_null<HistoryMessage*> message, int userpicTop) -> bool {
+						enumerateUserpics([&dragState, &lnkhost, &point](not_null<HistoryMessage*> message, int userpicTop) -> bool {
 							// stop enumeration if the userpic is below our point
 							if (userpicTop > point.y()) {
 								return false;
diff --git a/Telegram/SourceFiles/history/history_inner_widget.h b/Telegram/SourceFiles/history/history_inner_widget.h
index 728c631c56..0836f4513f 100644
--- a/Telegram/SourceFiles/history/history_inner_widget.h
+++ b/Telegram/SourceFiles/history/history_inner_widget.h
@@ -37,7 +37,7 @@ class HistoryInner : public TWidget, public Ui::AbstractTooltipShower, private b
 	Q_OBJECT
 
 public:
-	HistoryInner(HistoryWidget *historyWidget, gsl::not_null<Window::Controller*> controller, Ui::ScrollArea *scroll, History *history);
+	HistoryInner(HistoryWidget *historyWidget, not_null<Window::Controller*> controller, Ui::ScrollArea *scroll, History *history);
 
 	void messagesReceived(PeerData *peer, const QVector<MTPMessage> &messages);
 	void messagesReceivedDown(PeerData *peer, const QVector<MTPMessage> &messages);
@@ -166,7 +166,7 @@ private:
 	void scrollDateHide();
 	void keepScrollDateForNow();
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 	PeerData *_peer = nullptr;
 	History *_migrated = nullptr;
@@ -274,7 +274,7 @@ private:
 	// This function finds all history items that are displayed and calls template method
 	// for each found message (in given direction) in the passed history with passed top offset.
 	//
-	// Method has "bool (*Method)(gsl::not_null<HistoryItem*> item, int itemtop, int itembottom)" signature
+	// Method has "bool (*Method)(not_null<HistoryItem*> item, int itemtop, int itembottom)" signature
 	// if it returns false the enumeration stops immidiately.
 	template <bool TopToBottom, typename Method>
 	void enumerateItemsInHistory(History *history, int historytop, Method method);
@@ -294,7 +294,7 @@ private:
 	// This function finds all userpics on the left that are displayed and calls template method
 	// for each found userpic (from the top to the bottom) using enumerateItems() method.
 	//
-	// Method has "bool (*Method)(gsl::not_null<HistoryMessage*> message, int userpicTop)" signature
+	// Method has "bool (*Method)(not_null<HistoryMessage*> message, int userpicTop)" signature
 	// if it returns false the enumeration stops immidiately.
 	template <typename Method>
 	void enumerateUserpics(Method method);
@@ -302,7 +302,7 @@ private:
 	// This function finds all date elements that are displayed and calls template method
 	// for each found date element (from the bottom to the top) using enumerateItems() method.
 	//
-	// Method has "bool (*Method)(gsl::not_null<HistoryItem*> item, int itemtop, int dateTop)" signature
+	// Method has "bool (*Method)(not_null<HistoryItem*> item, int itemtop, int dateTop)" signature
 	// if it returns false the enumeration stops immidiately.
 	template <typename Method>
 	void enumerateDates(Method method);
diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp
index fda9aa73cd..0b9ad0eb01 100644
--- a/Telegram/SourceFiles/history/history_item.cpp
+++ b/Telegram/SourceFiles/history/history_item.cpp
@@ -744,7 +744,7 @@ void HistoryItem::nextItemChanged() {
 	setAttachToNext(false);
 }
 
-bool HistoryItem::computeIsAttachToPrevious(gsl::not_null<HistoryItem*> previous) {
+bool HistoryItem::computeIsAttachToPrevious(not_null<HistoryItem*> previous) {
 	if (!Has<HistoryMessageDate>() && !Has<HistoryMessageUnreadBar>()) {
 		return !isPost() && !previous->isPost()
 			&& !serviceMsg() && !previous->serviceMsg()
diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h
index 9e06ff8c33..ec4550a065 100644
--- a/Telegram/SourceFiles/history/history_item.h
+++ b/Telegram/SourceFiles/history/history_item.h
@@ -299,7 +299,7 @@ public:
 		int buttonHeight() const;
 		virtual int buttonRadius() const = 0;
 
-		virtual void repaint(gsl::not_null<const HistoryItem*> item) const = 0;
+		virtual void repaint(not_null<const HistoryItem*> item) const = 0;
 		virtual ~Style() {
 		}
 
@@ -907,7 +907,7 @@ public:
 	void clipCallback(Media::Clip::Notification notification);
 	void audioTrackUpdated();
 
-	bool computeIsAttachToPrevious(gsl::not_null<HistoryItem*> previous);
+	bool computeIsAttachToPrevious(not_null<HistoryItem*> previous);
 	void setLogEntryDisplayDate(bool displayDate) {
 		Expects(isLogEntry());
 		setDisplayDate(displayDate);
@@ -941,8 +941,8 @@ protected:
 	void finishEdition(int oldKeyboardTop);
 	void finishEditionToEmpty();
 
-	gsl::not_null<History*> _history;
-	gsl::not_null<PeerData*> _from;
+	not_null<History*> _history;
+	not_null<PeerData*> _from;
 	HistoryBlock *_block = nullptr;
 	int _indexInBlock = -1;
 	MTPDmessage::Flags _flags = 0;
@@ -1045,7 +1045,7 @@ template <typename T>
 class HistoryItemInstantiated {
 public:
 	template <typename ...Args>
-	static gsl::not_null<T*> _create(Args &&... args) {
+	static not_null<T*> _create(Args &&... args) {
 		auto result = new T(std::forward<Args>(args)...);
 		result->finishCreate();
 		return result;
diff --git a/Telegram/SourceFiles/history/history_media.h b/Telegram/SourceFiles/history/history_media.h
index 20cffbef9e..c8580ebb3b 100644
--- a/Telegram/SourceFiles/history/history_media.h
+++ b/Telegram/SourceFiles/history/history_media.h
@@ -29,7 +29,7 @@ enum class MediaInBubbleState {
 
 class HistoryMedia : public HistoryElement {
 public:
-	HistoryMedia(gsl::not_null<HistoryItem*> parent) : _parent(parent) {
+	HistoryMedia(not_null<HistoryItem*> parent) : _parent(parent) {
 	}
 
 	virtual HistoryMediaType type() const = 0;
@@ -225,7 +225,7 @@ protected:
 		_parent->history()->eraseFromOverview(type, _parent->id);
 	}
 
-	gsl::not_null<HistoryItem*> _parent;
+	not_null<HistoryItem*> _parent;
 	int _width = 0;
 	MediaInBubbleState _inBubbleState = MediaInBubbleState::None;
 
diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp
index 1806d9ff96..145a5ff292 100644
--- a/Telegram/SourceFiles/history/history_media_types.cpp
+++ b/Telegram/SourceFiles/history/history_media_types.cpp
@@ -229,7 +229,7 @@ void HistoryFileMedia::checkAnimationFinished() const {
 
 HistoryFileMedia::~HistoryFileMedia() = default;
 
-HistoryPhoto::HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<PhotoData*> photo, const QString &caption) : HistoryFileMedia(parent)
+HistoryPhoto::HistoryPhoto(not_null<HistoryItem*> parent, not_null<PhotoData*> photo, const QString &caption) : HistoryFileMedia(parent)
 , _data(photo)
 , _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) {
 	setLinks(MakeShared<PhotoOpenClickHandler>(_data), MakeShared<PhotoSaveClickHandler>(_data), MakeShared<PhotoCancelClickHandler>(_data));
@@ -239,7 +239,7 @@ HistoryPhoto::HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<Pho
 	init();
 }
 
-HistoryPhoto::HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<PeerData*> chat, gsl::not_null<PhotoData*> photo, int32 width) : HistoryFileMedia(parent)
+HistoryPhoto::HistoryPhoto(not_null<HistoryItem*> parent, not_null<PeerData*> chat, not_null<PhotoData*> photo, int32 width) : HistoryFileMedia(parent)
 , _data(photo) {
 	setLinks(MakeShared<PhotoOpenClickHandler>(_data, chat), MakeShared<PhotoSaveClickHandler>(_data, chat), MakeShared<PhotoCancelClickHandler>(_data, chat));
 
@@ -247,10 +247,10 @@ HistoryPhoto::HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<Pee
 	init();
 }
 
-HistoryPhoto::HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<PeerData*> chat, const MTPDphoto &photo, int32 width) : HistoryPhoto(parent, chat, App::feedPhoto(photo), width) {
+HistoryPhoto::HistoryPhoto(not_null<HistoryItem*> parent, not_null<PeerData*> chat, const MTPDphoto &photo, int32 width) : HistoryPhoto(parent, chat, App::feedPhoto(photo), width) {
 }
 
-HistoryPhoto::HistoryPhoto(gsl::not_null<HistoryItem*> parent, const HistoryPhoto &other) : HistoryFileMedia(parent)
+HistoryPhoto::HistoryPhoto(not_null<HistoryItem*> parent, const HistoryPhoto &other) : HistoryFileMedia(parent)
 , _data(other._data)
 , _pixw(other._pixw)
 , _pixh(other._pixh)
@@ -657,7 +657,7 @@ ImagePtr HistoryPhoto::replyPreview() {
 	return _data->makeReplyPreview();
 }
 
-HistoryVideo::HistoryVideo(gsl::not_null<HistoryItem*> parent, DocumentData *document, const QString &caption) : HistoryFileMedia(parent)
+HistoryVideo::HistoryVideo(not_null<HistoryItem*> parent, DocumentData *document, const QString &caption) : HistoryFileMedia(parent)
 , _data(document)
 , _thumbw(1)
 , _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) {
@@ -672,7 +672,7 @@ HistoryVideo::HistoryVideo(gsl::not_null<HistoryItem*> parent, DocumentData *doc
 	_data->thumb->load();
 }
 
-HistoryVideo::HistoryVideo(gsl::not_null<HistoryItem*> parent, const HistoryVideo &other) : HistoryFileMedia(parent)
+HistoryVideo::HistoryVideo(not_null<HistoryItem*> parent, const HistoryVideo &other) : HistoryFileMedia(parent)
 , _data(other._data)
 , _thumbw(other._thumbw)
 , _caption(other._caption) {
@@ -1048,7 +1048,7 @@ void HistoryDocumentVoice::stopSeeking() {
 	Media::Player::instance()->stopSeeking(AudioMsgId::Type::Voice);
 }
 
-HistoryDocument::HistoryDocument(gsl::not_null<HistoryItem*> parent, DocumentData *document, const QString &caption) : HistoryFileMedia(parent)
+HistoryDocument::HistoryDocument(not_null<HistoryItem*> parent, DocumentData *document, const QString &caption) : HistoryFileMedia(parent)
 , _data(document) {
 	createComponents(!caption.isEmpty());
 	if (auto named = Get<HistoryDocumentNamed>()) {
@@ -1064,7 +1064,7 @@ HistoryDocument::HistoryDocument(gsl::not_null<HistoryItem*> parent, DocumentDat
 	}
 }
 
-HistoryDocument::HistoryDocument(gsl::not_null<HistoryItem*> parent, const HistoryDocument &other) : HistoryFileMedia(parent)
+HistoryDocument::HistoryDocument(not_null<HistoryItem*> parent, const HistoryDocument &other) : HistoryFileMedia(parent)
 , RuntimeComposer()
 , _data(other._data) {
 	auto captioned = other.Get<HistoryDocumentCaptioned>();
@@ -1792,7 +1792,7 @@ ImagePtr HistoryDocument::replyPreview() {
 	return _data->makeReplyPreview();
 }
 
-HistoryGif::HistoryGif(gsl::not_null<HistoryItem*> parent, DocumentData *document, const QString &caption) : HistoryFileMedia(parent)
+HistoryGif::HistoryGif(not_null<HistoryItem*> parent, DocumentData *document, const QString &caption) : HistoryFileMedia(parent)
 , _data(document)
 , _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) {
 	setDocumentLinks(_data, true);
@@ -1806,7 +1806,7 @@ HistoryGif::HistoryGif(gsl::not_null<HistoryItem*> parent, DocumentData *documen
 	_data->thumb->load();
 }
 
-HistoryGif::HistoryGif(gsl::not_null<HistoryItem*> parent, const HistoryGif &other) : HistoryFileMedia(parent)
+HistoryGif::HistoryGif(not_null<HistoryItem*> parent, const HistoryGif &other) : HistoryFileMedia(parent)
 , _data(other._data)
 , _thumbw(other._thumbw)
 , _thumbh(other._thumbh)
@@ -2627,7 +2627,7 @@ bool HistoryGif::dataLoaded() const {
 	return (!_parent || _parent->id > 0) ? _data->loaded() : false;
 }
 
-HistorySticker::HistorySticker(gsl::not_null<HistoryItem*> parent, DocumentData *document) : HistoryMedia(parent)
+HistorySticker::HistorySticker(not_null<HistoryItem*> parent, DocumentData *document) : HistoryMedia(parent)
 , _data(document)
 , _emoji(_data->sticker()->alt) {
 	_data->thumb->load();
@@ -2923,7 +2923,7 @@ ClickHandlerPtr addContactClickHandler(HistoryItem *item) {
 
 } // namespace
 
-HistoryContact::HistoryContact(gsl::not_null<HistoryItem*> parent, int32 userId, const QString &first, const QString &last, const QString &phone) : HistoryMedia(parent)
+HistoryContact::HistoryContact(not_null<HistoryItem*> parent, int32 userId, const QString &first, const QString &last, const QString &phone) : HistoryMedia(parent)
 , _userId(userId)
 , _fname(first)
 , _lname(last)
@@ -3089,7 +3089,7 @@ void HistoryContact::updateSentMedia(const MTPMessageMedia &media) {
 	}
 }
 
-HistoryCall::HistoryCall(gsl::not_null<HistoryItem*> parent, const MTPDmessageActionPhoneCall &call) : HistoryMedia(parent)
+HistoryCall::HistoryCall(not_null<HistoryItem*> parent, const MTPDmessageActionPhoneCall &call) : HistoryMedia(parent)
 , _reason(GetReason(call)) {
 	if (_parent->out()) {
 		_text = lang(_reason == FinishReason::Missed ? lng_call_cancelled : lng_call_outgoing);
@@ -3238,13 +3238,13 @@ int unitedLineHeight() {
 
 } // namespace
 
-HistoryWebPage::HistoryWebPage(gsl::not_null<HistoryItem*> parent, gsl::not_null<WebPageData*> data) : HistoryMedia(parent)
+HistoryWebPage::HistoryWebPage(not_null<HistoryItem*> parent, not_null<WebPageData*> data) : HistoryMedia(parent)
 , _data(data)
 , _title(st::msgMinWidth - st::webPageLeft)
 , _description(st::msgMinWidth - st::webPageLeft) {
 }
 
-HistoryWebPage::HistoryWebPage(gsl::not_null<HistoryItem*> parent, const HistoryWebPage &other) : HistoryMedia(parent)
+HistoryWebPage::HistoryWebPage(not_null<HistoryItem*> parent, const HistoryWebPage &other) : HistoryMedia(parent)
 , _data(other._data)
 , _attach(other._attach ? other._attach->clone(parent) : nullptr)
 , _asArticle(other._asArticle)
@@ -3784,13 +3784,13 @@ int HistoryWebPage::bottomInfoPadding() const {
 	return result;
 }
 
-HistoryGame::HistoryGame(gsl::not_null<HistoryItem*> parent, GameData *data) : HistoryMedia(parent)
+HistoryGame::HistoryGame(not_null<HistoryItem*> parent, GameData *data) : HistoryMedia(parent)
 , _data(data)
 , _title(st::msgMinWidth - st::webPageLeft)
 , _description(st::msgMinWidth - st::webPageLeft) {
 }
 
-HistoryGame::HistoryGame(gsl::not_null<HistoryItem*> parent, const HistoryGame &other) : HistoryMedia(parent)
+HistoryGame::HistoryGame(not_null<HistoryItem*> parent, const HistoryGame &other) : HistoryMedia(parent)
 , _data(other._data)
 , _attach(other._attach ? other._attach->clone(parent) : nullptr)
 , _title(other._title)
@@ -4176,14 +4176,14 @@ int HistoryGame::bottomInfoPadding() const {
 	return result;
 }
 
-HistoryInvoice::HistoryInvoice(gsl::not_null<HistoryItem*> parent, const MTPDmessageMediaInvoice &data) : HistoryMedia(parent)
+HistoryInvoice::HistoryInvoice(not_null<HistoryItem*> parent, const MTPDmessageMediaInvoice &data) : HistoryMedia(parent)
 , _title(st::msgMinWidth)
 , _description(st::msgMinWidth)
 , _status(st::msgMinWidth) {
 	fillFromData(data);
 }
 
-HistoryInvoice::HistoryInvoice(gsl::not_null<HistoryItem*> parent, const HistoryInvoice &other) : HistoryMedia(parent)
+HistoryInvoice::HistoryInvoice(not_null<HistoryItem*> parent, const HistoryInvoice &other) : HistoryMedia(parent)
 , _attach(other._attach ? other._attach->clone(parent) : nullptr)
 , _titleHeight(other._titleHeight)
 , _descriptionHeight(other._descriptionHeight)
@@ -4558,7 +4558,7 @@ int HistoryInvoice::bottomInfoPadding() const {
 	return result;
 }
 
-HistoryLocation::HistoryLocation(gsl::not_null<HistoryItem*> parent, const LocationCoords &coords, const QString &title, const QString &description) : HistoryMedia(parent)
+HistoryLocation::HistoryLocation(not_null<HistoryItem*> parent, const LocationCoords &coords, const QString &title, const QString &description) : HistoryMedia(parent)
 , _data(App::location(coords))
 , _title(st::msgMinWidth)
 , _description(st::msgMinWidth)
@@ -4574,7 +4574,7 @@ HistoryLocation::HistoryLocation(gsl::not_null<HistoryItem*> parent, const Locat
 	}
 }
 
-HistoryLocation::HistoryLocation(gsl::not_null<HistoryItem*> parent, const HistoryLocation &other) : HistoryMedia(parent)
+HistoryLocation::HistoryLocation(not_null<HistoryItem*> parent, const HistoryLocation &other) : HistoryMedia(parent)
 , _data(other._data)
 , _title(other._title)
 , _description(other._description)
diff --git a/Telegram/SourceFiles/history/history_media_types.h b/Telegram/SourceFiles/history/history_media_types.h
index 4888ed8073..5a77b7f42e 100644
--- a/Telegram/SourceFiles/history/history_media_types.h
+++ b/Telegram/SourceFiles/history/history_media_types.h
@@ -121,10 +121,10 @@ protected:
 
 class HistoryPhoto : public HistoryFileMedia {
 public:
-	HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<PhotoData*> photo, const QString &caption);
-	HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<PeerData*> chat, gsl::not_null<PhotoData*> photo, int width);
-	HistoryPhoto(gsl::not_null<HistoryItem*> parent, gsl::not_null<PeerData*> chat, const MTPDphoto &photo, int width);
-	HistoryPhoto(gsl::not_null<HistoryItem*> parent, const HistoryPhoto &other);
+	HistoryPhoto(not_null<HistoryItem*> parent, not_null<PhotoData*> photo, const QString &caption);
+	HistoryPhoto(not_null<HistoryItem*> parent, not_null<PeerData*> chat, not_null<PhotoData*> photo, int width);
+	HistoryPhoto(not_null<HistoryItem*> parent, not_null<PeerData*> chat, const MTPDphoto &photo, int width);
+	HistoryPhoto(not_null<HistoryItem*> parent, const HistoryPhoto &other);
 
 	void init();
 	HistoryMediaType type() const override {
@@ -201,7 +201,7 @@ protected:
 	}
 
 private:
-	gsl::not_null<PhotoData*> _data;
+	not_null<PhotoData*> _data;
 	int16 _pixw = 1;
 	int16 _pixh = 1;
 	Text _caption;
@@ -210,8 +210,8 @@ private:
 
 class HistoryVideo : public HistoryFileMedia {
 public:
-	HistoryVideo(gsl::not_null<HistoryItem*> parent, DocumentData *document, const QString &caption);
-	HistoryVideo(gsl::not_null<HistoryItem*> parent, const HistoryVideo &other);
+	HistoryVideo(not_null<HistoryItem*> parent, DocumentData *document, const QString &caption);
+	HistoryVideo(not_null<HistoryItem*> parent, const HistoryVideo &other);
 	HistoryMediaType type() const override {
 		return MediaTypeVideo;
 	}
@@ -287,7 +287,7 @@ protected:
 	}
 
 private:
-	gsl::not_null<DocumentData*> _data;
+	not_null<DocumentData*> _data;
 	int32 _thumbw;
 	Text _caption;
 
@@ -360,8 +360,8 @@ private:
 
 class HistoryDocument : public HistoryFileMedia, public RuntimeComposer {
 public:
-	HistoryDocument(gsl::not_null<HistoryItem*> parent, DocumentData *document, const QString &caption);
-	HistoryDocument(gsl::not_null<HistoryItem*> parent, const HistoryDocument &other);
+	HistoryDocument(not_null<HistoryItem*> parent, DocumentData *document, const QString &caption);
+	HistoryDocument(not_null<HistoryItem*> parent, const HistoryDocument &other);
 	HistoryMediaType type() const override {
 		return _data->voice() ? MediaTypeVoiceFile : (_data->song() ? MediaTypeMusicFile : MediaTypeFile);
 	}
@@ -467,14 +467,14 @@ private:
 	template <typename Callback>
 	void buildStringRepresentation(Callback callback) const;
 
-	gsl::not_null<DocumentData*> _data;
+	not_null<DocumentData*> _data;
 
 };
 
 class HistoryGif : public HistoryFileMedia {
 public:
-	HistoryGif(gsl::not_null<HistoryItem*> parent, DocumentData *document, const QString &caption);
-	HistoryGif(gsl::not_null<HistoryItem*> parent, const HistoryGif &other);
+	HistoryGif(not_null<HistoryItem*> parent, DocumentData *document, const QString &caption);
+	HistoryGif(not_null<HistoryItem*> parent, const HistoryGif &other);
 	HistoryMediaType type() const override {
 		return MediaTypeGif;
 	}
@@ -570,7 +570,7 @@ private:
 	QString mediaTypeString() const;
 	bool isSeparateRoundVideo() const;
 
-	gsl::not_null<DocumentData*> _data;
+	not_null<DocumentData*> _data;
 	ClickHandlerPtr _openInMediaviewLink;
 	int32 _thumbw = 1;
 	int32 _thumbh = 1;
@@ -586,7 +586,7 @@ private:
 
 class HistorySticker : public HistoryMedia {
 public:
-	HistorySticker(gsl::not_null<HistoryItem*> parent, DocumentData *document);
+	HistorySticker(not_null<HistoryItem*> parent, DocumentData *document);
 	HistoryMediaType type() const override {
 		return MediaTypeSticker;
 	}
@@ -648,14 +648,14 @@ private:
 	int16 _pixw = 1;
 	int16 _pixh = 1;
 	ClickHandlerPtr _packLink;
-	gsl::not_null<DocumentData*> _data;
+	not_null<DocumentData*> _data;
 	QString _emoji;
 
 };
 
 class HistoryContact : public HistoryMedia {
 public:
-	HistoryContact(gsl::not_null<HistoryItem*> parent, int32 userId, const QString &first, const QString &last, const QString &phone);
+	HistoryContact(not_null<HistoryItem*> parent, int32 userId, const QString &first, const QString &last, const QString &phone);
 	HistoryMediaType type() const override {
 		return MediaTypeContact;
 	}
@@ -717,7 +717,7 @@ private:
 
 class HistoryCall : public HistoryMedia {
 public:
-	HistoryCall(gsl::not_null<HistoryItem*> parent, const MTPDmessageActionPhoneCall &call);
+	HistoryCall(not_null<HistoryItem*> parent, const MTPDmessageActionPhoneCall &call);
 	HistoryMediaType type() const override {
 		return MediaTypeCall;
 	}
@@ -772,8 +772,8 @@ private:
 
 class HistoryWebPage : public HistoryMedia {
 public:
-	HistoryWebPage(gsl::not_null<HistoryItem*> parent, gsl::not_null<WebPageData*> data);
-	HistoryWebPage(gsl::not_null<HistoryItem*> parent, const HistoryWebPage &other);
+	HistoryWebPage(not_null<HistoryItem*> parent, not_null<WebPageData*> data);
+	HistoryWebPage(not_null<HistoryItem*> parent, const HistoryWebPage &other);
 	HistoryMediaType type() const override {
 		return MediaTypeWebPage;
 	}
@@ -829,7 +829,7 @@ public:
 	bool hasReplyPreview() const override;
 	ImagePtr replyPreview() override;
 
-	gsl::not_null<WebPageData*> webpage() {
+	not_null<WebPageData*> webpage() {
 		return _data;
 	}
 
@@ -858,7 +858,7 @@ private:
 	int bottomInfoPadding() const;
 	bool isLogEntryOriginal() const;
 
-	gsl::not_null<WebPageData*> _data;
+	not_null<WebPageData*> _data;
 	ClickHandlerPtr _openl;
 	std::unique_ptr<HistoryMedia> _attach;
 
@@ -878,8 +878,8 @@ private:
 
 class HistoryGame : public HistoryMedia {
 public:
-	HistoryGame(gsl::not_null<HistoryItem*> parent, GameData *data);
-	HistoryGame(gsl::not_null<HistoryItem*> parent, const HistoryGame &other);
+	HistoryGame(not_null<HistoryItem*> parent, GameData *data);
+	HistoryGame(not_null<HistoryItem*> parent, const HistoryGame &other);
 	HistoryMediaType type() const override {
 		return MediaTypeGame;
 	}
@@ -985,8 +985,8 @@ private:
 
 class HistoryInvoice : public HistoryMedia {
 public:
-	HistoryInvoice(gsl::not_null<HistoryItem*> parent, const MTPDmessageMediaInvoice &data);
-	HistoryInvoice(gsl::not_null<HistoryItem*> parent, const HistoryInvoice &other);
+	HistoryInvoice(not_null<HistoryItem*> parent, const MTPDmessageMediaInvoice &data);
+	HistoryInvoice(not_null<HistoryItem*> parent, const HistoryInvoice &other);
 	HistoryMediaType type() const override {
 		return MediaTypeInvoice;
 	}
@@ -1079,8 +1079,8 @@ struct LocationData;
 
 class HistoryLocation : public HistoryMedia {
 public:
-	HistoryLocation(gsl::not_null<HistoryItem*> parent, const LocationCoords &coords, const QString &title = QString(), const QString &description = QString());
-	HistoryLocation(gsl::not_null<HistoryItem*> parent, const HistoryLocation &other);
+	HistoryLocation(not_null<HistoryItem*> parent, const LocationCoords &coords, const QString &title = QString(), const QString &description = QString());
+	HistoryLocation(not_null<HistoryItem*> parent, const HistoryLocation &other);
 	HistoryMediaType type() const override {
 		return MediaTypeLocation;
 	}
diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp
index 73732c17dc..b8196d30a8 100644
--- a/Telegram/SourceFiles/history/history_message.cpp
+++ b/Telegram/SourceFiles/history/history_message.cpp
@@ -78,7 +78,7 @@ style::color fromNameFgSelected(int index) {
 	return colors[index];
 }
 
-MTPDmessage::Flags NewForwardedFlags(gsl::not_null<PeerData*> peer, UserId from, gsl::not_null<HistoryMessage*> fwd) {
+MTPDmessage::Flags NewForwardedFlags(not_null<PeerData*> peer, UserId from, not_null<HistoryMessage*> fwd) {
 	auto result = NewMessageFlags(peer) | MTPDmessage::Flag::f_fwd_from;
 	if (from) {
 		result |= MTPDmessage::Flag::f_from_id;
@@ -170,7 +170,7 @@ bool HasInlineItems(const SelectedItemSet &items) {
 
 } // namespace
 
-void FastShareMessage(gsl::not_null<HistoryItem*> item) {
+void FastShareMessage(not_null<HistoryItem*> item) {
 	struct ShareData {
 		ShareData(const FullMsgId &msgId) : msgId(msgId) {
 		}
@@ -291,7 +291,7 @@ base::lambda<void(ChannelData*, MsgId)> HistoryDependentItemCallback(const FullM
 	};
 }
 
-MTPDmessage::Flags NewMessageFlags(gsl::not_null<PeerData*> peer) {
+MTPDmessage::Flags NewMessageFlags(not_null<PeerData*> peer) {
 	MTPDmessage::Flags result = 0;
 	if (!peer->isSelf()) {
 		result |= MTPDmessage::Flag::f_out;
@@ -302,7 +302,7 @@ MTPDmessage::Flags NewMessageFlags(gsl::not_null<PeerData*> peer) {
 	return result;
 }
 
-QString GetErrorTextForForward(gsl::not_null<PeerData*> peer, const SelectedItemSet &items) {
+QString GetErrorTextForForward(not_null<PeerData*> peer, const SelectedItemSet &items) {
 	if (!peer->canWrite()) {
 		return lang(lng_forward_cant);
 	}
@@ -551,7 +551,7 @@ const style::TextStyle &HistoryMessage::KeyboardStyle::textStyle() const {
 	return st::serviceTextStyle;
 }
 
-void HistoryMessage::KeyboardStyle::repaint(gsl::not_null<const HistoryItem*> item) const {
+void HistoryMessage::KeyboardStyle::repaint(not_null<const HistoryItem*> item) const {
 	Ui::repaintHistoryItem(item);
 }
 
@@ -605,7 +605,7 @@ int HistoryMessage::KeyboardStyle::minButtonWidth(HistoryMessageReplyMarkup::But
 	return result;
 }
 
-HistoryMessage::HistoryMessage(gsl::not_null<History*> history, const MTPDmessage &msg)
+HistoryMessage::HistoryMessage(not_null<History*> history, const MTPDmessage &msg)
 : HistoryItem(history, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) {
 	CreateConfig config;
 
@@ -634,7 +634,7 @@ HistoryMessage::HistoryMessage(gsl::not_null<History*> history, const MTPDmessag
 	setText({ text, entities });
 }
 
-HistoryMessage::HistoryMessage(gsl::not_null<History*> history, const MTPDmessageService &msg)
+HistoryMessage::HistoryMessage(not_null<History*> history, const MTPDmessageService &msg)
 : HistoryItem(history, msg.vid.v, mtpCastFlags(msg.vflags.v), ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) {
 	CreateConfig config;
 
@@ -653,7 +653,7 @@ HistoryMessage::HistoryMessage(gsl::not_null<History*> history, const MTPDmessag
 	setText(TextWithEntities {});
 }
 
-HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId id, MTPDmessage::Flags flags, QDateTime date, UserId from, const QString &postAuthor, gsl::not_null<HistoryMessage*> fwd)
+HistoryMessage::HistoryMessage(not_null<History*> history, MsgId id, MTPDmessage::Flags flags, QDateTime date, UserId from, const QString &postAuthor, not_null<HistoryMessage*> fwd)
 : HistoryItem(history, id, NewForwardedFlags(history->peer, from, fwd) | flags, date, from) {
 	CreateConfig config;
 
@@ -704,14 +704,14 @@ HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId id, MTPDme
 	setText(fwd->originalText());
 }
 
-HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId id, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, const TextWithEntities &textWithEntities)
+HistoryMessage::HistoryMessage(not_null<History*> history, MsgId id, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, const TextWithEntities &textWithEntities)
 	: HistoryItem(history, id, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) {
 	createComponentsHelper(flags, replyTo, viaBotId, postAuthor, MTPnullMarkup);
 
 	setText(textWithEntities);
 }
 
-HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup)
+HistoryMessage::HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup)
 	: HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) {
 	createComponentsHelper(flags, replyTo, viaBotId, postAuthor, markup);
 
@@ -719,7 +719,7 @@ HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTP
 	setText(TextWithEntities());
 }
 
-HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup)
+HistoryMessage::HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup)
 	: HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) {
 	createComponentsHelper(flags, replyTo, viaBotId, postAuthor, markup);
 
@@ -727,7 +727,7 @@ HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTP
 	setText(TextWithEntities());
 }
 
-HistoryMessage::HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, GameData *game, const MTPReplyMarkup &markup)
+HistoryMessage::HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, GameData *game, const MTPReplyMarkup &markup)
 	: HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) {
 	createComponentsHelper(flags, replyTo, viaBotId, postAuthor, markup);
 
diff --git a/Telegram/SourceFiles/history/history_message.h b/Telegram/SourceFiles/history/history_message.h
index 9bbd2adac2..0ef8c76b45 100644
--- a/Telegram/SourceFiles/history/history_message.h
+++ b/Telegram/SourceFiles/history/history_message.h
@@ -22,31 +22,31 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 void HistoryInitMessages();
 base::lambda<void(ChannelData*, MsgId)> HistoryDependentItemCallback(const FullMsgId &msgId);
-MTPDmessage::Flags NewMessageFlags(gsl::not_null<PeerData*> peer);
-QString GetErrorTextForForward(gsl::not_null<PeerData*> peer, const SelectedItemSet &items);
-void FastShareMessage(gsl::not_null<HistoryItem*> item);
+MTPDmessage::Flags NewMessageFlags(not_null<PeerData*> peer);
+QString GetErrorTextForForward(not_null<PeerData*> peer, const SelectedItemSet &items);
+void FastShareMessage(not_null<HistoryItem*> item);
 
 class HistoryMessage : public HistoryItem, private HistoryItemInstantiated<HistoryMessage> {
 public:
-	static gsl::not_null<HistoryMessage*> create(gsl::not_null<History*> history, const MTPDmessage &msg) {
+	static not_null<HistoryMessage*> create(not_null<History*> history, const MTPDmessage &msg) {
 		return _create(history, msg);
 	}
-	static gsl::not_null<HistoryMessage*> create(gsl::not_null<History*> history, const MTPDmessageService &msg) {
+	static not_null<HistoryMessage*> create(not_null<History*> history, const MTPDmessageService &msg) {
 		return _create(history, msg);
 	}
-	static gsl::not_null<HistoryMessage*> create(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, QDateTime date, UserId from, const QString &postAuthor, gsl::not_null<HistoryMessage*> fwd) {
+	static not_null<HistoryMessage*> create(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, QDateTime date, UserId from, const QString &postAuthor, not_null<HistoryMessage*> fwd) {
 		return _create(history, msgId, flags, date, from, postAuthor, fwd);
 	}
-	static gsl::not_null<HistoryMessage*> create(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, const TextWithEntities &textWithEntities) {
+	static not_null<HistoryMessage*> create(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, const TextWithEntities &textWithEntities) {
 		return _create(history, msgId, flags, replyTo, viaBotId, date, from, postAuthor, textWithEntities);
 	}
-	static gsl::not_null<HistoryMessage*> create(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup) {
+	static not_null<HistoryMessage*> create(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup) {
 		return _create(history, msgId, flags, replyTo, viaBotId, date, from, postAuthor, doc, caption, markup);
 	}
-	static gsl::not_null<HistoryMessage*> create(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup) {
+	static not_null<HistoryMessage*> create(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup) {
 		return _create(history, msgId, flags, replyTo, viaBotId, date, from, postAuthor, photo, caption, markup);
 	}
-	static gsl::not_null<HistoryMessage*> create(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, GameData *game, const MTPReplyMarkup &markup) {
+	static not_null<HistoryMessage*> create(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, GameData *game, const MTPReplyMarkup &markup) {
 		return _create(history, msgId, flags, replyTo, viaBotId, date, from, postAuthor, game, markup);
 	}
 
@@ -146,13 +146,13 @@ public:
 	~HistoryMessage();
 
 private:
-	HistoryMessage(gsl::not_null<History*> history, const MTPDmessage &msg);
-	HistoryMessage(gsl::not_null<History*> history, const MTPDmessageService &msg);
-	HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, QDateTime date, UserId from, const QString &postAuthor, gsl::not_null<HistoryMessage*> fwd); // local forwarded
-	HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, const TextWithEntities &textWithEntities); // local message
-	HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup); // local document
-	HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup); // local photo
-	HistoryMessage(gsl::not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, GameData *game, const MTPReplyMarkup &markup); // local game
+	HistoryMessage(not_null<History*> history, const MTPDmessage &msg);
+	HistoryMessage(not_null<History*> history, const MTPDmessageService &msg);
+	HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, QDateTime date, UserId from, const QString &postAuthor, not_null<HistoryMessage*> fwd); // local forwarded
+	HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, const TextWithEntities &textWithEntities); // local message
+	HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup); // local document
+	HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup); // local photo
+	HistoryMessage(not_null<History*> history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, UserId viaBotId, QDateTime date, UserId from, const QString &postAuthor, GameData *game, const MTPReplyMarkup &markup); // local game
 	friend class HistoryItemInstantiated<HistoryMessage>;
 
 	void setEmptyText();
@@ -218,7 +218,7 @@ private:
 
 		void startPaint(Painter &p) const override;
 		const style::TextStyle &textStyle() const override;
-		void repaint(gsl::not_null<const HistoryItem*> item) const override;
+		void repaint(not_null<const HistoryItem*> item) const override;
 
 	protected:
 		void paintButtonBg(Painter &p, const QRect &rect, float64 howMuchOver) const override;
diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp
index 2adba8cfc9..ef35648d2b 100644
--- a/Telegram/SourceFiles/history/history_service.cpp
+++ b/Telegram/SourceFiles/history/history_service.cpp
@@ -400,17 +400,17 @@ HistoryService::PreparedText HistoryService::preparePaymentSentText() {
 	return result;
 }
 
-HistoryService::HistoryService(gsl::not_null<History*> history, const MTPDmessage &message) :
+HistoryService::HistoryService(not_null<History*> history, const MTPDmessage &message) :
 	HistoryItem(history, message.vid.v, message.vflags.v, ::date(message.vdate), message.has_from_id() ? message.vfrom_id.v : 0) {
 	createFromMtp(message);
 }
 
-HistoryService::HistoryService(gsl::not_null<History*> history, const MTPDmessageService &message) :
+HistoryService::HistoryService(not_null<History*> history, const MTPDmessageService &message) :
 	HistoryItem(history, message.vid.v, mtpCastFlags(message.vflags.v), ::date(message.vdate), message.has_from_id() ? message.vfrom_id.v : 0) {
 	createFromMtp(message);
 }
 
-HistoryService::HistoryService(gsl::not_null<History*> history, MsgId msgId, QDateTime date, const PreparedText &message, MTPDmessage::Flags flags, int32 from, PhotoData *photo) :
+HistoryService::HistoryService(not_null<History*> history, MsgId msgId, QDateTime date, const PreparedText &message, MTPDmessage::Flags flags, int32 from, PhotoData *photo) :
 	HistoryItem(history, msgId, flags, date, from) {
 	setServiceText(message);
 	if (photo) {
@@ -772,11 +772,11 @@ HistoryService::~HistoryService() {
 	_media.reset();
 }
 
-HistoryJoined::HistoryJoined(gsl::not_null<History*> history, const QDateTime &inviteDate, gsl::not_null<UserData*> inviter, MTPDmessage::Flags flags)
+HistoryJoined::HistoryJoined(not_null<History*> history, const QDateTime &inviteDate, not_null<UserData*> inviter, MTPDmessage::Flags flags)
 	: HistoryService(history, clientMsgId(), inviteDate, GenerateText(history, inviter), flags) {
 }
 
-HistoryJoined::PreparedText HistoryJoined::GenerateText(gsl::not_null<History*> history, gsl::not_null<UserData*> inviter) {
+HistoryJoined::PreparedText HistoryJoined::GenerateText(not_null<History*> history, not_null<UserData*> inviter) {
 	if (inviter->id == Auth().userPeerId()) {
 		return { lang(history->isMegagroup() ? lng_action_you_joined_group : lng_action_you_joined) };
 	}
diff --git a/Telegram/SourceFiles/history/history_service.h b/Telegram/SourceFiles/history/history_service.h
index 500080f7fd..d95007ab77 100644
--- a/Telegram/SourceFiles/history/history_service.h
+++ b/Telegram/SourceFiles/history/history_service.h
@@ -58,13 +58,13 @@ public:
 		QList<ClickHandlerPtr> links;
 	};
 
-	static gsl::not_null<HistoryService*> create(gsl::not_null<History*> history, const MTPDmessage &message) {
+	static not_null<HistoryService*> create(not_null<History*> history, const MTPDmessage &message) {
 		return _create(history, message);
 	}
-	static gsl::not_null<HistoryService*> create(gsl::not_null<History*> history, const MTPDmessageService &message) {
+	static not_null<HistoryService*> create(not_null<History*> history, const MTPDmessageService &message) {
 		return _create(history, message);
 	}
-	static gsl::not_null<HistoryService*> create(gsl::not_null<History*> history, MsgId msgId, QDateTime date, const PreparedText &message, MTPDmessage::Flags flags = 0, UserId from = 0, PhotoData *photo = nullptr) {
+	static not_null<HistoryService*> create(not_null<History*> history, MsgId msgId, QDateTime date, const PreparedText &message, MTPDmessage::Flags flags = 0, UserId from = 0, PhotoData *photo = nullptr) {
 		return _create(history, msgId, date, message, flags, from, photo);
 	}
 
@@ -116,9 +116,9 @@ public:
 protected:
 	friend class HistoryLayout::ServiceMessagePainter;
 
-	HistoryService(gsl::not_null<History*> history, const MTPDmessage &message);
-	HistoryService(gsl::not_null<History*> history, const MTPDmessageService &message);
-	HistoryService(gsl::not_null<History*> history, MsgId msgId, QDateTime date, const PreparedText &message, MTPDmessage::Flags flags = 0, UserId from = 0, PhotoData *photo = 0);
+	HistoryService(not_null<History*> history, const MTPDmessage &message);
+	HistoryService(not_null<History*> history, const MTPDmessageService &message);
+	HistoryService(not_null<History*> history, MsgId msgId, QDateTime date, const PreparedText &message, MTPDmessage::Flags flags = 0, UserId from = 0, PhotoData *photo = 0);
 	friend class HistoryItemInstantiated<HistoryService>;
 
 	void initDimensions() override;
@@ -168,17 +168,17 @@ private:
 
 class HistoryJoined : public HistoryService, private HistoryItemInstantiated<HistoryJoined> {
 public:
-	static gsl::not_null<HistoryJoined*> create(gsl::not_null<History*> history, const QDateTime &inviteDate, gsl::not_null<UserData*> inviter, MTPDmessage::Flags flags) {
+	static not_null<HistoryJoined*> create(not_null<History*> history, const QDateTime &inviteDate, not_null<UserData*> inviter, MTPDmessage::Flags flags) {
 		return _create(history, inviteDate, inviter, flags);
 	}
 
 protected:
-	HistoryJoined(gsl::not_null<History*> history, const QDateTime &inviteDate, gsl::not_null<UserData*> inviter, MTPDmessage::Flags flags);
+	HistoryJoined(not_null<History*> history, const QDateTime &inviteDate, not_null<UserData*> inviter, MTPDmessage::Flags flags);
 	using HistoryItemInstantiated<HistoryJoined>::_create;
 	friend class HistoryItemInstantiated<HistoryJoined>;
 
 private:
-	static PreparedText GenerateText(gsl::not_null<History*> history, gsl::not_null<UserData*> inviter);
+	static PreparedText GenerateText(not_null<History*> history, not_null<UserData*> inviter);
 
 };
 
diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp
index f2efbdf37f..fea788a9e3 100644
--- a/Telegram/SourceFiles/history/history_widget.cpp
+++ b/Telegram/SourceFiles/history/history_widget.cpp
@@ -607,7 +607,7 @@ QPoint SilentToggle::tooltipPos() const {
 	return QCursor::pos();
 }
 
-HistoryWidget::HistoryWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : Window::AbstractSectionWidget(parent, controller)
+HistoryWidget::HistoryWidget(QWidget *parent, not_null<Window::Controller*> controller) : Window::AbstractSectionWidget(parent, controller)
 , _fieldBarCancel(this, st::historyReplyCancel)
 , _topBar(this, controller)
 , _scroll(this, st::historyScroll, false)
@@ -955,7 +955,7 @@ void HistoryWidget::highlightMessage(HistoryItem *context) {
 	}
 }
 
-int HistoryWidget::itemTopForHighlight(gsl::not_null<HistoryItem*> item) const {
+int HistoryWidget::itemTopForHighlight(not_null<HistoryItem*> item) const {
 	auto itemTop = _list->itemTop(item);
 	t_assert(itemTop >= 0);
 
@@ -3281,7 +3281,7 @@ void HistoryWidget::hideSingleUseKeyboard(PeerData *peer, MsgId replyTo) {
 	}
 }
 
-void HistoryWidget::app_sendBotCallback(const HistoryMessageReplyMarkup::Button *button, gsl::not_null<const HistoryItem*> msg, int row, int col) {
+void HistoryWidget::app_sendBotCallback(const HistoryMessageReplyMarkup::Button *button, not_null<const HistoryItem*> msg, int row, int col) {
 	if (msg->id < 0 || _peer != msg->history()->peer) {
 		return;
 	}
@@ -4642,7 +4642,7 @@ void HistoryWidget::grabFinish() {
 	_topShadow->show();
 }
 
-void HistoryWidget::ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item) {
+void HistoryWidget::ui_repaintHistoryItem(not_null<const HistoryItem*> item) {
 	if (_peer && _list && (item->history() == _history || (_migrated && item->history() == _migrated))) {
 		auto ms = getms();
 		if (_lastScrolled + kSkipRepaintWhileScrollMs <= ms) {
diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h
index 8d2c3df4ac..8664ae88ba 100644
--- a/Telegram/SourceFiles/history/history_widget.h
+++ b/Telegram/SourceFiles/history/history_widget.h
@@ -170,7 +170,7 @@ class HistoryWidget final : public Window::AbstractSectionWidget, public RPCSend
 	Q_OBJECT
 
 public:
-	HistoryWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	HistoryWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void start();
 
@@ -349,9 +349,9 @@ public:
 	bool wheelEventFromFloatPlayer(QEvent *e, Window::Column myColumn, Window::Column playerColumn) override;
 	QRect rectForFloatPlayer(Window::Column myColumn, Window::Column playerColumn) override;
 
-	void app_sendBotCallback(const HistoryMessageReplyMarkup::Button *button, gsl::not_null<const HistoryItem*> msg, int row, int col);
+	void app_sendBotCallback(const HistoryMessageReplyMarkup::Button *button, not_null<const HistoryItem*> msg, int row, int col);
 
-	void ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item);
+	void ui_repaintHistoryItem(not_null<const HistoryItem*> item);
 	PeerData *ui_getPeerForMouseAction();
 
 	void notify_historyItemLayoutChanged(const HistoryItem *item);
@@ -662,7 +662,7 @@ private:
 	// Counts scrollTop for placing the scroll right at the unread
 	// messages bar, choosing from _history and _migrated unreadBar.
 	int unreadBarTop() const;
-	int itemTopForHighlight(gsl::not_null<HistoryItem*> item) const;
+	int itemTopForHighlight(not_null<HistoryItem*> item) const;
 	void scrollToCurrentVoiceMessage(FullMsgId fromId, FullMsgId toId);
 
 	// Scroll to current y without updating the _lastUserScrolled time.
diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
index 97eccc7b3b..7158b2e25b 100644
--- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
+++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp
@@ -37,10 +37,10 @@ namespace InlineBots {
 namespace Layout {
 namespace internal {
 
-FileBase::FileBase(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result) {
+FileBase::FileBase(not_null<Context*> context, Result *result) : ItemBase(context, result) {
 }
 
-FileBase::FileBase(gsl::not_null<Context*> context, DocumentData *document) : ItemBase(context, document) {
+FileBase::FileBase(not_null<Context*> context, DocumentData *document) : ItemBase(context, document) {
 }
 
 DocumentData *FileBase::getShownDocument() const {
@@ -94,10 +94,10 @@ ImagePtr FileBase::content_thumb() const {
 	return getResultThumb();
 }
 
-Gif::Gif(gsl::not_null<Context*> context, Result *result) : FileBase(context, result) {
+Gif::Gif(not_null<Context*> context, Result *result) : FileBase(context, result) {
 }
 
-Gif::Gif(gsl::not_null<Context*> context, DocumentData *document, bool hasDeleteButton) : FileBase(context, document) {
+Gif::Gif(not_null<Context*> context, DocumentData *document, bool hasDeleteButton) : FileBase(context, document) {
 	if (hasDeleteButton) {
 		_delete = MakeShared<DeleteSavedGifClickHandler>(document);
 	}
@@ -358,7 +358,7 @@ void Gif::clipCallback(Media::Clip::Notification notification) {
 	}
 }
 
-Sticker::Sticker(gsl::not_null<Context*> context, Result *result) : FileBase(context, result) {
+Sticker::Sticker(not_null<Context*> context, Result *result) : FileBase(context, result) {
 }
 
 void Sticker::initDimensions() {
@@ -458,7 +458,7 @@ void Sticker::prepareThumb() const {
 	}
 }
 
-Photo::Photo(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result) {
+Photo::Photo(not_null<Context*> context, Result *result) : ItemBase(context, result) {
 }
 
 void Photo::initDimensions() {
@@ -554,7 +554,7 @@ void Photo::prepareThumb(int32 width, int32 height, const QSize &frame) const {
 	}
 }
 
-Video::Video(gsl::not_null<Context*> context, Result *result) : FileBase(context, result)
+Video::Video(not_null<Context*> context, Result *result) : FileBase(context, result)
 , _link(getResultContentUrlHandler())
 , _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip)
 , _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip) {
@@ -671,7 +671,7 @@ void CancelFileClickHandler::onClickImpl() const {
 	_result->cancelFile();
 }
 
-File::File(gsl::not_null<Context*> context, Result *result) : FileBase(context, result)
+File::File(not_null<Context*> context, Result *result) : FileBase(context, result)
 , _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::msgFileSize - st::inlineThumbSkip)
 , _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::msgFileSize - st::inlineThumbSkip)
 , _open(MakeShared<OpenFileClickHandler>(result))
@@ -881,7 +881,7 @@ void File::setStatusSize(int32 newSize, int32 fullSize, int32 duration, qint64 r
 	}
 }
 
-Contact::Contact(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result)
+Contact::Contact(not_null<Context*> context, Result *result) : ItemBase(context, result)
 , _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip)
 , _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip) {
 }
@@ -970,7 +970,7 @@ void Contact::prepareThumb(int width, int height) const {
 	}
 }
 
-Article::Article(gsl::not_null<Context*> context, Result *result, bool withThumb) : ItemBase(context, result)
+Article::Article(not_null<Context*> context, Result *result, bool withThumb) : ItemBase(context, result)
 , _url(getResultUrlHandler())
 , _link(getResultContentUrlHandler())
 , _withThumb(withThumb)
@@ -1117,7 +1117,7 @@ void Article::prepareThumb(int width, int height) const {
 	}
 }
 
-Game::Game(gsl::not_null<Context*> context, Result *result) : ItemBase(context, result)
+Game::Game(not_null<Context*> context, Result *result) : ItemBase(context, result)
 , _title(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip)
 , _description(st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft - st::inlineThumbSize - st::inlineThumbSkip) {
 	countFrameSize();
diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h
index a6ecb85876..464a66d5e4 100644
--- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h
+++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.h
@@ -30,9 +30,9 @@ namespace internal {
 
 class FileBase : public ItemBase {
 public:
-	FileBase(gsl::not_null<Context*> context, Result *result);
+	FileBase(not_null<Context*> context, Result *result);
 	// for saved gif layouts
-	FileBase(gsl::not_null<Context*> context, DocumentData *doc);
+	FileBase(not_null<Context*> context, DocumentData *doc);
 
 protected:
 	DocumentData *getShownDocument() const;
@@ -58,8 +58,8 @@ private:
 
 class Gif : public FileBase {
 public:
-	Gif(gsl::not_null<Context*> context, Result *result);
-	Gif(gsl::not_null<Context*> context, DocumentData *doc, bool hasDeleteButton);
+	Gif(not_null<Context*> context, Result *result);
+	Gif(not_null<Context*> context, DocumentData *doc, bool hasDeleteButton);
 
 	void setPosition(int32 position) override;
 	void initDimensions() override;
@@ -117,9 +117,9 @@ private:
 
 class Photo : public ItemBase {
 public:
-	Photo(gsl::not_null<Context*> context, Result *result);
+	Photo(not_null<Context*> context, Result *result);
 	// Not used anywhere currently.
-	//Photo(gsl::not_null<Context*> context, PhotoData *photo);
+	//Photo(not_null<Context*> context, PhotoData *photo);
 
 	void initDimensions() override;
 
@@ -146,9 +146,9 @@ private:
 
 class Sticker : public FileBase {
 public:
-	Sticker(gsl::not_null<Context*> context, Result *result);
+	Sticker(not_null<Context*> context, Result *result);
 	// Not used anywhere currently.
-	//Sticker(gsl::not_null<Context*> context, DocumentData *document);
+	//Sticker(not_null<Context*> context, DocumentData *document);
 
 	void initDimensions() override;
 
@@ -180,7 +180,7 @@ private:
 
 class Video : public FileBase {
 public:
-	Video(gsl::not_null<Context*> context, Result *result);
+	Video(not_null<Context*> context, Result *result);
 
 	void initDimensions() override;
 
@@ -227,7 +227,7 @@ private:
 
 class File : public FileBase {
 public:
-	File(gsl::not_null<Context*> context, Result *result);
+	File(not_null<Context*> context, Result *result);
 
 	void initDimensions() override;
 
@@ -289,7 +289,7 @@ private:
 
 class Contact : public ItemBase {
 public:
-	Contact(gsl::not_null<Context*> context, Result *result);
+	Contact(not_null<Context*> context, Result *result);
 
 	void initDimensions() override;
 	int resizeGetHeight(int width) override;
@@ -307,7 +307,7 @@ private:
 
 class Article : public ItemBase {
 public:
-	Article(gsl::not_null<Context*> context, Result *result, bool withThumb);
+	Article(not_null<Context*> context, Result *result, bool withThumb);
 
 	void initDimensions() override;
 	int resizeGetHeight(int width) override;
@@ -330,7 +330,7 @@ private:
 
 class Game : public ItemBase {
 public:
-	Game(gsl::not_null<Context*> context, Result *result);
+	Game(not_null<Context*> context, Result *result);
 
 	void setPosition(int32 position) override;
 	void initDimensions() override;
diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp
index 9fa6d1ee10..3ae0e1da37 100644
--- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp
+++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp
@@ -105,7 +105,7 @@ void ItemBase::layoutChanged() {
 	}
 }
 
-std::unique_ptr<ItemBase> ItemBase::createLayout(gsl::not_null<Context*> context, Result *result, bool forceThumb) {
+std::unique_ptr<ItemBase> ItemBase::createLayout(not_null<Context*> context, Result *result, bool forceThumb) {
 	using Type = Result::Type;
 
 	switch (result->_type) {
@@ -124,7 +124,7 @@ std::unique_ptr<ItemBase> ItemBase::createLayout(gsl::not_null<Context*> context
 	return nullptr;
 }
 
-std::unique_ptr<ItemBase> ItemBase::createLayoutGif(gsl::not_null<Context*> context, DocumentData *document) {
+std::unique_ptr<ItemBase> ItemBase::createLayoutGif(not_null<Context*> context, DocumentData *document) {
 	return std::make_unique<internal::Gif>(context, document, true);
 }
 
diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h
index 5dbf0705ff..f817b458a0 100644
--- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h
+++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.h
@@ -56,12 +56,12 @@ public:
 
 class ItemBase : public LayoutItemBase {
 public:
-	ItemBase(gsl::not_null<Context*> context, Result *result) : _result(result), _context(context) {
+	ItemBase(not_null<Context*> context, Result *result) : _result(result), _context(context) {
 	}
-	ItemBase(gsl::not_null<Context*> context, DocumentData *doc) : _doc(doc), _context(context) {
+	ItemBase(not_null<Context*> context, DocumentData *doc) : _doc(doc), _context(context) {
 	}
 	// Not used anywhere currently.
-	//ItemBase(gsl::not_null<Context*> context, PhotoData *photo) : _photo(photo), _context(context) {
+	//ItemBase(not_null<Context*> context, PhotoData *photo) : _photo(photo), _context(context) {
 	//}
 
 	virtual void paint(Painter &p, const QRect &clip, const PaintContext *context) const = 0;
@@ -98,8 +98,8 @@ public:
 		update();
 	}
 
-	static std::unique_ptr<ItemBase> createLayout(gsl::not_null<Context*> context, Result *result, bool forceThumb);
-	static std::unique_ptr<ItemBase> createLayoutGif(gsl::not_null<Context*> context, DocumentData *document);
+	static std::unique_ptr<ItemBase> createLayout(not_null<Context*> context, Result *result, bool forceThumb);
+	static std::unique_ptr<ItemBase> createLayoutGif(not_null<Context*> context, DocumentData *document);
 
 protected:
 	DocumentData *getResultDocument() const;
@@ -112,7 +112,7 @@ protected:
 	ClickHandlerPtr getResultContentUrlHandler() const;
 	QString getResultThumbLetter() const;
 
-	gsl::not_null<Context*> context() const {
+	not_null<Context*> context() const {
 		return _context;
 	}
 
@@ -125,7 +125,7 @@ protected:
 	int _position = 0; // < 0 means removed from layout
 
 private:
-	gsl::not_null<Context*> _context;
+	not_null<Context*> _context;
 
 };
 
diff --git a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp
index 54ad943105..e1435b737c 100644
--- a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp
+++ b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp
@@ -48,7 +48,7 @@ constexpr auto kInlineBotRequestDelay = 400;
 
 } // namespace
 
-Inner::Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
+Inner::Inner(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
 , _controller(controller) {
 	resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, st::emojiPanMinHeight);
 
@@ -711,7 +711,7 @@ void Inner::onSwitchPm() {
 
 } // namespace internal
 
-Widget::Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
+Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
 , _controller(controller)
 , _contentMaxHeight(st::emojiPanMaxHeight)
 , _contentHeight(_contentMaxHeight)
diff --git a/Telegram/SourceFiles/inline_bots/inline_results_widget.h b/Telegram/SourceFiles/inline_bots/inline_results_widget.h
index 09d55173ce..6316c88366 100644
--- a/Telegram/SourceFiles/inline_bots/inline_results_widget.h
+++ b/Telegram/SourceFiles/inline_bots/inline_results_widget.h
@@ -63,7 +63,7 @@ class Inner : public TWidget, public Context, private base::Subscriber {
 	Q_OBJECT
 
 public:
-	Inner(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	Inner(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void hideFinish(bool completely);
 
@@ -118,7 +118,7 @@ private:
 
 	void refreshSwitchPmButton(const CacheEntry *entry);
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 	int _visibleTop = 0;
 	int _visibleBottom = 0;
@@ -170,7 +170,7 @@ class Widget : public TWidget, private MTP::Sender {
 	Q_OBJECT
 
 public:
-	Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	Widget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void moveBottom(int bottom);
 
@@ -240,7 +240,7 @@ private:
 	bool refreshInlineRows(int *added = nullptr);
 	void inlineResultsDone(const MTPmessages_BotResults &result);
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 	int _contentMaxHeight = 0;
 	int _contentHeight = 0;
diff --git a/Telegram/SourceFiles/lang/lang_cloud_manager.cpp b/Telegram/SourceFiles/lang/lang_cloud_manager.cpp
index 5f7bfae0a1..5e1b3605dd 100644
--- a/Telegram/SourceFiles/lang/lang_cloud_manager.cpp
+++ b/Telegram/SourceFiles/lang/lang_cloud_manager.cpp
@@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace Lang {
 
-CloudManager::CloudManager(Instance &langpack, gsl::not_null<MTP::Instance*> mtproto) : MTP::Sender()
+CloudManager::CloudManager(Instance &langpack, not_null<MTP::Instance*> mtproto) : MTP::Sender()
 , _langpack(langpack) {
 	requestLangPackDifference();
 }
diff --git a/Telegram/SourceFiles/lang/lang_cloud_manager.h b/Telegram/SourceFiles/lang/lang_cloud_manager.h
index 9140581fed..d272502e7d 100644
--- a/Telegram/SourceFiles/lang/lang_cloud_manager.h
+++ b/Telegram/SourceFiles/lang/lang_cloud_manager.h
@@ -33,7 +33,7 @@ class Instance;
 
 class CloudManager : public base::enable_weak_from_this, private MTP::Sender, private base::Subscriber {
 public:
-	CloudManager(Instance &langpack, gsl::not_null<MTP::Instance*> mtproto);
+	CloudManager(Instance &langpack, not_null<MTP::Instance*> mtproto);
 
 	struct Language {
 		QString id;
diff --git a/Telegram/SourceFiles/layerwidget.cpp b/Telegram/SourceFiles/layerwidget.cpp
index 71a9ce779d..e4df03910f 100644
--- a/Telegram/SourceFiles/layerwidget.cpp
+++ b/Telegram/SourceFiles/layerwidget.cpp
@@ -730,7 +730,7 @@ LayerStackWidget::~LayerStackWidget() {
 	if (App::wnd()) App::wnd()->noLayerStack(this);
 }
 
-MediaPreviewWidget::MediaPreviewWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
+MediaPreviewWidget::MediaPreviewWidget(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
 , _controller(controller)
 , _emojiSize(Ui::Emoji::Size(Ui::Emoji::Index() + 1) / cIntRetinaFactor()) {
 	setAttribute(Qt::WA_TransparentForMouseEvents);
diff --git a/Telegram/SourceFiles/layerwidget.h b/Telegram/SourceFiles/layerwidget.h
index 3cf4a17f76..a516bdc4d8 100644
--- a/Telegram/SourceFiles/layerwidget.h
+++ b/Telegram/SourceFiles/layerwidget.h
@@ -169,7 +169,7 @@ class MediaPreviewWidget : public TWidget, private base::Subscriber {
 	Q_OBJECT
 
 public:
-	MediaPreviewWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	MediaPreviewWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	void showPreview(DocumentData *document);
 	void showPreview(PhotoData *photo);
@@ -188,7 +188,7 @@ private:
 	void fillEmojiString();
 	void resetGifAndCache();
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 	Animation _a_shown;
 	bool _hiding = false;
@@ -197,7 +197,7 @@ private:
 	Media::Clip::ReaderPointer _gif;
 
 	int _emojiSize;
-	std::vector<gsl::not_null<EmojiPtr>> _emojiList;
+	std::vector<not_null<EmojiPtr>> _emojiList;
 
 	void clipCallback(Media::Clip::Notification notification);
 
diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp
index 0d65916200..59b046b94e 100644
--- a/Telegram/SourceFiles/mainwidget.cpp
+++ b/Telegram/SourceFiles/mainwidget.cpp
@@ -115,7 +115,7 @@ MainWidget::Float::Float(QWidget *parent, HistoryItem *item, ToggleCallback togg
 }) {
 }
 
-MainWidget::MainWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
+MainWidget::MainWidget(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
 , _controller(controller)
 , _dialogsWidth(st::dialogsWidthMin)
 , _sideShadow(this, st::shadowFg)
@@ -251,10 +251,10 @@ void MainWidget::checkCurrentFloatPlayer() {
 			if (auto media = item->getMedia()) {
 				if (auto document = media->getDocument()) {
 					if (document->isRoundVideo()) {
-						_playerFloats.push_back(std::make_unique<Float>(this, item, [this](gsl::not_null<Float*> instance, bool visible) {
+						_playerFloats.push_back(std::make_unique<Float>(this, item, [this](not_null<Float*> instance, bool visible) {
 							instance->hiddenByWidget = !visible;
 							toggleFloatPlayer(instance);
-						}, [this](gsl::not_null<Float*> instance, bool closed) {
+						}, [this](not_null<Float*> instance, bool closed) {
 							finishFloatPlayerDrag(instance, closed);
 						}));
 						currentFloatPlayer()->column = Auth().data().floatPlayerColumn();
@@ -267,7 +267,7 @@ void MainWidget::checkCurrentFloatPlayer() {
 	}
 }
 
-void MainWidget::toggleFloatPlayer(gsl::not_null<Float*> instance) {
+void MainWidget::toggleFloatPlayer(not_null<Float*> instance) {
 	auto visible = !instance->hiddenByHistory && !instance->hiddenByWidget && instance->widget->isReady();
 	if (instance->visible != visible) {
 		instance->widget->resetMouseState();
@@ -298,7 +298,7 @@ void MainWidget::checkFloatPlayerVisibility() {
 	updateFloatPlayerPosition(instance);
 }
 
-void MainWidget::updateFloatPlayerPosition(gsl::not_null<Float*> instance) {
+void MainWidget::updateFloatPlayerPosition(not_null<Float*> instance) {
 	auto visible = instance->visibleAnimation.current(instance->visible ? 1. : 0.);
 	if (visible == 0. && !instance->visible) {
 		instance->widget->hide();
@@ -347,7 +347,7 @@ QPoint MainWidget::getFloatPlayerHiddenPosition(QPoint position, QSize size, Rec
 	Unexpected("Bad side in MainWidget::getFloatPlayerHiddenPosition().");
 }
 
-QPoint MainWidget::getFloatPlayerPosition(gsl::not_null<Float*> instance) const {
+QPoint MainWidget::getFloatPlayerPosition(not_null<Float*> instance) const {
 	auto column = instance->column;
 	auto section = getFloatPlayerSection(&column);
 	auto rect = section->rectForFloatPlayer(column, instance->column);
@@ -376,7 +376,7 @@ RectPart MainWidget::getFloatPlayerSide(QPoint center) const {
 	return RectPart::Bottom;
 }
 
-void MainWidget::removeFloatPlayer(gsl::not_null<Float*> instance) {
+void MainWidget::removeFloatPlayer(not_null<Float*> instance) {
 	auto widget = std::move(instance->widget);
 	auto i = std::find_if(_playerFloats.begin(), _playerFloats.end(), [instance](auto &item) {
 		return (item.get() == instance);
@@ -391,7 +391,7 @@ void MainWidget::removeFloatPlayer(gsl::not_null<Float*> instance) {
 	widget.destroy();
 }
 
-Window::AbstractSectionWidget *MainWidget::getFloatPlayerSection(gsl::not_null<Window::Column*> column) const {
+Window::AbstractSectionWidget *MainWidget::getFloatPlayerSection(not_null<Window::Column*> column) const {
 	if (!Adaptive::Normal()) {
 		*column = Adaptive::OneColumn() ? Window::Column::First : Window::Column::Second;
 		if (Adaptive::OneColumn() && selectingPeer()) {
@@ -476,7 +476,7 @@ void MainWidget::updateFloatPlayerColumnCorner(QPoint center) {
 	}
 }
 
-void MainWidget::finishFloatPlayerDrag(gsl::not_null<Float*> instance, bool closed) {
+void MainWidget::finishFloatPlayerDrag(not_null<Float*> instance, bool closed) {
 	instance->dragFrom = instance->widget->pos();
 	auto center = instance->widget->geometry().center();
 	if (closed) {
@@ -795,7 +795,7 @@ void MainWidget::notify_migrateUpdated(PeerData *peer) {
 	_history->notify_migrateUpdated(peer);
 }
 
-void MainWidget::ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item) {
+void MainWidget::ui_repaintHistoryItem(not_null<const HistoryItem*> item) {
 	if (item->isLogEntry()) {
 		Auth().data().repaintLogEntry().notify(item, true);
 	} else {
@@ -1165,7 +1165,7 @@ void MainWidget::clearHistory(PeerData *peer) {
 	MTP::send(MTPmessages_DeleteHistory(MTP_flags(flags), peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, request));
 }
 
-void MainWidget::addParticipants(PeerData *chatOrChannel, const std::vector<gsl::not_null<UserData*>> &users) {
+void MainWidget::addParticipants(PeerData *chatOrChannel, const std::vector<not_null<UserData*>> &users) {
 	if (chatOrChannel->isChat()) {
 		auto chat = chatOrChannel->asChat();
 		for_const (auto user, users) {
@@ -1970,7 +1970,7 @@ void MainWidget::inlineResultLoadFailed(FileLoader *loader, bool started) {
 	//Ui::repaintInlineItem();
 }
 
-void MainWidget::mediaMarkRead(gsl::not_null<DocumentData*> data) {
+void MainWidget::mediaMarkRead(not_null<DocumentData*> data) {
 	auto &items = App::documentItems();
 	auto i = items.constFind(data);
 	if (i != items.cend()) {
@@ -2002,7 +2002,7 @@ void MainWidget::mediaMarkRead(const HistoryItemsMap &items) {
 	}
 }
 
-void MainWidget::mediaMarkRead(gsl::not_null<HistoryItem*> item) {
+void MainWidget::mediaMarkRead(not_null<HistoryItem*> item) {
 	if ((!item->out() || item->mentionsMe()) && item->isMediaUnread()) {
 		item->markMediaRead();
 		if (item->id > 0) {
diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h
index f1be08d99f..4c56f61967 100644
--- a/Telegram/SourceFiles/mainwidget.h
+++ b/Telegram/SourceFiles/mainwidget.h
@@ -153,7 +153,7 @@ class MainWidget : public TWidget, public RPCSender, private base::Subscriber {
 	Q_OBJECT
 
 public:
-	MainWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	MainWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	bool isSectionShown() const;
 
@@ -271,7 +271,7 @@ public:
 	void clearHistory(PeerData *peer);
 	void deleteAllFromUser(ChannelData *channel, UserData *from);
 
-	void addParticipants(PeerData *chatOrChannel, const std::vector<gsl::not_null<UserData*>> &users);
+	void addParticipants(PeerData *chatOrChannel, const std::vector<not_null<UserData*>> &users);
 	struct UserAndPeer {
 		UserData *user;
 		PeerData *peer;
@@ -316,7 +316,7 @@ public:
 	void hideSingleUseKeyboard(PeerData *peer, MsgId replyTo);
 	bool insertBotCommand(const QString &cmd);
 
-	void jumpToDate(gsl::not_null<PeerData*> peer, const QDate &date);
+	void jumpToDate(not_null<PeerData*> peer, const QDate &date);
 	void searchMessages(const QString &query, PeerData *inPeer);
 	bool preloadOverview(PeerData *peer, MediaOverviewType type);
 	void itemEdited(HistoryItem *item);
@@ -348,9 +348,9 @@ public:
 	void cancelForwarding(History *history);
 	void finishForwarding(History *history, bool silent); // send them
 
-	void mediaMarkRead(gsl::not_null<DocumentData*> data);
+	void mediaMarkRead(not_null<DocumentData*> data);
 	void mediaMarkRead(const HistoryItemsMap &items);
-	void mediaMarkRead(gsl::not_null<HistoryItem*> item);
+	void mediaMarkRead(not_null<HistoryItem*> item);
 
 	void webPageUpdated(WebPageData *page);
 	void gameUpdated(GameData *game);
@@ -385,7 +385,7 @@ public:
 
 	void app_sendBotCallback(const HistoryMessageReplyMarkup::Button *button, const HistoryItem *msg, int row, int col);
 
-	void ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item);
+	void ui_repaintHistoryItem(not_null<const HistoryItem*> item);
 	void ui_showPeerHistory(quint64 peer, qint32 msgId, Ui::ShowWay way);
 	PeerData *ui_getPeerForMouseAction();
 
@@ -569,17 +569,17 @@ private:
 
 	void clearCachedBackground();
 	void checkCurrentFloatPlayer();
-	void toggleFloatPlayer(gsl::not_null<Float*> instance);
+	void toggleFloatPlayer(not_null<Float*> instance);
 	void checkFloatPlayerVisibility();
-	void updateFloatPlayerPosition(gsl::not_null<Float*> instance);
-	void removeFloatPlayer(gsl::not_null<Float*> instance);
+	void updateFloatPlayerPosition(not_null<Float*> instance);
+	void removeFloatPlayer(not_null<Float*> instance);
 	Float *currentFloatPlayer() const {
 		return _playerFloats.empty() ? nullptr : _playerFloats.back().get();
 	}
-	Window::AbstractSectionWidget *getFloatPlayerSection(gsl::not_null<Window::Column*> column) const;
-	void finishFloatPlayerDrag(gsl::not_null<Float*> instance, bool closed);
+	Window::AbstractSectionWidget *getFloatPlayerSection(not_null<Window::Column*> column) const;
+	void finishFloatPlayerDrag(not_null<Float*> instance, bool closed);
 	void updateFloatPlayerColumnCorner(QPoint center);
-	QPoint getFloatPlayerPosition(gsl::not_null<Float*> instance) const;
+	QPoint getFloatPlayerPosition(not_null<Float*> instance) const;
 	QPoint getFloatPlayerHiddenPosition(QPoint position, QSize size, RectPart side) const;
 	RectPart getFloatPlayerSide(QPoint center) const;
 
@@ -591,7 +591,7 @@ private:
 	void viewsIncrementDone(QVector<MTPint> ids, const MTPVector<MTPint> &result, mtpRequestId req);
 	bool viewsIncrementFail(const RPCError &error, mtpRequestId req);
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 	bool _started = false;
 
 	OrderedSet<WebPageId> _webPagesUpdated;
diff --git a/Telegram/SourceFiles/media/media_audio_track.cpp b/Telegram/SourceFiles/media/media_audio_track.cpp
index 092d074092..51efe4a773 100644
--- a/Telegram/SourceFiles/media/media_audio_track.cpp
+++ b/Telegram/SourceFiles/media/media_audio_track.cpp
@@ -54,7 +54,7 @@ ALuint CreateBuffer() {
 
 } // namespace
 
-Track::Track(gsl::not_null<Instance*> instance) : _instance(instance) {
+Track::Track(not_null<Instance*> instance) : _instance(instance) {
 	_instance->registerTrack(this);
 }
 
diff --git a/Telegram/SourceFiles/media/media_audio_track.h b/Telegram/SourceFiles/media/media_audio_track.h
index 84f2339a92..b14a12c407 100644
--- a/Telegram/SourceFiles/media/media_audio_track.h
+++ b/Telegram/SourceFiles/media/media_audio_track.h
@@ -29,7 +29,7 @@ class Instance;
 
 class Track {
 public:
-	Track(gsl::not_null<Instance*> instance);
+	Track(not_null<Instance*> instance);
 
 	void samplePeakEach(TimeMs peakDuration);
 
@@ -70,7 +70,7 @@ private:
 	void ensureSourceCreated();
 	void playWithLooping(bool looping);
 
-	gsl::not_null<Instance*> _instance;
+	not_null<Instance*> _instance;
 
 	bool _failed = false;
 	bool _active = false;
diff --git a/Telegram/SourceFiles/media/media_clip_reader.cpp b/Telegram/SourceFiles/media/media_clip_reader.cpp
index 2f6ae3b2cb..960aece0dd 100644
--- a/Telegram/SourceFiles/media/media_clip_reader.cpp
+++ b/Telegram/SourceFiles/media/media_clip_reader.cpp
@@ -100,7 +100,7 @@ Reader::Reader(const QString &filepath, Callback &&callback, Mode mode, int64 se
 	init(FileLocation(filepath), QByteArray());
 }
 
-Reader::Reader(gsl::not_null<DocumentData*> document, FullMsgId msgId, Callback &&callback, Mode mode, int64 seekMs)
+Reader::Reader(not_null<DocumentData*> document, FullMsgId msgId, Callback &&callback, Mode mode, int64 seekMs)
 : _callback(std::move(callback))
 , _mode(mode)
 , _audioMsgId(document, msgId, (mode == Mode::Video) ? rand_value<uint32>() : 0)
diff --git a/Telegram/SourceFiles/media/media_clip_reader.h b/Telegram/SourceFiles/media/media_clip_reader.h
index 260d36532e..dae972eae6 100644
--- a/Telegram/SourceFiles/media/media_clip_reader.h
+++ b/Telegram/SourceFiles/media/media_clip_reader.h
@@ -62,7 +62,7 @@ public:
 	};
 
 	Reader(const QString &filepath, Callback &&callback, Mode mode = Mode::Gif, TimeMs seekMs = 0);
-	Reader(gsl::not_null<DocumentData*> document, FullMsgId msgId, Callback &&callback, Mode mode = Mode::Gif, TimeMs seekMs = 0);
+	Reader(not_null<DocumentData*> document, FullMsgId msgId, Callback &&callback, Mode mode = Mode::Gif, TimeMs seekMs = 0);
 
 	static void callback(Reader *reader, int threadIndex, Notification notification); // reader can be deleted
 
diff --git a/Telegram/SourceFiles/media/player/media_player_float.h b/Telegram/SourceFiles/media/player/media_player_float.h
index 6b47b99147..d175e36ca9 100644
--- a/Telegram/SourceFiles/media/player/media_player_float.h
+++ b/Telegram/SourceFiles/media/player/media_player_float.h
@@ -59,7 +59,7 @@ public:
 			finishDrag(false);
 		}
 	}
-	void ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item) {
+	void ui_repaintHistoryItem(not_null<const HistoryItem*> item) {
 		if (item == _item) {
 			repaintItem();
 		}
diff --git a/Telegram/SourceFiles/media/player/media_player_list.cpp b/Telegram/SourceFiles/media/player/media_player_list.cpp
index a4e915d387..fcc9e61556 100644
--- a/Telegram/SourceFiles/media/player/media_player_list.cpp
+++ b/Telegram/SourceFiles/media/player/media_player_list.cpp
@@ -118,7 +118,7 @@ void ListWidget::mouseMoveEvent(QMouseEvent *e) {
 	}
 }
 
-void ListWidget::ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item) {
+void ListWidget::ui_repaintHistoryItem(not_null<const HistoryItem*> item) {
 	repaintItem(item);
 }
 
diff --git a/Telegram/SourceFiles/media/player/media_player_list.h b/Telegram/SourceFiles/media/player/media_player_list.h
index 1f7193b8d1..b2a6973c53 100644
--- a/Telegram/SourceFiles/media/player/media_player_list.h
+++ b/Telegram/SourceFiles/media/player/media_player_list.h
@@ -33,7 +33,7 @@ class ListWidget : public TWidget, private base::Subscriber {
 public:
 	ListWidget(QWidget *parent);
 
-	void ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item);
+	void ui_repaintHistoryItem(not_null<const HistoryItem*> item);
 
 	QRect getCurrentTrackGeometry() const;
 
diff --git a/Telegram/SourceFiles/media/player/media_player_panel.cpp b/Telegram/SourceFiles/media/player/media_player_panel.cpp
index a166294fb0..179ed04d7f 100644
--- a/Telegram/SourceFiles/media/player/media_player_panel.cpp
+++ b/Telegram/SourceFiles/media/player/media_player_panel.cpp
@@ -96,7 +96,7 @@ void Panel::updateControlsGeometry() {
 	}
 }
 
-void Panel::ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item) {
+void Panel::ui_repaintHistoryItem(not_null<const HistoryItem*> item) {
 	if (auto list = static_cast<ListWidget*>(_scroll->widget())) {
 		list->ui_repaintHistoryItem(item);
 	}
diff --git a/Telegram/SourceFiles/media/player/media_player_panel.h b/Telegram/SourceFiles/media/player/media_player_panel.h
index 902aa9f754..20c3234cdf 100644
--- a/Telegram/SourceFiles/media/player/media_player_panel.h
+++ b/Telegram/SourceFiles/media/player/media_player_panel.h
@@ -52,7 +52,7 @@ public:
 	void setPinCallback(ButtonCallback &&callback);
 	void setCloseCallback(ButtonCallback &&callback);
 
-	void ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item);
+	void ui_repaintHistoryItem(not_null<const HistoryItem*> item);
 
 	int bestPositionFor(int left) const;
 
diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp
index 967ce90bbe..60ba3d41d4 100644
--- a/Telegram/SourceFiles/mediaview.cpp
+++ b/Telegram/SourceFiles/mediaview.cpp
@@ -2957,7 +2957,7 @@ float64 MediaView::overLevel(OverState control) const {
 	return (i == _animOpacities.cend()) ? (_over == control ? 1 : 0) : i->current();
 }
 
-MsgId MediaView::getMsgIdFromOverview(gsl::not_null<History*> history, int index) const {
+MsgId MediaView::getMsgIdFromOverview(not_null<History*> history, int index) const {
 	auto &overview = history->overview(_overview);
 	if (index >= 0 && index < overview.size()) {
 		auto it = overview.begin();
diff --git a/Telegram/SourceFiles/mediaview.h b/Telegram/SourceFiles/mediaview.h
index a200c88db1..b75eac532d 100644
--- a/Telegram/SourceFiles/mediaview.h
+++ b/Telegram/SourceFiles/mediaview.h
@@ -224,7 +224,7 @@ private:
 	bool updateOverState(OverState newState);
 	float64 overLevel(OverState control) const;
 
-	MsgId getMsgIdFromOverview(gsl::not_null<History*> history, int index) const;
+	MsgId getMsgIdFromOverview(not_null<History*> history, int index) const;
 
 	QBrush _transparentBrush;
 
diff --git a/Telegram/SourceFiles/messenger.cpp b/Telegram/SourceFiles/messenger.cpp
index f176526507..e32ad2bbd3 100644
--- a/Telegram/SourceFiles/messenger.cpp
+++ b/Telegram/SourceFiles/messenger.cpp
@@ -195,27 +195,27 @@ bool Messenger::hideMediaView() {
 	return false;
 }
 
-void Messenger::showPhoto(gsl::not_null<const PhotoOpenClickHandler*> link, HistoryItem *item) {
+void Messenger::showPhoto(not_null<const PhotoOpenClickHandler*> link, HistoryItem *item) {
 	return (!item && link->peer())
 		? showPhoto(link->photo(), link->peer())
 		: showPhoto(link->photo(), item);
 }
 
-void Messenger::showPhoto(gsl::not_null<PhotoData*> photo, HistoryItem *item) {
+void Messenger::showPhoto(not_null<PhotoData*> photo, HistoryItem *item) {
 	if (_mediaView->isHidden()) Ui::hideLayer(true);
 	_mediaView->showPhoto(photo, item);
 	_mediaView->activateWindow();
 	_mediaView->setFocus();
 }
 
-void Messenger::showPhoto(gsl::not_null<PhotoData*> photo, PeerData *peer) {
+void Messenger::showPhoto(not_null<PhotoData*> photo, PeerData *peer) {
 	if (_mediaView->isHidden()) Ui::hideLayer(true);
 	_mediaView->showPhoto(photo, peer);
 	_mediaView->activateWindow();
 	_mediaView->setFocus();
 }
 
-void Messenger::showDocument(gsl::not_null<DocumentData*> document, HistoryItem *item) {
+void Messenger::showDocument(not_null<DocumentData*> document, HistoryItem *item) {
 	if (cUseExternalVideoPlayer() && document->isVideo()) {
 		QDesktopServices::openUrl(QUrl("file:///" + document->location(false).fname));
 	} else {
diff --git a/Telegram/SourceFiles/messenger.h b/Telegram/SourceFiles/messenger.h
index 779bc85e2b..be21734257 100644
--- a/Telegram/SourceFiles/messenger.h
+++ b/Telegram/SourceFiles/messenger.h
@@ -82,10 +82,10 @@ public:
 	// MediaView interface.
 	void checkMediaViewActivation();
 	bool hideMediaView();
-	void showPhoto(gsl::not_null<const PhotoOpenClickHandler*> link, HistoryItem *item = nullptr);
-	void showPhoto(gsl::not_null<PhotoData*> photo, HistoryItem *item);
-	void showPhoto(gsl::not_null<PhotoData*> photo, PeerData *item);
-	void showDocument(gsl::not_null<DocumentData*> document, HistoryItem *item);
+	void showPhoto(not_null<const PhotoOpenClickHandler*> link, HistoryItem *item = nullptr);
+	void showPhoto(not_null<PhotoData*> photo, HistoryItem *item);
+	void showPhoto(not_null<PhotoData*> photo, PeerData *item);
+	void showDocument(not_null<DocumentData*> document, HistoryItem *item);
 	PeerData *ui_getPeerForMouseAction();
 
 	QPoint getPointForCallPanelCenter() const;
diff --git a/Telegram/SourceFiles/mtproto/config_loader.cpp b/Telegram/SourceFiles/mtproto/config_loader.cpp
index c507f038c5..525e060d2a 100644
--- a/Telegram/SourceFiles/mtproto/config_loader.cpp
+++ b/Telegram/SourceFiles/mtproto/config_loader.cpp
@@ -33,7 +33,7 @@ constexpr auto kSpecialRequestTimeoutMs = 6000; // 4 seconds timeout for it to w
 
 } // namespace
 
-ConfigLoader::ConfigLoader(gsl::not_null<Instance*> instance, RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail) : _instance(instance)
+ConfigLoader::ConfigLoader(not_null<Instance*> instance, RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail) : _instance(instance)
 	, _doneHandler(onDone)
 	, _failHandler(onFail) {
 	_enumDCTimer.setCallback([this] { enumerate(); });
diff --git a/Telegram/SourceFiles/mtproto/config_loader.h b/Telegram/SourceFiles/mtproto/config_loader.h
index 6df54a954c..9d4c708558 100644
--- a/Telegram/SourceFiles/mtproto/config_loader.h
+++ b/Telegram/SourceFiles/mtproto/config_loader.h
@@ -33,7 +33,7 @@ namespace internal {
 
 class ConfigLoader : public base::enable_weak_from_this {
 public:
-	ConfigLoader(gsl::not_null<Instance*> instance, RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail);
+	ConfigLoader(not_null<Instance*> instance, RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail);
 	~ConfigLoader();
 
 	void load();
@@ -49,7 +49,7 @@ private:
 	void terminateRequest();
 	void terminateSpecialRequest();
 
-	gsl::not_null<Instance*> _instance;
+	not_null<Instance*> _instance;
 	base::Timer _enumDCTimer;
 	DcId _enumCurrent = 0;
 	mtpRequestId _enumRequest = 0;
diff --git a/Telegram/SourceFiles/mtproto/dc_options.cpp b/Telegram/SourceFiles/mtproto/dc_options.cpp
index bf293cfff3..61f37159f0 100644
--- a/Telegram/SourceFiles/mtproto/dc_options.cpp
+++ b/Telegram/SourceFiles/mtproto/dc_options.cpp
@@ -33,7 +33,7 @@ public:
 	}
 
 private:
-	gsl::not_null<DcOptions*> _that;
+	not_null<DcOptions*> _that;
 	QWriteLocker _lock;
 
 };
diff --git a/Telegram/SourceFiles/mtproto/dcenter.cpp b/Telegram/SourceFiles/mtproto/dcenter.cpp
index b4750f6dfb..754ccc5de3 100644
--- a/Telegram/SourceFiles/mtproto/dcenter.cpp
+++ b/Telegram/SourceFiles/mtproto/dcenter.cpp
@@ -36,7 +36,7 @@ constexpr auto kSpecialRequestTimeoutMs = 6000; // 4 seconds timeout for it to w
 
 } // namespace
 
-Dcenter::Dcenter(gsl::not_null<Instance*> instance, DcId dcId, AuthKeyPtr &&key)
+Dcenter::Dcenter(not_null<Instance*> instance, DcId dcId, AuthKeyPtr &&key)
 : _instance(instance)
 , _id(dcId)
 , _key(std::move(key)) {
diff --git a/Telegram/SourceFiles/mtproto/dcenter.h b/Telegram/SourceFiles/mtproto/dcenter.h
index 59a2aa87e1..fa01645f70 100644
--- a/Telegram/SourceFiles/mtproto/dcenter.h
+++ b/Telegram/SourceFiles/mtproto/dcenter.h
@@ -32,7 +32,7 @@ class Dcenter : public QObject {
 	Q_OBJECT
 
 public:
-	Dcenter(gsl::not_null<Instance*> instance, DcId dcId, AuthKeyPtr &&key);
+	Dcenter(not_null<Instance*> instance, DcId dcId, AuthKeyPtr &&key);
 
 	QReadWriteLock *keyMutex() const;
 	const AuthKeyPtr &getKey() const;
@@ -59,7 +59,7 @@ private slots:
 private:
 	mutable QReadWriteLock keyLock;
 	mutable QMutex initLock;
-	gsl::not_null<Instance*> _instance;
+	not_null<Instance*> _instance;
 	DcId _id = 0;
 	AuthKeyPtr _key;
 	bool _connectionInited = false;
diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp
index e71241e571..f6906199b2 100644
--- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp
+++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp
@@ -38,7 +38,7 @@ namespace MTP {
 
 class Instance::Private : private Sender {
 public:
-	Private(gsl::not_null<Instance*> instance, gsl::not_null<DcOptions*> options, Instance::Mode mode);
+	Private(not_null<Instance*> instance, not_null<DcOptions*> options, Instance::Mode mode);
 
 	void start(Config &&config);
 
@@ -50,7 +50,7 @@ public:
 	AuthKeysList getKeysForWrite() const;
 	void addKeysForDestroy(AuthKeysList &&keys);
 
-	gsl::not_null<DcOptions*> dcOptions();
+	not_null<DcOptions*> dcOptions();
 
 	void requestConfig();
 	void requestCDNConfig();
@@ -137,8 +137,8 @@ private:
 
 	void checkDelayedRequests();
 
-	gsl::not_null<Instance*> _instance;
-	gsl::not_null<DcOptions*> _dcOptions;
+	not_null<Instance*> _instance;
+	not_null<DcOptions*> _dcOptions;
 	Instance::Mode _mode = Instance::Mode::Normal;
 
 	DcId _mainDcId = Config::kDefaultMainDc;
@@ -194,7 +194,7 @@ private:
 
 };
 
-Instance::Private::Private(gsl::not_null<Instance*> instance, gsl::not_null<DcOptions*> options, Instance::Mode mode) : Sender()
+Instance::Private::Private(not_null<Instance*> instance, not_null<DcOptions*> options, Instance::Mode mode) : Sender()
 , _instance(instance)
 , _dcOptions(options)
 , _mode(mode) {
@@ -556,7 +556,7 @@ void Instance::Private::addKeysForDestroy(AuthKeysList &&keys) {
 	}
 }
 
-gsl::not_null<DcOptions*> Instance::Private::dcOptions() {
+not_null<DcOptions*> Instance::Private::dcOptions() {
 	return _dcOptions;
 }
 
@@ -1272,7 +1272,7 @@ void Instance::Private::prepareToDestroy() {
 	MustNotCreateSessions = true;
 }
 
-Instance::Instance(gsl::not_null<DcOptions*> options, Mode mode, Config &&config) : QObject()
+Instance::Instance(not_null<DcOptions*> options, Mode mode, Config &&config) : QObject()
 , _private(std::make_unique<Private>(this, options, mode)) {
 	_private->start(std::move(config));
 }
@@ -1369,7 +1369,7 @@ void Instance::addKeysForDestroy(AuthKeysList &&keys) {
 	_private->addKeysForDestroy(std::move(keys));
 }
 
-gsl::not_null<DcOptions*> Instance::dcOptions() {
+not_null<DcOptions*> Instance::dcOptions() {
 	return _private->dcOptions();
 }
 
diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.h b/Telegram/SourceFiles/mtproto/mtp_instance.h
index ef76313fc3..32d65d1153 100644
--- a/Telegram/SourceFiles/mtproto/mtp_instance.h
+++ b/Telegram/SourceFiles/mtproto/mtp_instance.h
@@ -52,7 +52,7 @@ public:
 		SpecialConfigRequester,
 		KeysDestroyer,
 	};
-	Instance(gsl::not_null<DcOptions*> options, Mode mode, Config &&config);
+	Instance(not_null<DcOptions*> options, Mode mode, Config &&config);
 
 	Instance(const Instance &other) = delete;
 	Instance &operator=(const Instance &other) = delete;
@@ -67,7 +67,7 @@ public:
 	AuthKeysList getKeysForWrite() const;
 	void addKeysForDestroy(AuthKeysList &&keys);
 
-	gsl::not_null<DcOptions*> dcOptions();
+	not_null<DcOptions*> dcOptions();
 
 	template <typename TRequest>
 	mtpRequestId send(const TRequest &request, RPCResponseHandler callbacks = RPCResponseHandler(), ShiftedDcId dcId = 0, TimeMs msCanWait = 0, mtpRequestId after = 0) {
diff --git a/Telegram/SourceFiles/mtproto/sender.h b/Telegram/SourceFiles/mtproto/sender.h
index 42b3ca57ca..11db35d9e7 100644
--- a/Telegram/SourceFiles/mtproto/sender.h
+++ b/Telegram/SourceFiles/mtproto/sender.h
@@ -64,7 +64,7 @@ class Sender {
 			using Callback = typename Policy::Callback;
 
 		public:
-			DoneHandler(gsl::not_null<Sender*> sender, Callback handler) : _sender(sender), _handler(std::move(handler)) {
+			DoneHandler(not_null<Sender*> sender, Callback handler) : _sender(sender), _handler(std::move(handler)) {
 			}
 
 			void operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override {
@@ -79,7 +79,7 @@ class Sender {
 			}
 
 		private:
-			gsl::not_null<Sender*> _sender;
+			not_null<Sender*> _sender;
 			Callback _handler;
 
 		};
@@ -103,7 +103,7 @@ class Sender {
 			using Callback = typename Policy::Callback;
 
 		public:
-			FailHandler(gsl::not_null<Sender*> sender, Callback handler, FailSkipPolicy skipPolicy)
+			FailHandler(not_null<Sender*> sender, Callback handler, FailSkipPolicy skipPolicy)
 				: _sender(sender)
 				, _handler(std::move(handler))
 				, _skipPolicy(skipPolicy) {
@@ -130,13 +130,13 @@ class Sender {
 			}
 
 		private:
-			gsl::not_null<Sender*> _sender;
+			not_null<Sender*> _sender;
 			Callback _handler;
 			FailSkipPolicy _skipPolicy = FailSkipPolicy::Simple;
 
 		};
 
-		explicit RequestBuilder(gsl::not_null<Sender*> sender) noexcept : _sender(sender) {
+		explicit RequestBuilder(not_null<Sender*> sender) noexcept : _sender(sender) {
 		}
 		RequestBuilder(RequestBuilder &&other) = default;
 
@@ -183,7 +183,7 @@ class Sender {
 			return _afterRequestId;
 		}
 
-		gsl::not_null<Sender*> sender() const noexcept {
+		not_null<Sender*> sender() const noexcept {
 			return _sender;
 		}
 		void registerRequest(mtpRequestId requestId) {
@@ -191,7 +191,7 @@ class Sender {
 		}
 
 	private:
-		gsl::not_null<Sender*> _sender;
+		not_null<Sender*> _sender;
 		ShiftedDcId _dcId = 0;
 		TimeMs _canWait = 0;
 		RPCDoneHandlerPtr _done;
@@ -209,7 +209,7 @@ public:
 	class SpecificRequestBuilder : public RequestBuilder {
 	private:
 		friend class Sender;
-		SpecificRequestBuilder(gsl::not_null<Sender*> sender, Request &&request) noexcept : RequestBuilder(sender), _request(std::move(request)) {
+		SpecificRequestBuilder(not_null<Sender*> sender, Request &&request) noexcept : RequestBuilder(sender), _request(std::move(request)) {
 		}
 		SpecificRequestBuilder(SpecificRequestBuilder &&other) = default;
 
@@ -265,7 +265,7 @@ public:
 	class SentRequestWrap {
 	private:
 		friend class Sender;
-		SentRequestWrap(gsl::not_null<Sender*> sender, mtpRequestId requestId) : _sender(sender), _requestId(requestId) {
+		SentRequestWrap(not_null<Sender*> sender, mtpRequestId requestId) : _sender(sender), _requestId(requestId) {
 		}
 
 	public:
@@ -274,7 +274,7 @@ public:
 		}
 
 	private:
-		gsl::not_null<Sender*> _sender;
+		not_null<Sender*> _sender;
 		mtpRequestId _requestId = 0;
 
 	};
@@ -298,7 +298,7 @@ public:
 			request.handled();
 		}
 	}
-	gsl::not_null<Instance*> requestMTP() const {
+	not_null<Instance*> requestMTP() const {
 		return MainInstance();
 	}
 
diff --git a/Telegram/SourceFiles/mtproto/session.cpp b/Telegram/SourceFiles/mtproto/session.cpp
index f93a5bac52..56d5d14980 100644
--- a/Telegram/SourceFiles/mtproto/session.cpp
+++ b/Telegram/SourceFiles/mtproto/session.cpp
@@ -86,7 +86,7 @@ void SessionData::clear(Instance *instance) {
 	instance->clearCallbacksDelayed(clearCallbacks);
 }
 
-Session::Session(gsl::not_null<Instance*> instance, ShiftedDcId shiftedDcId) : QObject()
+Session::Session(not_null<Instance*> instance, ShiftedDcId shiftedDcId) : QObject()
 , _instance(instance)
 , data(this)
 , dcWithShift(shiftedDcId) {
diff --git a/Telegram/SourceFiles/mtproto/session.h b/Telegram/SourceFiles/mtproto/session.h
index 2ff8c675f7..54559d0e56 100644
--- a/Telegram/SourceFiles/mtproto/session.h
+++ b/Telegram/SourceFiles/mtproto/session.h
@@ -101,7 +101,7 @@ inline bool ResponseNeedsAck(const SerializedMessage &response) {
 class Session;
 class SessionData {
 public:
-	SessionData(gsl::not_null<Session*> creator) : _owner(creator) {
+	SessionData(not_null<Session*> creator) : _owner(creator) {
 	}
 
 	void setSession(uint64 session) {
@@ -166,27 +166,27 @@ public:
 		_keyChecked = checked;
 	}
 
-	gsl::not_null<QReadWriteLock*> keyMutex() const;
+	not_null<QReadWriteLock*> keyMutex() const;
 
-	gsl::not_null<QReadWriteLock*> toSendMutex() const {
+	not_null<QReadWriteLock*> toSendMutex() const {
 		return &_toSendLock;
 	}
-	gsl::not_null<QReadWriteLock*> haveSentMutex() const {
+	not_null<QReadWriteLock*> haveSentMutex() const {
 		return &_haveSentLock;
 	}
-	gsl::not_null<QReadWriteLock*> toResendMutex() const {
+	not_null<QReadWriteLock*> toResendMutex() const {
 		return &_toResendLock;
 	}
-	gsl::not_null<QReadWriteLock*> wereAckedMutex() const {
+	not_null<QReadWriteLock*> wereAckedMutex() const {
 		return &_wereAckedLock;
 	}
-	gsl::not_null<QReadWriteLock*> receivedIdsMutex() const {
+	not_null<QReadWriteLock*> receivedIdsMutex() const {
 		return &_receivedIdsLock;
 	}
-	gsl::not_null<QReadWriteLock*> haveReceivedMutex() const {
+	not_null<QReadWriteLock*> haveReceivedMutex() const {
 		return &_haveReceivedLock;
 	}
-	gsl::not_null<QReadWriteLock*> stateRequestMutex() const {
+	not_null<QReadWriteLock*> stateRequestMutex() const {
 		return &_stateRequestLock;
 	}
 
@@ -239,10 +239,10 @@ public:
 		return _stateRequest;
 	}
 
-	gsl::not_null<Session*> owner() {
+	not_null<Session*> owner() {
 		return _owner;
 	}
-	gsl::not_null<const Session*> owner() const {
+	not_null<const Session*> owner() const {
 		return _owner;
 	}
 
@@ -261,7 +261,7 @@ private:
 
 	uint32 _messagesSent = 0;
 
-	gsl::not_null<Session*> _owner;
+	not_null<Session*> _owner;
 
 	AuthKeyPtr _authKey;
 	bool _keyChecked = false;
@@ -295,7 +295,7 @@ class Session : public QObject {
 	Q_OBJECT
 
 public:
-	Session(gsl::not_null<Instance*> instance, ShiftedDcId shiftedDcId);
+	Session(not_null<Instance*> instance, ShiftedDcId shiftedDcId);
 
 	void start();
 	void restart();
@@ -357,7 +357,7 @@ private:
 	mtpRequest getRequest(mtpRequestId requestId);
 	bool rpcErrorOccured(mtpRequestId requestId, const RPCFailHandlerPtr &onFail, const RPCError &err);
 
-	gsl::not_null<Instance*> _instance;
+	not_null<Instance*> _instance;
 	std::unique_ptr<Connection> _connection;
 
 	bool _killed = false;
@@ -378,7 +378,7 @@ private:
 
 };
 
-inline gsl::not_null<QReadWriteLock*> SessionData::keyMutex() const {
+inline not_null<QReadWriteLock*> SessionData::keyMutex() const {
 	return _owner->keyMutex();
 }
 
diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp
index abfd97a3cb..34c22e544e 100644
--- a/Telegram/SourceFiles/overviewwidget.cpp
+++ b/Telegram/SourceFiles/overviewwidget.cpp
@@ -1950,7 +1950,7 @@ OverviewInner::~OverviewInner() {
 	clear();
 }
 
-OverviewWidget::OverviewWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, PeerData *peer, MediaOverviewType type) : Window::AbstractSectionWidget(parent, controller)
+OverviewWidget::OverviewWidget(QWidget *parent, not_null<Window::Controller*> controller, PeerData *peer, MediaOverviewType type) : Window::AbstractSectionWidget(parent, controller)
 , _topBar(this, controller)
 , _scroll(this, st::settingsScroll, false)
 , _mediaType(this, st::defaultDropdownMenu)
@@ -2290,7 +2290,7 @@ void OverviewWidget::grabFinish() {
 	_topShadow->show();
 }
 
-void OverviewWidget::ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item) {
+void OverviewWidget::ui_repaintHistoryItem(not_null<const HistoryItem*> item) {
 	if (peer() == item->history()->peer || migratePeer() == item->history()->peer) {
 		_inner->repaintItem(item);
 	}
diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h
index 7334d75140..bc0ad184bc 100644
--- a/Telegram/SourceFiles/overviewwidget.h
+++ b/Telegram/SourceFiles/overviewwidget.h
@@ -289,7 +289,7 @@ class OverviewWidget : public Window::AbstractSectionWidget, public RPCSender {
 	Q_OBJECT
 
 public:
-	OverviewWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, PeerData *peer, MediaOverviewType type);
+	OverviewWidget(QWidget *parent, not_null<Window::Controller*> controller, PeerData *peer, MediaOverviewType type);
 
 	void clear();
 
@@ -351,7 +351,7 @@ public:
 	bool wheelEventFromFloatPlayer(QEvent *e, Window::Column myColumn, Window::Column playerColumn) override;
 	QRect rectForFloatPlayer(Window::Column myColumn, Window::Column playerColumn) override;
 
-	void ui_repaintHistoryItem(gsl::not_null<const HistoryItem*> item);
+	void ui_repaintHistoryItem(not_null<const HistoryItem*> item);
 
 	void notify_historyItemLayoutChanged(const HistoryItem *item);
 
diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm
index 144b3467cb..b433bcb641 100644
--- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm
+++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm
@@ -437,7 +437,7 @@ void MainWindow::createGlobalMenu() {
 		if (App::wnd() && App::wnd()->isHidden()) App::wnd()->showFromTray();
 
 		if (!App::self()) return;
-		Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](gsl::not_null<PeerListBox*> box) {
+		Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](not_null<PeerListBox*> box) {
 			box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
 			box->addLeftButton(langFactory(lng_profile_add_contact), [] { App::wnd()->onShowAddContact(); });
 		}));
diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.cpp b/Telegram/SourceFiles/profile/profile_block_group_members.cpp
index 742c29b758..87a65c6a8c 100644
--- a/Telegram/SourceFiles/profile/profile_block_group_members.cpp
+++ b/Telegram/SourceFiles/profile/profile_block_group_members.cpp
@@ -67,7 +67,7 @@ GroupMembersWidget::GroupMembersWidget(QWidget *parent, PeerData *peer, TitleVis
 	refreshMembers();
 }
 
-void GroupMembersWidget::editAdmin(gsl::not_null<UserData*> user) {
+void GroupMembersWidget::editAdmin(not_null<UserData*> user) {
 	auto megagroup = peer()->asMegagroup();
 	if (!megagroup) {
 		return; // not supported
@@ -87,7 +87,7 @@ void GroupMembersWidget::editAdmin(gsl::not_null<UserData*> user) {
 	Ui::show(std::move(box));
 }
 
-void GroupMembersWidget::restrictUser(gsl::not_null<UserData*> user) {
+void GroupMembersWidget::restrictUser(not_null<UserData*> user) {
 	auto megagroup = peer()->asMegagroup();
 	if (!megagroup) {
 		return; // not supported
diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.h b/Telegram/SourceFiles/profile/profile_block_group_members.h
index c1b993cc60..4710bd460f 100644
--- a/Telegram/SourceFiles/profile/profile_block_group_members.h
+++ b/Telegram/SourceFiles/profile/profile_block_group_members.h
@@ -67,8 +67,8 @@ private:
 	// Observed notifications.
 	void notifyPeerUpdated(const Notify::PeerUpdate &update);
 
-	void editAdmin(gsl::not_null<UserData*> user);
-	void restrictUser(gsl::not_null<UserData*> user);
+	void editAdmin(not_null<UserData*> user);
+	void restrictUser(not_null<UserData*> user);
 	void removePeer(PeerData *selectedPeer);
 	void refreshMembers();
 	void fillChatMembers(ChatData *chat);
diff --git a/Telegram/SourceFiles/profile/profile_block_widget.h b/Telegram/SourceFiles/profile/profile_block_widget.h
index 0e73317f9b..2ed5a74085 100644
--- a/Telegram/SourceFiles/profile/profile_block_widget.h
+++ b/Telegram/SourceFiles/profile/profile_block_widget.h
@@ -35,9 +35,9 @@ public:
 	virtual void showFinished() {
 	}
 
-	virtual void saveState(gsl::not_null<SectionMemento*> memento) {
+	virtual void saveState(not_null<SectionMemento*> memento) {
 	}
-	virtual void restoreState(gsl::not_null<SectionMemento*> memento) {
+	virtual void restoreState(not_null<SectionMemento*> memento) {
 	}
 
 protected:
diff --git a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp
index aa6991896b..12d766aed6 100644
--- a/Telegram/SourceFiles/profile/profile_channel_controllers.cpp
+++ b/Telegram/SourceFiles/profile/profile_channel_controllers.cpp
@@ -38,7 +38,7 @@ constexpr auto kParticipantsPerPage = 200;
 
 } // namespace
 
-ParticipantsBoxController::ParticipantsBoxController(gsl::not_null<ChannelData*> channel, Role role) : PeerListController(CreateSearchController(channel, role, &_additional))
+ParticipantsBoxController::ParticipantsBoxController(not_null<ChannelData*> channel, Role role) : PeerListController(CreateSearchController(channel, role, &_additional))
 , _channel(channel)
 , _role(role) {
 	if (_channel->mgInfo) {
@@ -46,7 +46,7 @@ ParticipantsBoxController::ParticipantsBoxController(gsl::not_null<ChannelData*>
 	}
 }
 
-std::unique_ptr<PeerListSearchController> ParticipantsBoxController::CreateSearchController(gsl::not_null<ChannelData*> channel, Role role, gsl::not_null<Additional*> additional) {
+std::unique_ptr<PeerListSearchController> ParticipantsBoxController::CreateSearchController(not_null<ChannelData*> channel, Role role, not_null<Additional*> additional) {
 	// In admins box complex search is used for adding new admins.
 	if (role != Role::Admins || channel->canAddAdmins()) {
 		return std::make_unique<ParticipantsBoxSearchController>(channel, role, additional);
@@ -54,9 +54,9 @@ std::unique_ptr<PeerListSearchController> ParticipantsBoxController::CreateSearc
 	return nullptr;
 }
 
-void ParticipantsBoxController::Start(gsl::not_null<ChannelData*> channel, Role role) {
+void ParticipantsBoxController::Start(not_null<ChannelData*> channel, Role role) {
 	auto controller = std::make_unique<ParticipantsBoxController>(channel, role);
-	auto initBox = [role, channel, controller = controller.get()](gsl::not_null<PeerListBox*> box) {
+	auto initBox = [role, channel, controller = controller.get()](not_null<PeerListBox*> box) {
 		box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
 		auto canAddNewItem = [role, channel] {
 			switch (role) {
@@ -88,7 +88,7 @@ void ParticipantsBoxController::addNewItem() {
 		if (_channel->membersCount() >= Global::ChatSizeMax()) {
 			Ui::show(Box<MaxInviteBox>(_channel), KeepOtherLayers);
 		} else {
-			auto already = std::vector<gsl::not_null<UserData*>>();
+			auto already = std::vector<not_null<UserData*>>();
 			already.reserve(delegate()->peerListFullRowsCount());
 			for (auto i = 0, count = delegate()->peerListFullRowsCount(); i != count; ++i) {
 				already.push_back(delegate()->peerListRowAt(i)->peer()->asUser());
@@ -98,27 +98,27 @@ void ParticipantsBoxController::addNewItem() {
 		return;
 	}
 	auto weak = base::make_weak_unique(this);
-	_addBox = Ui::show(Box<PeerListBox>(std::make_unique<AddParticipantBoxController>(_channel, _role, [weak](gsl::not_null<UserData*> user, const MTPChannelAdminRights &rights) {
+	_addBox = Ui::show(Box<PeerListBox>(std::make_unique<AddParticipantBoxController>(_channel, _role, [weak](not_null<UserData*> user, const MTPChannelAdminRights &rights) {
 		if (weak) {
 			weak->editAdminDone(user, rights);
 		}
-	}, [weak](gsl::not_null<UserData*> user, const MTPChannelBannedRights &rights) {
+	}, [weak](not_null<UserData*> user, const MTPChannelBannedRights &rights) {
 		if (weak) {
 			weak->editRestrictedDone(user, rights);
 		}
-	}), [](gsl::not_null<PeerListBox*> box) {
+	}), [](not_null<PeerListBox*> box) {
 		box->addButton(langFactory(lng_cancel), [box] { box->closeBox(); });
 	}), KeepOtherLayers);
 }
 
-void ParticipantsBoxController::peerListSearchAddRow(gsl::not_null<PeerData*> peer) {
+void ParticipantsBoxController::peerListSearchAddRow(not_null<PeerData*> peer) {
 	PeerListController::peerListSearchAddRow(peer);
 	if (_role == Role::Restricted && delegate()->peerListFullRowsCount() > 0) {
 		setDescriptionText(QString());
 	}
 }
 
-std::unique_ptr<PeerListRow> ParticipantsBoxController::createSearchRow(gsl::not_null<PeerData*> peer) {
+std::unique_ptr<PeerListRow> ParticipantsBoxController::createSearchRow(not_null<PeerData*> peer) {
 	if (auto user = peer->asUser()) {
 		return createRow(user);
 	}
@@ -126,7 +126,7 @@ std::unique_ptr<PeerListRow> ParticipantsBoxController::createSearchRow(gsl::not
 }
 
 template <typename Callback>
-void ParticipantsBoxController::HandleParticipant(const MTPChannelParticipant &participant, Role role, gsl::not_null<Additional*> additional, Callback callback) {
+void ParticipantsBoxController::HandleParticipant(const MTPChannelParticipant &participant, Role role, not_null<Additional*> additional, Callback callback) {
 	if ((role == Role::Members || role == Role::Admins) && participant.type() == mtpc_channelParticipantAdmin) {
 		auto &admin = participant.c_channelParticipantAdmin();
 		if (auto user = App::userLoaded(admin.vuser_id.v)) {
@@ -245,7 +245,7 @@ void ParticipantsBoxController::loadMoreRows() {
 		} else {
 			for_const (auto &participant, list) {
 				++_offset;
-				HandleParticipant(participant, _role, &_additional, [this](gsl::not_null<UserData*> user) {
+				HandleParticipant(participant, _role, &_additional, [this](not_null<UserData*> user) {
 					appendRow(user);
 				});
 			}
@@ -301,7 +301,7 @@ bool ParticipantsBoxController::feedMegagroupLastParticipants() {
 	return true;
 }
 
-void ParticipantsBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void ParticipantsBoxController::rowClicked(not_null<PeerListRow*> row) {
 	auto user = row->peer()->asUser();
 	Expects(user != nullptr);
 
@@ -314,7 +314,7 @@ void ParticipantsBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
 	}
 }
 
-void ParticipantsBoxController::rowActionClicked(gsl::not_null<PeerListRow*> row) {
+void ParticipantsBoxController::rowActionClicked(not_null<PeerListRow*> row) {
 	auto user = row->peer()->asUser();
 	Expects(user != nullptr);
 
@@ -329,7 +329,7 @@ void ParticipantsBoxController::rowActionClicked(gsl::not_null<PeerListRow*> row
 	}
 }
 
-void ParticipantsBoxController::showAdmin(gsl::not_null<UserData*> user) {
+void ParticipantsBoxController::showAdmin(not_null<UserData*> user) {
 	auto it = _additional.adminRights.find(user);
 	auto isCreator = (user == _additional.creator);
 	auto notAdmin = !isCreator && (it == _additional.adminRights.cend());
@@ -354,7 +354,7 @@ void ParticipantsBoxController::showAdmin(gsl::not_null<UserData*> user) {
 	_editBox = Ui::show(std::move(box), KeepOtherLayers);
 }
 
-void ParticipantsBoxController::editAdminDone(gsl::not_null<UserData*> user, const MTPChannelAdminRights &rights) {
+void ParticipantsBoxController::editAdminDone(not_null<UserData*> user, const MTPChannelAdminRights &rights) {
 	if (_editBox) {
 		_editBox->closeBox();
 	}
@@ -386,7 +386,7 @@ void ParticipantsBoxController::editAdminDone(gsl::not_null<UserData*> user, con
 	delegate()->peerListRefreshRows();
 }
 
-void ParticipantsBoxController::showRestricted(gsl::not_null<UserData*> user) {
+void ParticipantsBoxController::showRestricted(not_null<UserData*> user) {
 	auto it = _additional.restrictedRights.find(user);
 	if (it == _additional.restrictedRights.cend()) {
 		return;
@@ -408,7 +408,7 @@ void ParticipantsBoxController::showRestricted(gsl::not_null<UserData*> user) {
 	_editBox = Ui::show(std::move(box), KeepOtherLayers);
 }
 
-void ParticipantsBoxController::editRestrictedDone(gsl::not_null<UserData*> user, const MTPChannelBannedRights &rights) {
+void ParticipantsBoxController::editRestrictedDone(not_null<UserData*> user, const MTPChannelBannedRights &rights) {
 	if (_editBox) {
 		_editBox->closeBox();
 	}
@@ -450,7 +450,7 @@ void ParticipantsBoxController::editRestrictedDone(gsl::not_null<UserData*> user
 	delegate()->peerListRefreshRows();
 }
 
-void ParticipantsBoxController::kickMember(gsl::not_null<UserData*> user) {
+void ParticipantsBoxController::kickMember(not_null<UserData*> user) {
 	auto text = (_channel->isMegagroup() ? lng_profile_sure_kick : lng_profile_sure_kick_channel)(lt_user, user->firstName);
 	auto weak = base::make_weak_unique(this);
 	_editBox = Ui::show(Box<ConfirmBox>(text, lang(lng_box_remove), [weak, user] {
@@ -460,7 +460,7 @@ void ParticipantsBoxController::kickMember(gsl::not_null<UserData*> user) {
 	}), KeepOtherLayers);
 }
 
-void ParticipantsBoxController::kickMemberSure(gsl::not_null<UserData*> user) {
+void ParticipantsBoxController::kickMemberSure(not_null<UserData*> user) {
 	if (_editBox) {
 		_editBox->closeBox();
 	}
@@ -474,14 +474,14 @@ void ParticipantsBoxController::kickMemberSure(gsl::not_null<UserData*> user) {
 	Auth().api().kickParticipant(_channel, user, currentRights);
 }
 
-void ParticipantsBoxController::removeKicked(gsl::not_null<PeerListRow*> row, gsl::not_null<UserData*> user) {
+void ParticipantsBoxController::removeKicked(not_null<PeerListRow*> row, not_null<UserData*> user) {
 	delegate()->peerListRemoveRow(row);
 	delegate()->peerListRefreshRows();
 
 	Auth().api().unblockParticipant(_channel, user);
 }
 
-bool ParticipantsBoxController::appendRow(gsl::not_null<UserData*> user) {
+bool ParticipantsBoxController::appendRow(not_null<UserData*> user) {
 	if (delegate()->peerListFindRow(user->id)) {
 		return false;
 	}
@@ -492,7 +492,7 @@ bool ParticipantsBoxController::appendRow(gsl::not_null<UserData*> user) {
 	return true;
 }
 
-bool ParticipantsBoxController::prependRow(gsl::not_null<UserData*> user) {
+bool ParticipantsBoxController::prependRow(not_null<UserData*> user) {
 	if (auto row = delegate()->peerListFindRow(user->id)) {
 		refreshCustomStatus(row);
 		if (_role == Role::Admins) {
@@ -508,7 +508,7 @@ bool ParticipantsBoxController::prependRow(gsl::not_null<UserData*> user) {
 	return true;
 }
 
-bool ParticipantsBoxController::removeRow(gsl::not_null<UserData*> user) {
+bool ParticipantsBoxController::removeRow(not_null<UserData*> user) {
 	if (auto row = delegate()->peerListFindRow(user->id)) {
 		if (_role == Role::Admins) {
 			// Perhaps we are removing an admin from search results.
@@ -525,7 +525,7 @@ bool ParticipantsBoxController::removeRow(gsl::not_null<UserData*> user) {
 	return false;
 }
 
-std::unique_ptr<PeerListRow> ParticipantsBoxController::createRow(gsl::not_null<UserData*> user) const {
+std::unique_ptr<PeerListRow> ParticipantsBoxController::createRow(not_null<UserData*> user) const {
 	auto row = std::make_unique<PeerListRowWithLink>(user);
 	refreshCustomStatus(row.get());
 	if (_role == Role::Restricted || (_role == Role::Admins && _additional.adminCanEdit.find(user) != _additional.adminCanEdit.cend())) {
@@ -542,7 +542,7 @@ std::unique_ptr<PeerListRow> ParticipantsBoxController::createRow(gsl::not_null<
 	return std::move(row);
 }
 
-void ParticipantsBoxController::refreshCustomStatus(gsl::not_null<PeerListRow*> row) const {
+void ParticipantsBoxController::refreshCustomStatus(not_null<PeerListRow*> row) const {
 	auto user = row->peer()->asUser();
 	if (_role == Role::Admins) {
 		auto promotedBy = _additional.adminPromotedBy.find(user);
@@ -565,7 +565,7 @@ void ParticipantsBoxController::refreshCustomStatus(gsl::not_null<PeerListRow*>
 	}
 }
 
-ParticipantsBoxSearchController::ParticipantsBoxSearchController(gsl::not_null<ChannelData*> channel, Role role, gsl::not_null<Additional*> additional)
+ParticipantsBoxSearchController::ParticipantsBoxSearchController(not_null<ChannelData*> channel, Role role, not_null<Additional*> additional)
 : _channel(channel)
 , _role(role)
 , _additional(additional) {
@@ -672,7 +672,7 @@ void ParticipantsBoxSearchController::searchDone(mtpRequestId requestId, const M
 		}
 		auto parseRole = (_role == Role::Admins) ? Role::Members : _role;
 		for_const (auto &participant, list) {
-			ParticipantsBoxController::HandleParticipant(participant, parseRole, _additional, [this](gsl::not_null<UserData*> user) {
+			ParticipantsBoxController::HandleParticipant(participant, parseRole, _additional, [this](not_null<UserData*> user) {
 				delegate()->peerListSearchAddRow(user);
 			});
 		}
@@ -681,7 +681,7 @@ void ParticipantsBoxSearchController::searchDone(mtpRequestId requestId, const M
 	}
 }
 
-AddParticipantBoxController::AddParticipantBoxController(gsl::not_null<ChannelData*> channel, Role role, AdminDoneCallback adminDoneCallback, BannedDoneCallback bannedDoneCallback) : PeerListController(std::make_unique<AddParticipantBoxSearchController>(channel, &_additional))
+AddParticipantBoxController::AddParticipantBoxController(not_null<ChannelData*> channel, Role role, AdminDoneCallback adminDoneCallback, BannedDoneCallback bannedDoneCallback) : PeerListController(std::make_unique<AddParticipantBoxSearchController>(channel, &_additional))
 , _channel(channel)
 , _role(role)
 , _adminDoneCallback(std::move(adminDoneCallback))
@@ -691,7 +691,7 @@ AddParticipantBoxController::AddParticipantBoxController(gsl::not_null<ChannelDa
 	}
 }
 
-std::unique_ptr<PeerListRow> AddParticipantBoxController::createSearchRow(gsl::not_null<PeerData*> peer) {
+std::unique_ptr<PeerListRow> AddParticipantBoxController::createSearchRow(not_null<PeerData*> peer) {
 	if (peer->isSelf()) {
 		return nullptr;
 	}
@@ -744,7 +744,7 @@ void AddParticipantBoxController::loadMoreRows() {
 		} else {
 			for_const (auto &participant, list) {
 				++_offset;
-				HandleParticipant(participant, &_additional, [this](gsl::not_null<UserData*> user) {
+				HandleParticipant(participant, &_additional, [this](not_null<UserData*> user) {
 					appendRow(user);
 				});
 			}
@@ -760,7 +760,7 @@ void AddParticipantBoxController::loadMoreRows() {
 	}).send();
 }
 
-void AddParticipantBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void AddParticipantBoxController::rowClicked(not_null<PeerListRow*> row) {
 	auto user = row->peer()->asUser();
 	switch (_role) {
 	case Role::Admins: return showAdmin(user);
@@ -771,7 +771,7 @@ void AddParticipantBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
 }
 
 template <typename Callback>
-bool AddParticipantBoxController::checkInfoLoaded(gsl::not_null<UserData*> user, Callback callback) {
+bool AddParticipantBoxController::checkInfoLoaded(not_null<UserData*> user, Callback callback) {
 	if (_additional.infoNotLoaded.find(user) == _additional.infoNotLoaded.end()) {
 		return true;
 	}
@@ -781,7 +781,7 @@ bool AddParticipantBoxController::checkInfoLoaded(gsl::not_null<UserData*> user,
 		Expects(result.type() == mtpc_channels_channelParticipant);
 		auto &participant = result.c_channels_channelParticipant();
 		App::feedUsers(participant.vusers);
-		HandleParticipant(participant.vparticipant, &_additional, [](gsl::not_null<UserData*>) {});
+		HandleParticipant(participant.vparticipant, &_additional, [](not_null<UserData*>) {});
 		_additional.infoNotLoaded.erase(user);
 		callback();
 	}).fail([this, user, callback](const RPCError &error) {
@@ -792,7 +792,7 @@ bool AddParticipantBoxController::checkInfoLoaded(gsl::not_null<UserData*> user,
 	return false;
 }
 
-void AddParticipantBoxController::showAdmin(gsl::not_null<UserData*> user, bool sure) {
+void AddParticipantBoxController::showAdmin(not_null<UserData*> user, bool sure) {
 	if (!checkInfoLoaded(user, [this, user] { showAdmin(user); })) {
 		return;
 	}
@@ -895,7 +895,7 @@ void AddParticipantBoxController::showAdmin(gsl::not_null<UserData*> user, bool
 	_editBox = Ui::show(std::move(box), KeepOtherLayers);
 }
 
-void AddParticipantBoxController::editAdminDone(gsl::not_null<UserData*> user, const MTPChannelAdminRights &rights) {
+void AddParticipantBoxController::editAdminDone(not_null<UserData*> user, const MTPChannelAdminRights &rights) {
 	if (_editBox) _editBox->closeBox();
 	_additional.restrictedRights.erase(user);
 	_additional.restrictedBy.erase(user);
@@ -918,7 +918,7 @@ void AddParticipantBoxController::editAdminDone(gsl::not_null<UserData*> user, c
 	}
 }
 
-void AddParticipantBoxController::showRestricted(gsl::not_null<UserData*> user, bool sure) {
+void AddParticipantBoxController::showRestricted(not_null<UserData*> user, bool sure) {
 	if (!checkInfoLoaded(user, [this, user] { showRestricted(user); })) {
 		return;
 	}
@@ -964,7 +964,7 @@ void AddParticipantBoxController::showRestricted(gsl::not_null<UserData*> user,
 	_editBox = Ui::show(std::move(box), KeepOtherLayers);
 }
 
-void AddParticipantBoxController::restrictUserSure(gsl::not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights) {
+void AddParticipantBoxController::restrictUserSure(not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights) {
 	auto weak = base::make_weak_unique(this);
 	MTP::send(MTPchannels_EditBanned(_channel->inputChannel, user->inputUser, newRights), rpcDone([megagroup = _channel.get(), user, weak, oldRights, newRights](const MTPUpdates &result) {
 		Auth().api().applyUpdates(result);
@@ -975,7 +975,7 @@ void AddParticipantBoxController::restrictUserSure(gsl::not_null<UserData*> user
 	}));
 }
 
-void AddParticipantBoxController::editRestrictedDone(gsl::not_null<UserData*> user, const MTPChannelBannedRights &rights) {
+void AddParticipantBoxController::editRestrictedDone(not_null<UserData*> user, const MTPChannelBannedRights &rights) {
 	if (_editBox) _editBox->closeBox();
 	_additional.adminRights.erase(user);
 	_additional.adminCanEdit.erase(user);
@@ -998,7 +998,7 @@ void AddParticipantBoxController::editRestrictedDone(gsl::not_null<UserData*> us
 	}
 }
 
-void AddParticipantBoxController::kickUser(gsl::not_null<UserData*> user, bool sure) {
+void AddParticipantBoxController::kickUser(not_null<UserData*> user, bool sure) {
 	if (!checkInfoLoaded(user, [this, user] { kickUser(user); })) {
 		return;
 	}
@@ -1041,7 +1041,7 @@ void AddParticipantBoxController::kickUser(gsl::not_null<UserData*> user, bool s
 	restrictUserSure(user, currentRights, ChannelData::KickedRestrictedRights());
 }
 
-bool AddParticipantBoxController::appendRow(gsl::not_null<UserData*> user) {
+bool AddParticipantBoxController::appendRow(not_null<UserData*> user) {
 	if (delegate()->peerListFindRow(user->id) || user->isSelf()) {
 		return false;
 	}
@@ -1049,7 +1049,7 @@ bool AddParticipantBoxController::appendRow(gsl::not_null<UserData*> user) {
 	return true;
 }
 
-bool AddParticipantBoxController::prependRow(gsl::not_null<UserData*> user) {
+bool AddParticipantBoxController::prependRow(not_null<UserData*> user) {
 	if (delegate()->peerListFindRow(user->id)) {
 		return false;
 	}
@@ -1057,12 +1057,12 @@ bool AddParticipantBoxController::prependRow(gsl::not_null<UserData*> user) {
 	return true;
 }
 
-std::unique_ptr<PeerListRow> AddParticipantBoxController::createRow(gsl::not_null<UserData*> user) const {
+std::unique_ptr<PeerListRow> AddParticipantBoxController::createRow(not_null<UserData*> user) const {
 	return std::make_unique<PeerListRow>(user);
 }
 
 template <typename Callback>
-void AddParticipantBoxController::HandleParticipant(const MTPChannelParticipant &participant, gsl::not_null<Additional*> additional, Callback callback) {
+void AddParticipantBoxController::HandleParticipant(const MTPChannelParticipant &participant, not_null<Additional*> additional, Callback callback) {
 	switch (participant.type()) {
 	case mtpc_channelParticipantAdmin: {
 		auto &admin = participant.c_channelParticipantAdmin();
@@ -1139,7 +1139,7 @@ void AddParticipantBoxController::HandleParticipant(const MTPChannelParticipant
 	}
 }
 
-AddParticipantBoxSearchController::AddParticipantBoxSearchController(gsl::not_null<ChannelData*> channel, gsl::not_null<Additional*> additional)
+AddParticipantBoxSearchController::AddParticipantBoxSearchController(not_null<ChannelData*> channel, not_null<Additional*> additional)
 : _channel(channel)
 , _additional(additional) {
 	_timer.setCallback([this] { searchOnServer(); });
@@ -1264,7 +1264,7 @@ void AddParticipantBoxSearchController::searchParticipantsDone(mtpRequestId requ
 			}
 		}
 		for_const (auto &participant, list) {
-			AddParticipantBoxController::HandleParticipant(participant, _additional, [this](gsl::not_null<UserData*> user) {
+			AddParticipantBoxController::HandleParticipant(participant, _additional, [this](not_null<UserData*> user) {
 				delegate()->peerListSearchAddRow(user);
 			});
 		}
diff --git a/Telegram/SourceFiles/profile/profile_channel_controllers.h b/Telegram/SourceFiles/profile/profile_channel_controllers.h
index 5177f88c2b..968b7f513f 100644
--- a/Telegram/SourceFiles/profile/profile_channel_controllers.h
+++ b/Telegram/SourceFiles/profile/profile_channel_controllers.h
@@ -35,56 +35,56 @@ public:
 		Restricted,
 		Kicked,
 	};
-	static void Start(gsl::not_null<ChannelData*> channel, Role role);
+	static void Start(not_null<ChannelData*> channel, Role role);
 
 	struct Additional {
-		std::map<gsl::not_null<UserData*>, MTPChannelAdminRights> adminRights;
-		std::set<gsl::not_null<UserData*>> adminCanEdit;
-		std::map<gsl::not_null<UserData*>, gsl::not_null<UserData*>> adminPromotedBy;
-		std::map<gsl::not_null<UserData*>, MTPChannelBannedRights> restrictedRights;
-		std::set<gsl::not_null<UserData*>> kicked;
-		std::map<gsl::not_null<UserData*>, gsl::not_null<UserData*>> restrictedBy;
-		std::set<gsl::not_null<UserData*>> external;
-		std::set<gsl::not_null<UserData*>> infoNotLoaded;
+		std::map<not_null<UserData*>, MTPChannelAdminRights> adminRights;
+		std::set<not_null<UserData*>> adminCanEdit;
+		std::map<not_null<UserData*>, not_null<UserData*>> adminPromotedBy;
+		std::map<not_null<UserData*>, MTPChannelBannedRights> restrictedRights;
+		std::set<not_null<UserData*>> kicked;
+		std::map<not_null<UserData*>, not_null<UserData*>> restrictedBy;
+		std::set<not_null<UserData*>> external;
+		std::set<not_null<UserData*>> infoNotLoaded;
 		UserData *creator = nullptr;
 	};
 
-	ParticipantsBoxController(gsl::not_null<ChannelData*> channel, Role role);
+	ParticipantsBoxController(not_null<ChannelData*> channel, Role role);
 
 	void addNewItem();
 
 	void prepare() override;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
-	void rowActionClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
+	void rowActionClicked(not_null<PeerListRow*> row) override;
 	void loadMoreRows() override;
 
-	void peerListSearchAddRow(gsl::not_null<PeerData*> peer) override;
-	std::unique_ptr<PeerListRow> createSearchRow(gsl::not_null<PeerData*> peer) override;
+	void peerListSearchAddRow(not_null<PeerData*> peer) override;
+	std::unique_ptr<PeerListRow> createSearchRow(not_null<PeerData*> peer) override;
 
-	// Callback(gsl::not_null<UserData*>)
+	// Callback(not_null<UserData*>)
 	template <typename Callback>
-	static void HandleParticipant(const MTPChannelParticipant &participant, Role role, gsl::not_null<Additional*> additional, Callback callback);
+	static void HandleParticipant(const MTPChannelParticipant &participant, Role role, not_null<Additional*> additional, Callback callback);
 
 protected:
-	virtual std::unique_ptr<PeerListRow> createRow(gsl::not_null<UserData*> user) const;
+	virtual std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user) const;
 
 private:
-	static std::unique_ptr<PeerListSearchController> CreateSearchController(gsl::not_null<ChannelData*> channel, Role role, gsl::not_null<Additional*> additional);
+	static std::unique_ptr<PeerListSearchController> CreateSearchController(not_null<ChannelData*> channel, Role role, not_null<Additional*> additional);
 
-	void showAdmin(gsl::not_null<UserData*> user);
-	void editAdminDone(gsl::not_null<UserData*> user, const MTPChannelAdminRights &rights);
-	void showRestricted(gsl::not_null<UserData*> user);
-	void editRestrictedDone(gsl::not_null<UserData*> user, const MTPChannelBannedRights &rights);
-	void removeKicked(gsl::not_null<PeerListRow*> row, gsl::not_null<UserData*> user);
-	void kickMember(gsl::not_null<UserData*> user);
-	void kickMemberSure(gsl::not_null<UserData*> user);
-	bool appendRow(gsl::not_null<UserData*> user);
-	bool prependRow(gsl::not_null<UserData*> user);
-	bool removeRow(gsl::not_null<UserData*> user);
-	void refreshCustomStatus(gsl::not_null<PeerListRow*> row) const;
+	void showAdmin(not_null<UserData*> user);
+	void editAdminDone(not_null<UserData*> user, const MTPChannelAdminRights &rights);
+	void showRestricted(not_null<UserData*> user);
+	void editRestrictedDone(not_null<UserData*> user, const MTPChannelBannedRights &rights);
+	void removeKicked(not_null<PeerListRow*> row, not_null<UserData*> user);
+	void kickMember(not_null<UserData*> user);
+	void kickMemberSure(not_null<UserData*> user);
+	bool appendRow(not_null<UserData*> user);
+	bool prependRow(not_null<UserData*> user);
+	bool removeRow(not_null<UserData*> user);
+	void refreshCustomStatus(not_null<PeerListRow*> row) const;
 	bool feedMegagroupLastParticipants();
 
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 	Role _role = Role::Admins;
 	int _offset = 0;
 	mtpRequestId _loadRequestId = 0;
@@ -101,7 +101,7 @@ public:
 	using Role = ParticipantsBoxController::Role;
 	using Additional = ParticipantsBoxController::Additional;
 
-	ParticipantsBoxSearchController(gsl::not_null<ChannelData*> channel, Role role, gsl::not_null<Additional*> additional);
+	ParticipantsBoxSearchController(not_null<ChannelData*> channel, Role role, not_null<Additional*> additional);
 
 	void searchQuery(const QString &query) override;
 	bool isLoading() override;
@@ -121,9 +121,9 @@ private:
 	bool searchInCache();
 	void searchDone(mtpRequestId requestId, const MTPchannels_ChannelParticipants &result, int requestedCount);
 
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 	Role _role = Role::Restricted;
-	gsl::not_null<Additional*> _additional;
+	not_null<Additional*> _additional;
 
 	base::Timer _timer;
 	QString _query;
@@ -141,35 +141,35 @@ public:
 	using Role = ParticipantsBoxController::Role;
 	using Additional = ParticipantsBoxController::Additional;
 
-	using AdminDoneCallback = base::lambda<void(gsl::not_null<UserData*> user, const MTPChannelAdminRights &adminRights)>;
-	using BannedDoneCallback = base::lambda<void(gsl::not_null<UserData*> user, const MTPChannelBannedRights &bannedRights)>;
-	AddParticipantBoxController(gsl::not_null<ChannelData*> channel, Role role, AdminDoneCallback adminDoneCallback, BannedDoneCallback bannedDoneCallback);
+	using AdminDoneCallback = base::lambda<void(not_null<UserData*> user, const MTPChannelAdminRights &adminRights)>;
+	using BannedDoneCallback = base::lambda<void(not_null<UserData*> user, const MTPChannelBannedRights &bannedRights)>;
+	AddParticipantBoxController(not_null<ChannelData*> channel, Role role, AdminDoneCallback adminDoneCallback, BannedDoneCallback bannedDoneCallback);
 
 	void prepare() override;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
 	void loadMoreRows() override;
 
-	std::unique_ptr<PeerListRow> createSearchRow(gsl::not_null<PeerData*> peer) override;
+	std::unique_ptr<PeerListRow> createSearchRow(not_null<PeerData*> peer) override;
 
-	// Callback(gsl::not_null<UserData*>)
+	// Callback(not_null<UserData*>)
 	template <typename Callback>
-	static void HandleParticipant(const MTPChannelParticipant &participant, gsl::not_null<Additional*> additional, Callback callback);
+	static void HandleParticipant(const MTPChannelParticipant &participant, not_null<Additional*> additional, Callback callback);
 
 private:
 	template <typename Callback>
-	bool checkInfoLoaded(gsl::not_null<UserData*> user, Callback callback);
+	bool checkInfoLoaded(not_null<UserData*> user, Callback callback);
 
-	void showAdmin(gsl::not_null<UserData*> user, bool sure = false);
-	void editAdminDone(gsl::not_null<UserData*> user, const MTPChannelAdminRights &rights);
-	void showRestricted(gsl::not_null<UserData*> user, bool sure = false);
-	void editRestrictedDone(gsl::not_null<UserData*> user, const MTPChannelBannedRights &rights);
-	void kickUser(gsl::not_null<UserData*> user, bool sure = false);
-	void restrictUserSure(gsl::not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights);
-	bool appendRow(gsl::not_null<UserData*> user);
-	bool prependRow(gsl::not_null<UserData*> user);
-	std::unique_ptr<PeerListRow> createRow(gsl::not_null<UserData*> user) const;
+	void showAdmin(not_null<UserData*> user, bool sure = false);
+	void editAdminDone(not_null<UserData*> user, const MTPChannelAdminRights &rights);
+	void showRestricted(not_null<UserData*> user, bool sure = false);
+	void editRestrictedDone(not_null<UserData*> user, const MTPChannelBannedRights &rights);
+	void kickUser(not_null<UserData*> user, bool sure = false);
+	void restrictUserSure(not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights);
+	bool appendRow(not_null<UserData*> user);
+	bool prependRow(not_null<UserData*> user);
+	std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user) const;
 
-	gsl::not_null<ChannelData*> _channel;
+	not_null<ChannelData*> _channel;
 	Role _role = Role::Admins;
 	int _offset = 0;
 	mtpRequestId _loadRequestId = 0;
@@ -187,7 +187,7 @@ public:
 	using Role = ParticipantsBoxController::Role;
 	using Additional = ParticipantsBoxController::Additional;
 
-	AddParticipantBoxSearchController(gsl::not_null<ChannelData*> channel, gsl::not_null<Additional*> additional);
+	AddParticipantBoxSearchController(not_null<ChannelData*> channel, not_null<Additional*> additional);
 
 	void searchQuery(const QString &query) override;
 	bool isLoading() override;
@@ -212,8 +212,8 @@ private:
 	void addChatsContacts();
 	void requestGlobal();
 
-	gsl::not_null<ChannelData*> _channel;
-	gsl::not_null<Additional*> _additional;
+	not_null<ChannelData*> _channel;
+	not_null<Additional*> _additional;
 
 	base::Timer _timer;
 	QString _query;
diff --git a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp
index 77b25cc2ae..25a9c7f2af 100644
--- a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp
+++ b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp
@@ -42,7 +42,7 @@ constexpr int kCommonGroupsPerPage = 40;
 
 } // namespace
 
-object_ptr<Window::SectionWidget> SectionMemento::createWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, const QRect &geometry) {
+object_ptr<Window::SectionWidget> SectionMemento::createWidget(QWidget *parent, not_null<Window::Controller*> controller, const QRect &geometry) {
 	auto result = object_ptr<Widget>(parent, controller, _user);
 	result->setInternalState(geometry, this);
 	return std::move(result);
@@ -97,7 +97,7 @@ InnerWidget::Item::Item(PeerData *peer) : peer(peer) {
 
 InnerWidget::Item::~Item() = default;
 
-InnerWidget::InnerWidget(QWidget *parent, gsl::not_null<UserData*> user) : TWidget(parent)
+InnerWidget::InnerWidget(QWidget *parent, not_null<UserData*> user) : TWidget(parent)
 , _user(user) {
 	setMouseTracking(true);
 	setAttribute(Qt::WA_OpaquePaintEvent);
@@ -118,9 +118,9 @@ void InnerWidget::checkPreloadMore() {
 	}
 }
 
-void InnerWidget::saveState(gsl::not_null<SectionMemento*> memento) {
+void InnerWidget::saveState(not_null<SectionMemento*> memento) {
 	if (auto count = _items.size()) {
-		QList<gsl::not_null<PeerData*>> groups;
+		QList<not_null<PeerData*>> groups;
 		groups.reserve(count);
 		for_const (auto item, _items) {
 			groups.push_back(item->peer);
@@ -129,7 +129,7 @@ void InnerWidget::saveState(gsl::not_null<SectionMemento*> memento) {
 	}
 }
 
-void InnerWidget::restoreState(gsl::not_null<SectionMemento*> memento) {
+void InnerWidget::restoreState(not_null<SectionMemento*> memento) {
 	auto list = memento->getCommonGroups();
 	_allLoaded = false;
 	if (!list.empty()) {
@@ -137,7 +137,7 @@ void InnerWidget::restoreState(gsl::not_null<SectionMemento*> memento) {
 	}
 }
 
-void InnerWidget::showInitial(const QList<gsl::not_null<PeerData*>> &list) {
+void InnerWidget::showInitial(const QList<not_null<PeerData*>> &list) {
 	for_const (auto group, list) {
 		if (auto item = computeItem(group)) {
 			_items.push_back(item);
@@ -335,7 +335,7 @@ InnerWidget::~InnerWidget() {
 	}
 }
 
-Widget::Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller, gsl::not_null<UserData*> user) : Window::SectionWidget(parent, controller)
+Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller, not_null<UserData*> user) : Window::SectionWidget(parent, controller)
 , _scroll(this, st::settingsScroll)
 , _fixedBar(this)
 , _fixedBarShadow(this, st::shadowFg) {
@@ -359,7 +359,7 @@ void Widget::updateAdaptiveLayout() {
 	_fixedBarShadow->moveToLeft(Adaptive::OneColumn() ? 0 : st::lineWidth, _fixedBar->height());
 }
 
-gsl::not_null<UserData*> Widget::user() const {
+not_null<UserData*> Widget::user() const {
 	return _inner->user();
 }
 
@@ -374,7 +374,7 @@ void Widget::doSetInnerFocus() {
 	_inner->setFocus();
 }
 
-bool Widget::showInternal(gsl::not_null<Window::SectionMemento*> memento) {
+bool Widget::showInternal(not_null<Window::SectionMemento*> memento) {
 	if (auto profileMemento = dynamic_cast<SectionMemento*>(memento.get())) {
 		if (profileMemento->getUser() == user()) {
 			restoreState(profileMemento);
@@ -384,7 +384,7 @@ bool Widget::showInternal(gsl::not_null<Window::SectionMemento*> memento) {
 	return false;
 }
 
-void Widget::setInternalState(const QRect &geometry, gsl::not_null<SectionMemento*> memento) {
+void Widget::setInternalState(const QRect &geometry, not_null<SectionMemento*> memento) {
 	setGeometry(geometry);
 	myEnsureResized(this);
 	restoreState(memento);
@@ -396,12 +396,12 @@ std::unique_ptr<Window::SectionMemento> Widget::createMemento() {
 	return std::move(result);
 }
 
-void Widget::saveState(gsl::not_null<SectionMemento*> memento) {
+void Widget::saveState(not_null<SectionMemento*> memento) {
 	memento->setScrollTop(_scroll->scrollTop());
 	_inner->saveState(memento);
 }
 
-void Widget::restoreState(gsl::not_null<SectionMemento*> memento) {
+void Widget::restoreState(not_null<SectionMemento*> memento) {
 	_inner->restoreState(memento);
 	auto scrollTop = memento->getScrollTop();
 	_scroll->scrollToY(scrollTop);
diff --git a/Telegram/SourceFiles/profile/profile_common_groups_section.h b/Telegram/SourceFiles/profile/profile_common_groups_section.h
index 808990dafa..a23a614880 100644
--- a/Telegram/SourceFiles/profile/profile_common_groups_section.h
+++ b/Telegram/SourceFiles/profile/profile_common_groups_section.h
@@ -40,12 +40,12 @@ namespace CommonGroups {
 
 class SectionMemento : public Window::SectionMemento {
 public:
-	SectionMemento(gsl::not_null<UserData*> user) : _user(user) {
+	SectionMemento(not_null<UserData*> user) : _user(user) {
 	}
 
-	object_ptr<Window::SectionWidget> createWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, const QRect &geometry) override;
+	object_ptr<Window::SectionWidget> createWidget(QWidget *parent, not_null<Window::Controller*> controller, const QRect &geometry) override;
 
-	gsl::not_null<UserData*> getUser() const {
+	not_null<UserData*> getUser() const {
 		return _user;
 	}
 	void setScrollTop(int scrollTop) {
@@ -54,17 +54,17 @@ public:
 	int getScrollTop() const {
 		return _scrollTop;
 	}
-	void setCommonGroups(const QList<gsl::not_null<PeerData*>> &groups) {
+	void setCommonGroups(const QList<not_null<PeerData*>> &groups) {
 		_commonGroups = groups;
 	}
-	const QList<gsl::not_null<PeerData*>> &getCommonGroups() const {
+	const QList<not_null<PeerData*>> &getCommonGroups() const {
 		return _commonGroups;
 	}
 
 private:
-	gsl::not_null<UserData*> _user;
+	not_null<UserData*> _user;
 	int _scrollTop = 0;
-	QList<gsl::not_null<PeerData*>> _commonGroups;
+	QList<not_null<PeerData*>> _commonGroups;
 
 };
 
@@ -96,9 +96,9 @@ class InnerWidget final : public TWidget {
 	Q_OBJECT
 
 public:
-	InnerWidget(QWidget *parent, gsl::not_null<UserData*> user);
+	InnerWidget(QWidget *parent, not_null<UserData*> user);
 
-	gsl::not_null<UserData*> user() const {
+	not_null<UserData*> user() const {
 		return _user;
 	}
 
@@ -110,8 +110,8 @@ public:
 		return TWidget::resizeToWidth(newWidth);
 	}
 
-	void saveState(gsl::not_null<SectionMemento*> memento);
-	void restoreState(gsl::not_null<SectionMemento*> memento);
+	void saveState(not_null<SectionMemento*> memento);
+	void restoreState(not_null<SectionMemento*> memento);
 
 	~InnerWidget();
 
@@ -131,13 +131,13 @@ protected:
 private:
 	void updateSelected(QPoint localPos);
 	void updateRow(int index);
-	void showInitial(const QList<gsl::not_null<PeerData*>> &list);
+	void showInitial(const QList<not_null<PeerData*>> &list);
 	void checkPreloadMore();
 	void preloadMore();
 	void updateSize();
 	void paintRow(Painter &p, int index, TimeMs ms);
 
-	gsl::not_null<UserData*> _user;
+	not_null<UserData*> _user;
 
 	int _minHeight = 0;
 	int _rowHeight = 0;
@@ -171,9 +171,9 @@ class Widget final : public Window::SectionWidget {
 	Q_OBJECT
 
 public:
-	Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller, gsl::not_null<UserData*> user);
+	Widget(QWidget *parent, not_null<Window::Controller*> controller, not_null<UserData*> user);
 
-	gsl::not_null<UserData*> user() const;
+	not_null<UserData*> user() const;
 	PeerData *peerForDialogs() const override {
 		return user();
 	}
@@ -184,10 +184,10 @@ public:
 
 	QPixmap grabForShowAnimation(const Window::SectionSlideParams &params) override;
 
-	bool showInternal(gsl::not_null<Window::SectionMemento*> memento) override;
+	bool showInternal(not_null<Window::SectionMemento*> memento) override;
 	std::unique_ptr<Window::SectionMemento> createMemento() override;
 
-	void setInternalState(const QRect &geometry, gsl::not_null<SectionMemento*> memento);
+	void setInternalState(const QRect &geometry, not_null<SectionMemento*> memento);
 
 	// Float player interface.
 	bool wheelEventFromFloatPlayer(QEvent *e, Window::Column myColumn, Window::Column playerColumn) override;
@@ -205,8 +205,8 @@ private slots:
 
 private:
 	void updateAdaptiveLayout();
-	void saveState(gsl::not_null<SectionMemento*> memento);
-	void restoreState(gsl::not_null<SectionMemento*> memento);
+	void saveState(not_null<SectionMemento*> memento);
+	void restoreState(not_null<SectionMemento*> memento);
 
 	object_ptr<Ui::ScrollArea> _scroll;
 	QPointer<InnerWidget> _inner;
diff --git a/Telegram/SourceFiles/profile/profile_inner_widget.cpp b/Telegram/SourceFiles/profile/profile_inner_widget.cpp
index 2c7a187c5d..07abb95650 100644
--- a/Telegram/SourceFiles/profile/profile_inner_widget.cpp
+++ b/Telegram/SourceFiles/profile/profile_inner_widget.cpp
@@ -89,13 +89,13 @@ bool InnerWidget::shareContactButtonShown() const {
 	return _cover->shareContactButtonShown();
 }
 
-void InnerWidget::saveState(gsl::not_null<SectionMemento*> memento) {
+void InnerWidget::saveState(not_null<SectionMemento*> memento) {
 	for_const (auto &blockData, _blocks) {
 		blockData.block->saveState(memento);
 	}
 }
 
-void InnerWidget::restoreState(gsl::not_null<SectionMemento*> memento) {
+void InnerWidget::restoreState(not_null<SectionMemento*> memento) {
 	for_const (auto &blockData, _blocks) {
 		blockData.block->restoreState(memento);
 	}
diff --git a/Telegram/SourceFiles/profile/profile_inner_widget.h b/Telegram/SourceFiles/profile/profile_inner_widget.h
index aa3b5d7891..b230b4e1e3 100644
--- a/Telegram/SourceFiles/profile/profile_inner_widget.h
+++ b/Telegram/SourceFiles/profile/profile_inner_widget.h
@@ -49,8 +49,8 @@ public:
 	// It should show it only if it is hidden in the cover.
 	bool shareContactButtonShown() const;
 
-	void saveState(gsl::not_null<SectionMemento*> memento);
-	void restoreState(gsl::not_null<SectionMemento*> memento);
+	void saveState(not_null<SectionMemento*> memento);
+	void restoreState(not_null<SectionMemento*> memento);
 
 	void showFinished();
 
diff --git a/Telegram/SourceFiles/profile/profile_section_memento.cpp b/Telegram/SourceFiles/profile/profile_section_memento.cpp
index c07bbe4118..d6d53e5585 100644
--- a/Telegram/SourceFiles/profile/profile_section_memento.cpp
+++ b/Telegram/SourceFiles/profile/profile_section_memento.cpp
@@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace Profile {
 
-object_ptr<Window::SectionWidget> SectionMemento::createWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, const QRect &geometry) {
+object_ptr<Window::SectionWidget> SectionMemento::createWidget(QWidget *parent, not_null<Window::Controller*> controller, const QRect &geometry) {
 	auto result = object_ptr<Widget>(parent, controller, _peer);
 	result->setInternalState(geometry, this);
 	return std::move(result);
diff --git a/Telegram/SourceFiles/profile/profile_section_memento.h b/Telegram/SourceFiles/profile/profile_section_memento.h
index cc7140ad79..ca6f44785b 100644
--- a/Telegram/SourceFiles/profile/profile_section_memento.h
+++ b/Telegram/SourceFiles/profile/profile_section_memento.h
@@ -31,7 +31,7 @@ public:
 	SectionMemento(PeerData *peer) : _peer(peer) {
 	}
 
-	object_ptr<Window::SectionWidget> createWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, const QRect &geometry) override;
+	object_ptr<Window::SectionWidget> createWidget(QWidget *parent, not_null<Window::Controller*> controller, const QRect &geometry) override;
 
 	PeerData *getPeer() const {
 		return _peer;
diff --git a/Telegram/SourceFiles/profile/profile_widget.cpp b/Telegram/SourceFiles/profile/profile_widget.cpp
index c70c2ef1aa..f9dc74c9d6 100644
--- a/Telegram/SourceFiles/profile/profile_widget.cpp
+++ b/Telegram/SourceFiles/profile/profile_widget.cpp
@@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace Profile {
 
-Widget::Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller, PeerData *peer) : Window::SectionWidget(parent, controller)
+Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller, PeerData *peer) : Window::SectionWidget(parent, controller)
 , _scroll(this, st::settingsScroll)
 , _fixedBar(this, peer)
 , _fixedBarShadow(this, object_ptr<Ui::PlainShadow>(this, st::shadowFg)) {
@@ -76,7 +76,7 @@ void Widget::doSetInnerFocus() {
 	_inner->setFocus();
 }
 
-bool Widget::showInternal(gsl::not_null<Window::SectionMemento*> memento) {
+bool Widget::showInternal(not_null<Window::SectionMemento*> memento) {
 	if (auto profileMemento = dynamic_cast<SectionMemento*>(memento.get())) {
 		if (profileMemento->getPeer() == peer()) {
 			restoreState(profileMemento);
@@ -86,7 +86,7 @@ bool Widget::showInternal(gsl::not_null<Window::SectionMemento*> memento) {
 	return false;
 }
 
-void Widget::setInternalState(const QRect &geometry, gsl::not_null<SectionMemento*> memento) {
+void Widget::setInternalState(const QRect &geometry, not_null<SectionMemento*> memento) {
 	setGeometry(geometry);
 	myEnsureResized(this);
 	restoreState(memento);
@@ -98,12 +98,12 @@ std::unique_ptr<Window::SectionMemento> Widget::createMemento() {
 	return std::move(result);
 }
 
-void Widget::saveState(gsl::not_null<SectionMemento*> memento) {
+void Widget::saveState(not_null<SectionMemento*> memento) {
 	memento->setScrollTop(_scroll->scrollTop());
 	_inner->saveState(memento);
 }
 
-void Widget::restoreState(gsl::not_null<SectionMemento*> memento) {
+void Widget::restoreState(not_null<SectionMemento*> memento) {
 	_inner->restoreState(memento);
 	auto scrollTop = memento->getScrollTop();
 	_scroll->scrollToY(scrollTop);
diff --git a/Telegram/SourceFiles/profile/profile_widget.h b/Telegram/SourceFiles/profile/profile_widget.h
index 82438996dc..6ce454a4be 100644
--- a/Telegram/SourceFiles/profile/profile_widget.h
+++ b/Telegram/SourceFiles/profile/profile_widget.h
@@ -38,7 +38,7 @@ class Widget final : public Window::SectionWidget {
 	Q_OBJECT
 
 public:
-	Widget(QWidget *parent, gsl::not_null<Window::Controller*> controller, PeerData *peer);
+	Widget(QWidget *parent, not_null<Window::Controller*> controller, PeerData *peer);
 
 	PeerData *peer() const;
 	PeerData *peerForDialogs() const override {
@@ -49,10 +49,10 @@ public:
 
 	QPixmap grabForShowAnimation(const Window::SectionSlideParams &params) override;
 
-	bool showInternal(gsl::not_null<Window::SectionMemento*> memento) override;
+	bool showInternal(not_null<Window::SectionMemento*> memento) override;
 	std::unique_ptr<Window::SectionMemento> createMemento() override;
 
-	void setInternalState(const QRect &geometry, gsl::not_null<SectionMemento*> memento);
+	void setInternalState(const QRect &geometry, not_null<SectionMemento*> memento);
 
 	// Float player interface.
 	bool wheelEventFromFloatPlayer(QEvent *e, Window::Column myColumn, Window::Column playerColumn) override;
@@ -71,8 +71,8 @@ private slots:
 private:
 	void updateScrollState();
 	void updateAdaptiveLayout();
-	void saveState(gsl::not_null<SectionMemento*> memento);
-	void restoreState(gsl::not_null<SectionMemento*> memento);
+	void saveState(not_null<SectionMemento*> memento);
+	void restoreState(not_null<SectionMemento*> memento);
 
 	object_ptr<Ui::ScrollArea> _scroll;
 	QPointer<InnerWidget> _inner;
diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp
index 9ae43554f8..e421a540cf 100644
--- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp
+++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp
@@ -36,24 +36,24 @@ constexpr auto kBlockedPerPage = 40;
 
 class BlockUserBoxController : public ChatsListBoxController {
 public:
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
 
-	void setBlockUserCallback(base::lambda<void(gsl::not_null<UserData*> user)> callback) {
+	void setBlockUserCallback(base::lambda<void(not_null<UserData*> user)> callback) {
 		_blockUserCallback = std::move(callback);
 	}
 
 protected:
 	void prepareViewHook() override;
-	std::unique_ptr<Row> createRow(gsl::not_null<History*> history) override;
-	void updateRowHook(gsl::not_null<Row*> row) override {
+	std::unique_ptr<Row> createRow(not_null<History*> history) override;
+	void updateRowHook(not_null<Row*> row) override {
 		updateIsBlocked(row, row->peer()->asUser());
 		delegate()->peerListUpdateRow(row);
 	}
 
 private:
-	void updateIsBlocked(gsl::not_null<PeerListRow*> row, UserData *user) const;
+	void updateIsBlocked(not_null<PeerListRow*> row, UserData *user) const;
 
-	base::lambda<void(gsl::not_null<UserData*> user)> _blockUserCallback;
+	base::lambda<void(not_null<UserData*> user)> _blockUserCallback;
 
 };
 
@@ -69,7 +69,7 @@ void BlockUserBoxController::prepareViewHook() {
 	}));
 }
 
-void BlockUserBoxController::updateIsBlocked(gsl::not_null<PeerListRow*> row, UserData *user) const {
+void BlockUserBoxController::updateIsBlocked(not_null<PeerListRow*> row, UserData *user) const {
 	auto blocked = user->isBlocked();
 	row->setDisabledState(blocked ? PeerListRow::State::DisabledChecked : PeerListRow::State::Active);
 	if (blocked) {
@@ -79,11 +79,11 @@ void BlockUserBoxController::updateIsBlocked(gsl::not_null<PeerListRow*> row, Us
 	}
 }
 
-void BlockUserBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void BlockUserBoxController::rowClicked(not_null<PeerListRow*> row) {
 	_blockUserCallback(row->peer()->asUser());
 }
 
-std::unique_ptr<BlockUserBoxController::Row> BlockUserBoxController::createRow(gsl::not_null<History*> history) {
+std::unique_ptr<BlockUserBoxController::Row> BlockUserBoxController::createRow(not_null<History*> history) {
 	if (history->peer->isSelf()) {
 		return nullptr;
 	}
@@ -142,11 +142,11 @@ void BlockedBoxController::loadMoreRows() {
 	}).send();
 }
 
-void BlockedBoxController::rowClicked(gsl::not_null<PeerListRow*> row) {
+void BlockedBoxController::rowClicked(not_null<PeerListRow*> row) {
 	Ui::showPeerHistoryAsync(row->peer()->id, ShowAtUnreadMsgId);
 }
 
-void BlockedBoxController::rowActionClicked(gsl::not_null<PeerListRow*> row) {
+void BlockedBoxController::rowActionClicked(not_null<PeerListRow*> row) {
 	auto user = row->peer()->asUser();
 	Expects(user != nullptr);
 
@@ -187,8 +187,8 @@ void BlockedBoxController::handleBlockedEvent(UserData *user) {
 
 void BlockedBoxController::BlockNewUser() {
 	auto controller = std::make_unique<BlockUserBoxController>();
-	auto initBox = [controller = controller.get()](gsl::not_null<PeerListBox*> box) {
-		controller->setBlockUserCallback([box](gsl::not_null<UserData*> user) {
+	auto initBox = [controller = controller.get()](not_null<PeerListBox*> box) {
+		controller->setBlockUserCallback([box](not_null<UserData*> user) {
 			Auth().api().blockUser(user);
 			box->closeBox();
 		});
diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.h b/Telegram/SourceFiles/settings/settings_privacy_controllers.h
index 550e06d307..872c0f9873 100644
--- a/Telegram/SourceFiles/settings/settings_privacy_controllers.h
+++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.h
@@ -29,8 +29,8 @@ namespace Settings {
 class BlockedBoxController : public PeerListController, private base::Subscriber, private MTP::Sender {
 public:
 	void prepare() override;
-	void rowClicked(gsl::not_null<PeerListRow*> row) override;
-	void rowActionClicked(gsl::not_null<PeerListRow*> row) override;
+	void rowClicked(not_null<PeerListRow*> row) override;
+	void rowActionClicked(not_null<PeerListRow*> row) override;
 	void loadMoreRows() override;
 
 	static void BlockNewUser();
diff --git a/Telegram/SourceFiles/settings/settings_privacy_widget.cpp b/Telegram/SourceFiles/settings/settings_privacy_widget.cpp
index 3aa3141cee..3e6b8b3342 100644
--- a/Telegram/SourceFiles/settings/settings_privacy_widget.cpp
+++ b/Telegram/SourceFiles/settings/settings_privacy_widget.cpp
@@ -208,7 +208,7 @@ void PrivacyWidget::autoLockUpdated() {
 }
 
 void PrivacyWidget::onBlockedUsers() {
-	Ui::show(Box<PeerListBox>(std::make_unique<BlockedBoxController>(), [](gsl::not_null<PeerListBox*> box) {
+	Ui::show(Box<PeerListBox>(std::make_unique<BlockedBoxController>(), [](not_null<PeerListBox*> box) {
 		box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
 		box->addLeftButton(langFactory(lng_blocked_list_add), [box] { BlockedBoxController::BlockNewUser(); });
 	}));
diff --git a/Telegram/SourceFiles/storage/file_download.h b/Telegram/SourceFiles/storage/file_download.h
index d79dc1b303..578513b2fc 100644
--- a/Telegram/SourceFiles/storage/file_download.h
+++ b/Telegram/SourceFiles/storage/file_download.h
@@ -147,7 +147,7 @@ signals:
 protected:
 	void readImage(const QSize &shrinkBox) const;
 
-	gsl::not_null<Storage::Downloader*> _downloader;
+	not_null<Storage::Downloader*> _downloader;
 	FileLoader *_prev = nullptr;
 	FileLoader *_next = nullptr;
 	int _priority = 0;
diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp
index 7aea4ab3fe..7c4136c33f 100644
--- a/Telegram/SourceFiles/structs.cpp
+++ b/Telegram/SourceFiles/structs.cpp
@@ -250,7 +250,7 @@ using UpdateFlag = Notify::PeerUpdate::Flag;
 NotifySettings globalNotifyAll, globalNotifyUsers, globalNotifyChats;
 NotifySettingsPtr globalNotifyAllPtr = UnknownNotifySettings, globalNotifyUsersPtr = UnknownNotifySettings, globalNotifyChatsPtr = UnknownNotifySettings;
 
-PeerClickHandler::PeerClickHandler(gsl::not_null<PeerData*> peer) : _peer(peer) {
+PeerClickHandler::PeerClickHandler(not_null<PeerData*> peer) : _peer(peer) {
 }
 
 void PeerClickHandler::onClick(Qt::MouseButton button) const {
@@ -790,7 +790,7 @@ MTPChannelBannedRights ChannelData::KickedRestrictedRights() {
 	return MTP_channelBannedRights(MTP_flags(flags), MTP_int(std::numeric_limits<int32>::max()));
 }
 
-void ChannelData::applyEditAdmin(gsl::not_null<UserData*> user, const MTPChannelAdminRights &oldRights, const MTPChannelAdminRights &newRights) {
+void ChannelData::applyEditAdmin(not_null<UserData*> user, const MTPChannelAdminRights &oldRights, const MTPChannelAdminRights &newRights) {
 	auto flags = Notify::PeerUpdate::Flag::AdminsChanged | Notify::PeerUpdate::Flag::None;
 	if (mgInfo) {
 		if (!mgInfo->lastParticipants.contains(user)) { // If rights are empty - still add participant? TODO check
@@ -845,7 +845,7 @@ void ChannelData::applyEditAdmin(gsl::not_null<UserData*> user, const MTPChannel
 	Notify::peerUpdatedDelayed(this, flags);
 }
 
-void ChannelData::applyEditBanned(gsl::not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights) {
+void ChannelData::applyEditBanned(not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights) {
 	auto flags = Notify::PeerUpdate::Flag::BannedUsersChanged | Notify::PeerUpdate::Flag::None;
 	if (mgInfo) {
 		if (mgInfo->lastAdmins.contains(user)) { // If rights are empty - still remove admin? TODO check
@@ -915,7 +915,7 @@ void ChannelData::setRestrictionReason(const QString &text) {
 	}
 }
 
-bool ChannelData::canNotEditLastAdmin(gsl::not_null<UserData*> user) const {
+bool ChannelData::canNotEditLastAdmin(not_null<UserData*> user) const {
 	if (mgInfo) {
 		auto i = mgInfo->lastAdmins.constFind(user);
 		if (i != mgInfo->lastAdmins.cend()) {
@@ -926,7 +926,7 @@ bool ChannelData::canNotEditLastAdmin(gsl::not_null<UserData*> user) const {
 	return false;
 }
 
-bool ChannelData::canEditAdmin(gsl::not_null<UserData*> user) const {
+bool ChannelData::canEditAdmin(not_null<UserData*> user) const {
 	if (user->isSelf()) {
 		return false;
 	} else if (amCreator()) {
@@ -937,7 +937,7 @@ bool ChannelData::canEditAdmin(gsl::not_null<UserData*> user) const {
 	return adminRights().is_add_admins();
 }
 
-bool ChannelData::canRestrictUser(gsl::not_null<UserData*> user) const {
+bool ChannelData::canRestrictUser(not_null<UserData*> user) const {
 	if (user->isSelf()) {
 		return false;
 	} else if (amCreator()) {
diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h
index c2f3b88897..e12bb504b5 100644
--- a/Telegram/SourceFiles/structs.h
+++ b/Telegram/SourceFiles/structs.h
@@ -271,15 +271,15 @@ class PeerData;
 
 class PeerClickHandler : public ClickHandler {
 public:
-	PeerClickHandler(gsl::not_null<PeerData*> peer);
+	PeerClickHandler(not_null<PeerData*> peer);
 	void onClick(Qt::MouseButton button) const override;
 
-	gsl::not_null<PeerData*> peer() const {
+	not_null<PeerData*> peer() const {
 		return _peer;
 	}
 
 private:
-	gsl::not_null<PeerData*> _peer;
+	not_null<PeerData*> _peer;
 
 };
 
@@ -640,11 +640,11 @@ public:
 	bool isMigrated() const {
 		return flags & MTPDchat::Flag::f_migrated_to;
 	}
-	QMap<gsl::not_null<UserData*>, int> participants;
-	OrderedSet<gsl::not_null<UserData*>> invitedByMe;
-	OrderedSet<gsl::not_null<UserData*>> admins;
-	QList<gsl::not_null<UserData*>> lastAuthors;
-	OrderedSet<gsl::not_null<PeerData*>> markupSenders;
+	QMap<not_null<UserData*>, int> participants;
+	OrderedSet<not_null<UserData*>> invitedByMe;
+	OrderedSet<not_null<UserData*>> admins;
+	QList<not_null<UserData*>> lastAuthors;
+	OrderedSet<not_null<PeerData*>> markupSenders;
 	int botStatus = 0; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other
 //	ImagePtr photoFull;
 
@@ -738,11 +738,11 @@ struct MegagroupInfo {
 		}
 		MTPChannelBannedRights rights;
 	};
-	QList<gsl::not_null<UserData*>> lastParticipants;
-	QMap<gsl::not_null<UserData*>, Admin> lastAdmins;
-	QMap<gsl::not_null<UserData*>, Restricted> lastRestricted;
-	OrderedSet<gsl::not_null<PeerData*>> markupSenders;
-	OrderedSet<gsl::not_null<UserData*>> bots;
+	QList<not_null<UserData*>> lastParticipants;
+	QMap<not_null<UserData*>, Admin> lastAdmins;
+	QMap<not_null<UserData*>, Restricted> lastRestricted;
+	OrderedSet<not_null<PeerData*>> markupSenders;
+	OrderedSet<not_null<UserData*>> bots;
 
 	UserData *creator = nullptr; // nullptr means unknown
 	int botStatus = 0; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other
@@ -826,8 +826,8 @@ public:
 	static bool IsRestrictedForever(TimeId until) {
 		return !until || (until == kRestrictUntilForever);
 	}
-	void applyEditAdmin(gsl::not_null<UserData*> user, const MTPChannelAdminRights &oldRights, const MTPChannelAdminRights &newRights);
-	void applyEditBanned(gsl::not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights);
+	void applyEditAdmin(not_null<UserData*> user, const MTPChannelAdminRights &oldRights, const MTPChannelAdminRights &newRights);
+	void applyEditBanned(not_null<UserData*> user, const MTPChannelBannedRights &oldRights, const MTPChannelBannedRights &newRights);
 
 	int32 date = 0;
 	int version = 0;
@@ -929,8 +929,8 @@ public:
 		constexpr auto kDeleteChannelMembersLimit = 1000;
 		return amCreator() && (membersCount() <= kDeleteChannelMembersLimit);
 	}
-	bool canEditAdmin(gsl::not_null<UserData*> user) const;
-	bool canRestrictUser(gsl::not_null<UserData*> user) const;
+	bool canEditAdmin(not_null<UserData*> user) const;
+	bool canRestrictUser(not_null<UserData*> user) const;
 
 	void setInviteLink(const QString &newInviteLink);
 	QString inviteLink() const {
@@ -986,7 +986,7 @@ public:
 	void setRestrictionReason(const QString &reason);
 
 private:
-	bool canNotEditLastAdmin(gsl::not_null<UserData*> user) const;
+	bool canNotEditLastAdmin(not_null<UserData*> user) const;
 
 	PtsWaiter _ptsWaiter;
 
@@ -1143,9 +1143,9 @@ private:
 
 class PhotoClickHandler : public LeftButtonClickHandler {
 public:
-	PhotoClickHandler(gsl::not_null<PhotoData*> photo, PeerData *peer = nullptr) : _photo(photo), _peer(peer) {
+	PhotoClickHandler(not_null<PhotoData*> photo, PeerData *peer = nullptr) : _photo(photo), _peer(peer) {
 	}
-	gsl::not_null<PhotoData*> photo() const {
+	not_null<PhotoData*> photo() const {
 		return _photo;
 	}
 	PeerData *peer() const {
@@ -1153,7 +1153,7 @@ public:
 	}
 
 private:
-	gsl::not_null<PhotoData*> _photo;
+	not_null<PhotoData*> _photo;
 	PeerData *_peer;
 
 };
diff --git a/Telegram/SourceFiles/ui/widgets/checkbox.h b/Telegram/SourceFiles/ui/widgets/checkbox.h
index 442803d7cf..399701aa23 100644
--- a/Telegram/SourceFiles/ui/widgets/checkbox.h
+++ b/Telegram/SourceFiles/ui/widgets/checkbox.h
@@ -75,7 +75,7 @@ public:
 private:
 	QSize rippleSize() const;
 
-	gsl::not_null<const style::Check*> _st;
+	not_null<const style::Check*> _st;
 
 };
 
@@ -93,7 +93,7 @@ public:
 private:
 	QSize rippleSize() const;
 
-	gsl::not_null<const style::Radio*> _st;
+	not_null<const style::Radio*> _st;
 
 };
 
@@ -112,7 +112,7 @@ private:
 	void paintXV(Painter &p, int left, int top, int outerWidth, float64 toggled, const QBrush &brush);
 	QSize rippleSize() const;
 
-	gsl::not_null<const style::Toggle*> _st;
+	not_null<const style::Toggle*> _st;
 
 };
 
diff --git a/Telegram/SourceFiles/window/section_memento.h b/Telegram/SourceFiles/window/section_memento.h
index 9151fa49f8..839b0bceba 100644
--- a/Telegram/SourceFiles/window/section_memento.h
+++ b/Telegram/SourceFiles/window/section_memento.h
@@ -27,7 +27,7 @@ class SectionWidget;
 
 class SectionMemento {
 public:
-	virtual object_ptr<Window::SectionWidget> createWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller, const QRect &geometry) = 0;
+	virtual object_ptr<Window::SectionWidget> createWidget(QWidget *parent, not_null<Window::Controller*> controller, const QRect &geometry) = 0;
 	virtual ~SectionMemento() {
 	}
 
diff --git a/Telegram/SourceFiles/window/section_widget.cpp b/Telegram/SourceFiles/window/section_widget.cpp
index 459eca71db..54e8c03d48 100644
--- a/Telegram/SourceFiles/window/section_widget.cpp
+++ b/Telegram/SourceFiles/window/section_widget.cpp
@@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace Window {
 
-SectionWidget::SectionWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : AbstractSectionWidget(parent, controller) {
+SectionWidget::SectionWidget(QWidget *parent, not_null<Window::Controller*> controller) : AbstractSectionWidget(parent, controller) {
 }
 
 void SectionWidget::setGeometryWithTopMoved(const QRect &newGeometry, int topDelta) {
diff --git a/Telegram/SourceFiles/window/section_widget.h b/Telegram/SourceFiles/window/section_widget.h
index 8cbba8b5e9..480ec69b3f 100644
--- a/Telegram/SourceFiles/window/section_widget.h
+++ b/Telegram/SourceFiles/window/section_widget.h
@@ -35,7 +35,7 @@ enum class Column {
 
 class AbstractSectionWidget : public TWidget, protected base::Subscriber {
 public:
-	AbstractSectionWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent), _controller(controller) {
+	AbstractSectionWidget(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent), _controller(controller) {
 	}
 
 	// Float player interface.
@@ -47,12 +47,12 @@ public:
 	}
 
 protected:
-	gsl::not_null<Window::Controller*> controller() const {
+	not_null<Window::Controller*> controller() const {
 		return _controller;
 	}
 
 private:
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 };
 
@@ -70,7 +70,7 @@ struct SectionSlideParams {
 
 class SectionWidget : public AbstractSectionWidget {
 public:
-	SectionWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	SectionWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	virtual PeerData *peerForDialogs() const {
 		return nullptr;
@@ -99,7 +99,7 @@ public:
 	//
 	// If this method returns false it is not supposed to modify the memento.
 	// If this method returns true it may modify the memento ("take" heavy items).
-	virtual bool showInternal(gsl::not_null<SectionMemento*> memento) = 0;
+	virtual bool showInternal(not_null<SectionMemento*> memento) = 0;
 
 	// Create a memento of that section to store it in the history stack.
 	// This method may modify the section ("take" heavy items).
diff --git a/Telegram/SourceFiles/window/top_bar_widget.cpp b/Telegram/SourceFiles/window/top_bar_widget.cpp
index 2cebd8ae0e..2a3863273d 100644
--- a/Telegram/SourceFiles/window/top_bar_widget.cpp
+++ b/Telegram/SourceFiles/window/top_bar_widget.cpp
@@ -37,7 +37,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 
 namespace Window {
 
-TopBarWidget::TopBarWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller) : TWidget(parent)
+TopBarWidget::TopBarWidget(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent)
 , _controller(controller)
 , _clearSelection(this, langFactory(lng_selected_clear), st::topBarClearButton)
 , _forward(this, langFactory(lng_selected_forward), st::defaultActiveButton)
diff --git a/Telegram/SourceFiles/window/top_bar_widget.h b/Telegram/SourceFiles/window/top_bar_widget.h
index d2ba6fa65f..5f0d64ac6e 100644
--- a/Telegram/SourceFiles/window/top_bar_widget.h
+++ b/Telegram/SourceFiles/window/top_bar_widget.h
@@ -37,7 +37,7 @@ class TopBarWidget : public TWidget, private base::Subscriber {
 	Q_OBJECT
 
 public:
-	TopBarWidget(QWidget *parent, gsl::not_null<Window::Controller*> controller);
+	TopBarWidget(QWidget *parent, not_null<Window::Controller*> controller);
 
 	struct SelectedState {
 		bool textSelected = false;
@@ -80,7 +80,7 @@ private:
 	void updateAdaptiveLayout();
 	int countSelectedButtonsTop(float64 selectedShown);
 
-	gsl::not_null<Window::Controller*> _controller;
+	not_null<Window::Controller*> _controller;
 
 	PeerData *_searchInPeer = nullptr;
 	int _selectedCount = 0;
diff --git a/Telegram/SourceFiles/window/window_controller.cpp b/Telegram/SourceFiles/window/window_controller.cpp
index 7dbc42bbde..e495b8d921 100644
--- a/Telegram/SourceFiles/window/window_controller.cpp
+++ b/Telegram/SourceFiles/window/window_controller.cpp
@@ -136,7 +136,7 @@ void Controller::provideChatWidth(int requestedWidth) {
 	}
 }
 
-void Controller::showJumpToDate(gsl::not_null<PeerData*> peer, QDate requestedDate) {
+void Controller::showJumpToDate(not_null<PeerData*> peer, QDate requestedDate) {
 	Expects(peer != nullptr);
 	auto currentPeerDate = [peer] {
 		if (auto history = App::historyLoaded(peer)) {
diff --git a/Telegram/SourceFiles/window/window_controller.h b/Telegram/SourceFiles/window/window_controller.h
index d414503ba6..62587b1176 100644
--- a/Telegram/SourceFiles/window/window_controller.h
+++ b/Telegram/SourceFiles/window/window_controller.h
@@ -39,10 +39,10 @@ class Controller {
 public:
 	static constexpr auto kDefaultDialogsWidthRatio = 5. / 14;
 
-	Controller(gsl::not_null<MainWindow*> window) : _window(window) {
+	Controller(not_null<MainWindow*> window) : _window(window) {
 	}
 
-	gsl::not_null<MainWindow*> window() const {
+	not_null<MainWindow*> window() const {
 		return _window;
 	}
 
@@ -80,7 +80,7 @@ public:
 	bool canProvideChatWidth(int requestedWidth) const;
 	void provideChatWidth(int requestedWidth);
 
-	void showJumpToDate(gsl::not_null<PeerData*> peer, QDate requestedDate);
+	void showJumpToDate(not_null<PeerData*> peer, QDate requestedDate);
 
 	base::Variable<float64> &dialogsWidthRatio() {
 		return _dialogsWidthRatio;
@@ -102,7 +102,7 @@ public:
 	}
 
 private:
-	gsl::not_null<MainWindow*> _window;
+	not_null<MainWindow*> _window;
 
 	base::Observable<PeerData*> _searchInPeerChanged;
 	base::Observable<PeerData*> _historyPeerChanged;
diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp
index bc0a35400b..efbdfae716 100644
--- a/Telegram/SourceFiles/window/window_main_menu.cpp
+++ b/Telegram/SourceFiles/window/window_main_menu.cpp
@@ -96,14 +96,14 @@ void MainMenu::refreshMenu() {
 		App::wnd()->onShowNewChannel();
 	}, &st::mainMenuNewChannel, &st::mainMenuNewChannelOver);
 	_menu->addAction(lang(lng_menu_contacts), [] {
-		Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](gsl::not_null<PeerListBox*> box) {
+		Ui::show(Box<PeerListBox>(std::make_unique<ContactsBoxController>(), [](not_null<PeerListBox*> box) {
 			box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
 			box->addLeftButton(langFactory(lng_profile_add_contact), [] { App::wnd()->onShowAddContact(); });
 		}));
 	}, &st::mainMenuContacts, &st::mainMenuContactsOver);
 	if (Global::PhoneCallsEnabled()) {
 		_menu->addAction(lang(lng_menu_calls), [] {
-			Ui::show(Box<PeerListBox>(std::make_unique<Calls::BoxController>(), [](gsl::not_null<PeerListBox*> box) {
+			Ui::show(Box<PeerListBox>(std::make_unique<Calls::BoxController>(), [](not_null<PeerListBox*> box) {
 				box->addButton(langFactory(lng_close), [box] { box->closeBox(); });
 			}));
 		}, &st::mainMenuCalls, &st::mainMenuCallsOver);