From 60cf1b649078b1271cee7150c5e129572065a49f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 May 2019 14:06:25 +0300 Subject: [PATCH] Fixed drawing of self userpic. --- Telegram/SourceFiles/platform/mac/touchbar.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/mac/touchbar.mm b/Telegram/SourceFiles/platform/mac/touchbar.mm index 7a9469f566..97e0c30379 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar.mm @@ -175,9 +175,13 @@ auto lifetime = rpl::lifetime(); }); } +- (bool) isSelfPeer { + return !self.peer ? false : self.peer->id == Auth().userPeerId(); +} - (NSImage *) getPinImage { - if (self.number <= kSavedMessagesId) { + // Don't draw self userpic if we pin Saved Messages. + if (self.number <= kSavedMessagesId || [self isSelfPeer]) { const int s = kIdealIconSize * cRetinaFactor(); auto *pix = new QPixmap(s, s); Painter paint(pix);