From 51122ab3babead83e99e112aed5795cbadea1a32 Mon Sep 17 00:00:00 2001
From: AlexeyZavar <sltkval1@gmail.com>
Date: Thu, 30 Jan 2025 23:04:03 +0300
Subject: [PATCH] feat: show badges in dialogs list

---
 .../icons/ayu/dialogs_extera_official.png     | Bin 0 -> 401 bytes
 .../icons/ayu/dialogs_extera_official@2x.png  | Bin 0 -> 712 bytes
 .../icons/ayu/dialogs_extera_official@3x.png  | Bin 0 -> 957 bytes
 .../icons/ayu/dialogs_extera_supporter.png    | Bin 0 -> 282 bytes
 .../icons/ayu/dialogs_extera_supporter@2x.png | Bin 0 -> 415 bytes
 .../icons/ayu/dialogs_extera_supporter@3x.png | Bin 0 -> 568 bytes
 Telegram/SourceFiles/ayu/ui/ayu_icons.style   |  12 ++++
 Telegram/SourceFiles/boxes/peer_list_box.cpp  |  10 +++
 .../dialogs/dialogs_inner_widget.cpp          |  12 ++++
 .../SourceFiles/dialogs/ui/dialogs_layout.cpp |  12 ++++
 .../view/history_view_top_bar_widget.cpp      |   3 +
 Telegram/SourceFiles/ui/unread_badge.cpp      |  63 +++++++++++++++++-
 Telegram/SourceFiles/ui/unread_badge.h        |   5 ++
 13 files changed, 115 insertions(+), 2 deletions(-)
 create mode 100644 Telegram/Resources/icons/ayu/dialogs_extera_official.png
 create mode 100644 Telegram/Resources/icons/ayu/dialogs_extera_official@2x.png
 create mode 100644 Telegram/Resources/icons/ayu/dialogs_extera_official@3x.png
 create mode 100644 Telegram/Resources/icons/ayu/dialogs_extera_supporter.png
 create mode 100644 Telegram/Resources/icons/ayu/dialogs_extera_supporter@2x.png
 create mode 100644 Telegram/Resources/icons/ayu/dialogs_extera_supporter@3x.png

