From bebf58ea8dc669f1827eb44f4faed19040761f5a Mon Sep 17 00:00:00 2001
From: 23rd <23rd@vivaldi.net>
Date: Sat, 22 Jun 2019 10:42:02 +0300
Subject: [PATCH] Fixed display of online badge in pinned Saved Messages in
 touchbar.

 - Fixed #6162.
---
 Telegram/SourceFiles/platform/mac/mac_touchbar.mm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm
index 6fee5efe3..a2410e438 100644
--- a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm
+++ b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm
@@ -440,7 +440,7 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
 	}
 	_peerChangedLifetime.destroy();
 	_peer = newPeer;
-	if (!_peer) {
+	if (!_peer || IsSelfPeer(_peer)) {
 		return;
 	}
 	Notify::PeerUpdateViewer(
@@ -516,6 +516,9 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
 }
 
 - (void) updateBadge {
+	if (IsSelfPeer(_peer)) {
+		return;
+	}
 	// Draw unread or online badge.
 	auto pixmap = App::pixmapFromImageInPlace(_userpic.toImage());
 	Painter p(&pixmap);