diff --git a/Telegram/Resources/icons/ayu/dialogs_extera_official.png b/Telegram/Resources/icons/ayu/dialogs_extera_official.png
new file mode 100644
index 0000000000000000000000000000000000000000..ceea3c984c34d1a91a2119cb1f8517da15e29f39
GIT binary patch
literal 401
zcmV;C0dD?@P)<h;3K|Lk000e1NJLTq000sI000mO1^@s68wM|200009a7bBm000XU
z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH0VYXAK~#7Ft&_2?
zML-Zh=iayqN(BXtLO~?HM6dTPenl;6y&uphG$cZzkx(FcFSE(MSXOw+J;_8eJ2~0e
z87~0%fiLiWQluyfc%BEUs$SN-u5R@Cd`M`T2DWYg<;${!rfFcF=X;T5StRa2DF(uA
z?TLie34*{ENs<KrK@>&4NZ0jKu`J8r`#wZb1ZkQwXLJC<K8X*zZ_9OE2!eooDOFW5
zBFAxH97py>DB5G1CL=+zEQ2G4VX&gQu9<=)NgxbE<`#LLpG0ljvZ7%apePEasOviN
zHq$f_Vc+-6IgTG|grgmk*!M9P$1(XH!R16wqIF$?2e!$BZupxgqT71MzV7m0LvT59
vul6f}Z-^}}%L3cBJrhxIEiiDZI1nDc3l@9{Uh__K00000NkvXXu0mjff`XfZ

literal 0
HcmV?d00001

diff --git a/Telegram/Resources/icons/ayu/dialogs_extera_official@2x.png b/Telegram/Resources/icons/ayu/dialogs_extera_official@2x.png
new file mode 100644
index 0000000000000000000000000000000000000000..f55de69009cc98c81a016592a28909a6c01f3ed2
GIT binary patch
literal 712
zcmV;(0yq7MP)<h;3K|Lk000e1NJLTq001Na001Be1^@s6dXd_W00009a7bBm000XU
z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH0$oW&K~#7F&6mBd
zF;N(W*ZD$$ghC<;3JMC11c~0IxB$JY5Ve}x1t?Sq5($+;Lqnn<ehQNBWKA+BbIi=1
zcg7^g(->xF@8$j9UjY8&gZPIJBLE)>27`!3quTTFc!U>x6BLWZP%f7d3Wc=q_xl~w
z=@jSl+08cif)6nikH=A|R1gUK{(q0h1B=B1`~6<LmnT8ta9I1KfMha>TrQ_vzh193
z7t(6vcDvziL5vR`oKB}rmhi%Ex5H|+!t?q3^}9IB3WWkPnT#)DNGg>=KA$)JE*8WM
z{Kjfeksv*0{Dxuhy7$KwMv)-Bws;{Di74N{#-u1hS!djes8*|})oRFQv$$L?XfztQ
zUazLLEE~q+=_p82XRJgREu*p$_hyaKTa8i>+d;8dgh~VjP{^wYBg^H|(mFb9Iit}?
zvy@U07uwYw9^P)Zkw_%q#CSYbzGt?v^$dqY`=DmrsDhb-Bw{3j2+yKNJg5EPa6qfo
z(mqwtT~2F^*b1UQRZWl#1_RXVb#yu%+Zf>*2|SB|Z7YbQ!+btBH9sr*{XUw_rllxa
z$O)b`o6WRmrOQsIlQv{Y*lafF^?D{T5_fTC(rb}p4AG37XC%;4MgbCcac|=QCkkpe
z6JNL6{dtzS>vi@PwGR4N3a!Fc!FZCmOP?ZL33AJ1GJ#h_E@Mhcvds&xrA1sAx7#iJ
z#%fQo%a{%9YaH_5g)vDnR@wX3HHiI(Jx_8CVy5cJ;mb8h1!pFXDOMLnR$w>RYF`8q
ucIr~8^kY3*fnxsTDs4m`ciDElWac+F7aT_MY}<kW0000<MNUMnLSTYs4L4H&

literal 0
HcmV?d00001

diff --git a/Telegram/Resources/icons/ayu/dialogs_extera_official@3x.png b/Telegram/Resources/icons/ayu/dialogs_extera_official@3x.png
new file mode 100644
index 0000000000000000000000000000000000000000..5092bb28fc0e1b13121ecafe7bc8e63d094fe43a
GIT binary patch
literal 957
zcmV;u148_XP)<h;3K|Lk000e1NJLTq001@s001xu1^@s6S{#YM00009a7bBm000XU
z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH15!yuK~#7F?V3H0
zF;Nu9&pz2LcDLAK1qB5q(Gk%o#D}2Q>wO9zKuzrfC`6&4LrX#8C83a@AbFnrC%G~^
z>(1P_XT)ZI74yRR&pr3tbIzS7BKk`|kU#W8`4#qPJd@A7yu45>7NbZcLT_(xbUK}A
zKA+QcI;G3yLZ)~kAA<*k<Z?NBeSQ6Q4g&lAJ{^xoGJ$Wd=q3u_IL_lb6ZkS>pP!$U
z$z<sH+1vBa=d(3(`~9ADFe(gB8^&WE0elVw0@j?8WwBV$a=H96@8GVYuBt7J1%r4z
zE;J&#K-_k_rSW*|8f>(LK~z4U=gyn|2?Tb#U9LE-;E_xw?;;A|f8ixOw1goj+!MFC
zt1JwG;$EZ0z*OKZ56Z&sEsDVlSP!2ovZckzZ+7p5_oPe^3<ia-<+-BriW&}w$t0;%
zin7@(6^liBe}A{K{c5%9c^@M4dcFR3TuIo+$A?vR=m6uf4iyRoEBVEDJ2;1MKAX*4
ze+Sn=7_t#N(!yAlu7Z~sC!5WNL`bL8)a&)W<dIUsm?)W?P*x0MG#b(2a1go{^Buo!
zujhm<WH*bhU!hQlN~MyN7(1O#N9uZ3&$0YbI4Z*5WftXfxqJ--DqzH9vFDG%!lKbA
z$)G9-K$PhGa>9a|urS#a3iXmIvTkUH<&MI_WScDQcAF}dijt8kZpdJE3JXK2E(_L|
zdcAH56g5`I4FR)LSQr*c)z%mU)@n6sHk+Q;>bN27L&gGxg|Y6DPT#N9YFRGohN>IF
zF4)If1yV^cYijCrY#WWn^{F~hbwl>hVIM;}yT{Fg!GLstxLc^Yp;Hu4DqE0ndL^fB
zU}SE&oQfNw?|-Ygs$7pbvuRl{-|VQm;cB(Id0bf-{8|SHVSxn6F3&x^;LUgChA9d>
z)$+v-QZLag{uY>Dx4cJr#7ymF>4<XUZmwtwXEbCe3&VnFatBh?242FT)qdkGw0_|h
znYD!J<d3@Ge<za(_q>t)u|y(aMM+cJtZra#<AHi@#v9+!v=^ihjoycB^$lS7ZnwJz
zDTu&l-*z-bKp#@Hy9MKi!=ZL&<J;>HB5wt-(t{VmW$<lN!s|T_lcIpHFR%dTn>i4K
fa{i&;%<+?dSv<S+s_&=S00000NkvXXu0mjftq#Az

literal 0
HcmV?d00001

diff --git a/Telegram/Resources/icons/ayu/dialogs_extera_supporter.png b/Telegram/Resources/icons/ayu/dialogs_extera_supporter.png
new file mode 100644
index 0000000000000000000000000000000000000000..14e56ee4e8f50d99c96fac2055eb7f9a2b03e1ed
GIT binary patch
literal 282
zcmeAS@N?(olHy`uVBq!ia0vp^LO?9Q!3HFy+4N(86lZ})WHAE+w=f7ZGR&GI0Tg5`
z4sv&5Sa(k5C6L3C?&#~tz_78O`%fY(kiXv3#WAFUaqT2V-opw4uIo>;gg7mIz#!AW
ztkb}xqR7bU!N6{=pqv=X)$(Cd+p?GSZ};C}WZ;mlIH<O*^WFvyMHY>vPvf#<{pRcq
zlIS&*a5^we#U+Awd(8E(Ize8ghee;qoc-f1k!;aD<x^zIJoT#g%U$kA{gvcY+;wQ#
zwTc@*yDbe?n2LQ}Ww!O1ODS*Enyuf<pNSi_YtQ*y8u)khp7`xi6(P5EGUJ~182+>Q
a&mebkd0|mu_+6mW89ZJ6T-G@yGywq9@MC2F

literal 0
HcmV?d00001

diff --git a/Telegram/Resources/icons/ayu/dialogs_extera_supporter@2x.png b/Telegram/Resources/icons/ayu/dialogs_extera_supporter@2x.png
new file mode 100644
index 0000000000000000000000000000000000000000..ed302252969bec6852080593a8f9e9d675a8fe1c
GIT binary patch
literal 415
zcmV;Q0bu@#P)<h;3K|Lk000e1NJLTq001Na001Be1^@s6dXd_W00009a7bBm000XU
z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH0W?WOK~#7F?UwBk
zLqHIQH<=Wm14_^VCFp<>bfN@0p#&Y!ff6>>%w;Z;<GvO@yfZtQ#0?M6?ZyKD5H6G_
zTr4-xUT&bhyx^n+K>%?aFQ0wi!#IwgV|Y}}7soVBv94>JrU^xcVZa$qtUCu{9Xd|y
zS(FJKd7eX-Wy^Py9Qq_wnc>})5kyfG*tV?|gq$df?0|eih|syDYv{w!T~J5(j-<;B
zsH!UDh@=aRCbem|=%nkquc2rJL=)9_nx^^r&1h5m)+Xx$+qS2Z(7bWYs=M6hkSo}#
zyWD|9m1Su)lm6)P14Kpt)+SI2UH*Vfp%l9O0ttN%y8HuCkq%2;JV12!mb!R=sJ6zz
zhAuuJ+Ta$t_<&S<X-5|?(E9yJ<LU4MiAs_L!!XoZ`w&!D$s5FH-HLzzQu_b^002ov
JPDHLkV1mUlt>gdz

literal 0
HcmV?d00001

diff --git a/Telegram/Resources/icons/ayu/dialogs_extera_supporter@3x.png b/Telegram/Resources/icons/ayu/dialogs_extera_supporter@3x.png
new file mode 100644
index 0000000000000000000000000000000000000000..6b517a1922536ea032b3dada952452f4a69dd47b
GIT binary patch
literal 568
zcmV-80>}M{P)<h;3K|Lk000e1NJLTq001@s001xu1^@s6S{#YM00009a7bBm000XU
z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH0nJH7K~#7F?V63v
zf-n$<&u;=pa06Fx1KmJ3kPR4t5nuyg0$>8z05*UP?(30|kcv?7Xba&<E;0T9Px^Ya
z)e`_9?2td$DTmnBIK;NbA+|LRv8}N=vGe&1uh$EbB!RlF0TCh3b9g?VAMZumOUR&*
zK_P=e2EXArPXBZE%Dmt2Rz{VwEbSCqA|qps7>7&;#nh-6r%azP4E2kxCDTWAMm=IW
zWctwgRuj`L(?RExu7yYFcDrep=_AFEN9=OBplRqD*u_ka6fqD(9x>Al#1L5~!A;YE
zNwO^ac#cJ^C<-t|nx;@y)!=I^9nq#30%yB_JRa@rS~mmTkXNiLS~uwu{L&5A5z{F+
z62tYxx}sI>*sAvzMq;?W7!_Rr_f32vhI+)ha$Og>n24cXF;2OO80r_}kds!*_J~mh
zL4Zq9h@m+#T97Wi9Y`x>yTquLOvMyqXjY8M_x(9usxdS#M%``B4O}sX=EbN~yCjY7
zjN_UYqft;9wfp_PEio$3^G2nl?d!?1=J&BUjz?dQq6p?<#fVXjO_Z<K>)hknBSzmf
zx&2cFX=i!vu}+<xO^90nh!JWZ(+<><T`()fIN0sK2L1t16P!015ZQ770000<MNUMn
GLSTY0(DPaV

literal 0
HcmV?d00001

diff --git a/Telegram/SourceFiles/ayu/ui/ayu_icons.style b/Telegram/SourceFiles/ayu/ui/ayu_icons.style
index a215d0358..e8c242004 100644
--- a/Telegram/SourceFiles/ayu/ui/ayu_icons.style
+++ b/Telegram/SourceFiles/ayu/ui/ayu_icons.style
@@ -9,6 +9,7 @@
 
 using "ui/colors.palette";
 using "ui/widgets/widgets.style";
+using "dialogs/dialogs.style";
 
 ayuGhostIcon: icon {{ "ayu/ghost", menuIconColor }};
 ayuMenuIcon: icon {{ "ayu/ayu_menu", menuIconColor }};
@@ -40,3 +41,14 @@ editedIconPadding: margins(0px, 0px, 0px, 0px);
 
 deletedIcon: icon {{ "ayu/trash_bin", windowFg }};
 deletedIconPadding: margins(0px, 0px, 0px, 0px);
+
+dialogsExteraOfficialIcon: ThreeStateIcon {
+	icon: icon {{ "ayu/dialogs_extera_official", dialogsVerifiedIconBg }};
+	over: icon {{ "ayu/dialogs_extera_official", dialogsVerifiedIconBgOver }};
+	active: icon {{ "ayu/dialogs_extera_official", dialogsVerifiedIconBgActive }};
+}
+dialogsExteraSupporterIcon: ThreeStateIcon {
+	icon: icon {{ "ayu/dialogs_extera_supporter", dialogsVerifiedIconBg }};
+	over: icon {{ "ayu/dialogs_extera_supporter", dialogsVerifiedIconBgOver }};
+	active: icon {{ "ayu/dialogs_extera_supporter", dialogsVerifiedIconBgActive }};
+}
diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp
index 69d304a14..67ef1c81d 100644
--- a/Telegram/SourceFiles/boxes/peer_list_box.cpp
+++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp
@@ -39,6 +39,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #include <xxhash.h> // XXH64.
 #include <QtWidgets/QApplication>
 
+// AyuGram includes
+#include "styles/style_ayu_icons.h"
+
+
 [[nodiscard]] PeerListRowId UniqueRowIdFromString(const QString &d) {
 	return XXH64(d.data(), d.size() * sizeof(ushort), 0);
 }
@@ -800,6 +804,12 @@ int PeerListRow::paintNameIconGetWidth(
 		.verified = &(selected
 			? st::dialogsVerifiedIconOver
 			: st::dialogsVerifiedIcon),
+		.exteraOfficial = &(selected
+			? st::dialogsExteraOfficialIcon.over
+			: st::dialogsExteraOfficialIcon.icon),
+		.exteraSupporter = &(selected
+			? st::dialogsExteraSupporterIcon.over
+			: st::dialogsExteraSupporterIcon.icon),
 		.premium = &(selected
 			? st::dialogsPremiumIcon.over
 			: st::dialogsPremiumIcon.icon),
diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
index 45324201a..05c774c99 100644
--- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
+++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
@@ -84,6 +84,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 
 #include <QtWidgets/QApplication>
 
+// AyuGram includes
+#include "styles/style_ayu_icons.h"
+
+
 namespace Dialogs {
 namespace {
 
@@ -1458,6 +1462,14 @@ void InnerWidget::paintPeerSearchResult(
 			: context.selected
 			? &st::dialogsVerifiedIconOver
 			: &st::dialogsVerifiedIcon),
+		.exteraOfficial = &ThreeStateIcon(
+			st::dialogsExteraOfficialIcon,
+			context.active,
+			context.selected),
+		.exteraSupporter = &ThreeStateIcon(
+			st::dialogsExteraSupporterIcon,
+			context.active,
+			context.selected),
 		.premium = &ThreeStateIcon(
 			st::dialogsPremiumIcon,
 			context.active,
diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
index 13b69c128..db7da1fe7 100644
--- a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
+++ b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
@@ -44,6 +44,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #include "styles/style_widgets.h"
 #include "styles/style_window.h"
 
+// AyuGram includes
+#include "styles/style_ayu_icons.h"
+
+
 namespace Dialogs::Ui {
 namespace {
 
@@ -716,6 +720,14 @@ void PaintRow(
 				: context.selected
 				? &st::dialogsVerifiedIconOver
 				: &st::dialogsVerifiedIcon),
+			.exteraOfficial = &ThreeStateIcon(
+				st::dialogsExteraOfficialIcon,
+				context.active,
+				context.selected),
+			.exteraSupporter = &ThreeStateIcon(
+				st::dialogsExteraSupporterIcon,
+				context.active,
+				context.selected),
 			.premium = &ThreeStateIcon(
 				st::dialogsPremiumIcon,
 				context.active,
diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp
index 1eaa604e6..6033ec929 100644
--- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp
+++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp
@@ -74,6 +74,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #include "data/data_chat_filters.h"
 #include "history/admin_log/history_admin_log_section.h"
 #include "styles/style_ayu_styles.h"
+#include "styles/style_ayu_icons.h"
 
 
 namespace HistoryView {
@@ -616,6 +617,8 @@ void TopBarWidget::paintTopBar(Painter &p) {
 			.nameWidth = _title.maxWidth(),
 			.outerWidth = width(),
 			.verified = &st::dialogsVerifiedIcon,
+			.exteraOfficial = &st::dialogsExteraOfficialIcon.icon,
+			.exteraSupporter = &st::dialogsExteraSupporterIcon.icon,
 			.premium = &st::dialogsPremiumIcon.icon,
 			.scam = &st::attentionButtonFg,
 			.premiumFg = &st::dialogsVerifiedIconBg,
diff --git a/Telegram/SourceFiles/ui/unread_badge.cpp b/Telegram/SourceFiles/ui/unread_badge.cpp
index cabe23ae5..502493769 100644
--- a/Telegram/SourceFiles/ui/unread_badge.cpp
+++ b/Telegram/SourceFiles/ui/unread_badge.cpp
@@ -19,6 +19,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #include "ui/unread_badge_paint.h"
 #include "styles/style_dialogs.h"
 
+// AyuGram includes
+#include "ayu/utils/telegram_helpers.h"
+
+
 namespace Ui {
 namespace {
 
@@ -154,6 +158,16 @@ int PeerBadge::drawGetWidth(Painter &p, Descriptor &&descriptor) {
 		&& (!paintVerify || descriptor.bothVerifyAndStatus);
 	const auto paintStar = premiumStar && !paintVerify;
 
+	const auto paintExteraDev =
+		isExteraPeer(getBareID(peer)) && (!paintEmoji || descriptor.bothVerifyAndStatus);
+	const auto paintExteraSupporter = !paintExteraDev &&
+		isSupporterPeer(getBareID(peer)) && (!paintEmoji || descriptor.bothVerifyAndStatus);
+	const auto exteraWidth = paintExteraDev
+								 ? descriptor.exteraOfficial->width()
+								 : paintExteraSupporter
+									   ? descriptor.exteraSupporter->width()
+									   : 0;
+
 	auto result = 0;
 	if (paintEmoji) {
 		auto &rectForName = descriptor.rectForName;
@@ -161,13 +175,34 @@ int PeerBadge::drawGetWidth(Painter &p, Descriptor &&descriptor) {
 		if (paintVerify) {
 			rectForName.setWidth(rectForName.width() - verifyWidth);
 		}
+		if (paintExteraDev || paintExteraSupporter) {
+			rectForName.setWidth(rectForName.width() - exteraWidth);
+		}
 		result += drawPremiumEmojiStatus(p, descriptor);
-		if (!paintVerify) {
+		if (!paintVerify && !paintExteraDev) {
 			return result;
 		}
-		rectForName.setWidth(rectForName.width() + verifyWidth);
+		if (paintVerify) {
+			rectForName.setWidth(rectForName.width() + verifyWidth);
+		}
+		if (paintExteraDev || paintExteraSupporter) {
+			rectForName.setWidth(rectForName.width() + exteraWidth);
+		}
 		descriptor.nameWidth += result;
 	}
+
+	if (paintExteraDev || paintExteraSupporter) {
+		if (paintStar) {
+			auto &rectForName = descriptor.rectForName;
+			rectForName.setWidth(rectForName.width() - exteraWidth);
+			result += drawPremiumStar(p, descriptor);
+			rectForName.setWidth(rectForName.width() + exteraWidth);
+			descriptor.nameWidth += result;
+		}
+		result += paintExteraDev ? drawExteraOfficial(p, descriptor) : drawExteraSupporter(p, descriptor);
+		return result;
+	}
+
 	if (paintVerify) {
 		result += drawVerifyCheck(p, descriptor);
 		return result;
@@ -267,6 +302,30 @@ int PeerBadge::drawPremiumStar(Painter &p, const Descriptor &descriptor) {
 	return iconw;
 }
 
+int PeerBadge::drawExteraOfficial(Painter &p, const Descriptor &descriptor) {
+	const auto iconw = descriptor.exteraOfficial->width();
+	const auto rectForName = descriptor.rectForName;
+	const auto nameWidth = descriptor.nameWidth;
+	descriptor.exteraOfficial->paint(
+		p,
+		rectForName.x() + qMin(nameWidth, rectForName.width() - iconw),
+		rectForName.y(),
+		descriptor.outerWidth);
+	return iconw;
+}
+
+int PeerBadge::drawExteraSupporter(Painter &p, const Descriptor &descriptor) {
+	const auto iconw = descriptor.exteraSupporter->width();
+	const auto rectForName = descriptor.rectForName;
+	const auto nameWidth = descriptor.nameWidth;
+	descriptor.exteraSupporter->paint(
+		p,
+		rectForName.x() + qMin(nameWidth, rectForName.width() - iconw),
+		rectForName.y(),
+		descriptor.outerWidth);
+	return iconw;
+}
+
 void PeerBadge::unload() {
 	_emojiStatus = nullptr;
 }
diff --git a/Telegram/SourceFiles/ui/unread_badge.h b/Telegram/SourceFiles/ui/unread_badge.h
index 5fd7990c4..a160fd63c 100644
--- a/Telegram/SourceFiles/ui/unread_badge.h
+++ b/Telegram/SourceFiles/ui/unread_badge.h
@@ -56,6 +56,8 @@ public:
 		int nameWidth = 0;
 		int outerWidth = 0;
 		const style::icon *verified = nullptr;
+		const style::icon *exteraOfficial = nullptr;
+		const style::icon *exteraSupporter = nullptr;
 		const style::icon *premium = nullptr;
 		const style::color *scam = nullptr;
 		const style::color *premiumFg = nullptr;
@@ -89,6 +91,9 @@ private:
 	int drawPremiumEmojiStatus(Painter &p, const Descriptor &descriptor);
 	int drawPremiumStar(Painter &p, const Descriptor &descriptor);
 
+	int drawExteraOfficial(Painter &p, const Descriptor &descriptor);
+	int drawExteraSupporter(Painter &p, const Descriptor &descriptor);
+
 	std::unique_ptr<EmojiStatus> _emojiStatus;
 	mutable std::unique_ptr<BotVerifiedData> _botVerifiedData;