From e63d573414622b79b53d571a33f12a4958b88f13 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 9 Jan 2024 04:19:55 -0800 Subject: [PATCH] Proof-of-concept last seen hidden. --- .../icons/settings/premium/large_lastseen.png | Bin 0 -> 1864 bytes .../settings/premium/large_lastseen@2x.png | Bin 0 -> 3667 bytes .../settings/premium/large_lastseen@3x.png | Bin 0 -> 5500 bytes .../icons/settings/premium/large_readtime.png | Bin 0 -> 1768 bytes .../settings/premium/large_readtime@2x.png | Bin 0 -> 3483 bytes .../settings/premium/large_readtime@3x.png | Bin 0 -> 5251 bytes Telegram/Resources/langs/lang.strings | 16 +- .../SourceFiles/boxes/premium_preview_box.cpp | 195 ++++++++++++++++++ .../SourceFiles/boxes/premium_preview_box.h | 11 + .../info/profile/info_profile_cover.cpp | 45 +++- .../settings/settings_privacy_controllers.cpp | 21 +- .../settings/settings_privacy_controllers.h | 2 + Telegram/SourceFiles/ui/effects/premium.style | 26 +++ 13 files changed, 291 insertions(+), 25 deletions(-) create mode 100644 Telegram/Resources/icons/settings/premium/large_lastseen.png create mode 100644 Telegram/Resources/icons/settings/premium/large_lastseen@2x.png create mode 100644 Telegram/Resources/icons/settings/premium/large_lastseen@3x.png create mode 100644 Telegram/Resources/icons/settings/premium/large_readtime.png create mode 100644 Telegram/Resources/icons/settings/premium/large_readtime@2x.png create mode 100644 Telegram/Resources/icons/settings/premium/large_readtime@3x.png diff --git a/Telegram/Resources/icons/settings/premium/large_lastseen.png b/Telegram/Resources/icons/settings/premium/large_lastseen.png new file mode 100644 index 0000000000000000000000000000000000000000..e47bd7935bc38ba2adea14a70d045dc999917df4 GIT binary patch literal 1864 zcmV-O2ePx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NIvPnciR9Fe^m}_XxZ5Y5G=i?kV za-Lx)d|1tL$g%JNV{1;M>)nTS-Ph^9p6kAjf1mI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z)Sz1{5o}&`g=7(f(5*ynCfMnaKgIPt7)RplC^_d$9H7Zhyaof2|-fheP_-rfA!ZP z2;zf;$BIvvD7{C9WV?(db-34lbIl$(#y*S_!;5?9RPW+T2F z4xneT#P{W;Jkp13#K3eX7MADFpZ8nT;e)IHp&Xh7Bvc4oD8<^vV)9Sk5rf2wm4RyW zhdW$yl8$6Ue285maurHQy+Pebh^+r5g~v$2{rdIOZvZM` zNbR+3+48m5UQ>`r!(-)5a82Qz|Cg&q{zlgj3IIP`PGO%p3Rcv3^6k= z(~h7sVNN~16#m8-)+Teq`{&21qzr|#QS=0?Zkb7D*H24s({13QW)iD55aAW`g002ovPDHLkV1inv{YC%) literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/settings/premium/large_lastseen@3x.png b/Telegram/Resources/icons/settings/premium/large_lastseen@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..0cd1e12ab09dc27ab556a77078fb322b56164616 GIT binary patch literal 5500 zcmZWtWmr^Qv>sBrV;H(aQefzilrBXO7-@+S25F>`W(esn>4uN)ZlshHhL-NGJN~)% z$NjPPde1)VdDec`-s|l5J>lA#%J?`S8~^}-ukuDg7wKdF85SyXv|({QMmiK{U1d2y zS1^}Stpa9U29_8O$4(k8Djm<&(Km0FH zMg}Jg03h2|QF#5<1LZK&b)KT1qD$tW>xe+Rigq5JIsYg8v^XZfq&R2(55AlGN1ZAj z3NWNqqN?Khy1IqCRq)fq*!KOYuU}VN9qCTSLZ+A$E$v|^7-NylMlVMr;Qs?I&dGw2 zVbx6ghtt7qSPwRPnhg_9=fm0PbI9}K%|^__^B}!ng1Bp9P~&`{>+ZDG0M(}qi)gVY z;fI)>^16u;rkc0;G14t?So!J;dhe6fzSVTcj@!Has^_aE#|B<_g<}8)wey$&rHRWF zxxRr}KlyuO%Q(dWYR5LY;@cT58L8XN_-Cr8>v@Y9pXbNxU_6OEf>-wkb=SKyJC&_R zcWa^aPh7Xh*QRXhj#(y3M164I_n-9B z&Bk%ZJps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d*3-!?Ab7H9+@j23ib{*KZzZgS)NuizFoxCq!I>Mx%Kfnr1rAY?me@J|(s>ur7GBj+``B6p+ytu}auRo3l`kQW= zD(wGIv>(^7B%ri-A#oq<6MT}2<;}n9%4zt)9zHht-3he>*Myk+>-?*s_G*x`1-dyE zXvyv^m$js8z3`Bkco$v;f-77S0g+LlGOoX&Y#y1Mc-N1EPYuSi=L4xdS=G-2Ofu8X z+7c#a*R(wgYq40l&F4W+AgQ#R?7Bs|8Y(h%BG`! h#`$0HARq9ICMM~z;#+~L{qN7GilU}MrJQNt{{ZB5hnWBX literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/settings/premium/large_readtime.png b/Telegram/Resources/icons/settings/premium/large_readtime.png new file mode 100644 index 0000000000000000000000000000000000000000..c06294a82e44e211c095e6c567a4a3e266597aef GIT binary patch literal 1768 zcmVP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NIQb|NXR9Fe^SX)R{O%&c{8Jd>@ zyZqhMitHsSFG(huDB?o|Y7`NLz8FYKn1}``n77hE(e%X!>p{FnVreNESqP$J<}Jds zyk()5rd`zj|I-!YoW1Alv-hc&A36_*nYF%k*)wa_S~HUL_xC?r0Soi|UA1b}kt0Xk z+}t*A-u%zf&(hNJ{rmT0V`KR5?Ch+sumAGpi+Rd*NZHufoI7`}tgP(w=gJFH-MxFax-K{u9vCb;w2-l8&6*c4UXc9!{QRX$mxM4~#NgoI>FH_GIW#ncXwxc=b-r`w4oQCf`ZXvh zNUNkN+}^!=KYsj3nwy)OSFc`eN@9thn3za1_&;;zj3yb)AYWhKxw$#gUszaZT5kLH z?cctABLN&#(*pVt$Y<<>O$XEM+qVh*?AfywD^}?|BQ zbVv>Qd%T@HcmDYCgM9My^E0ZfsHliQm6er7L4Sx*P*6a&8X6kJDp#&tIX*s4Ae3=2 z$Si6|NC@&_US1wAy=BW5BovrKjIUk0mS_DMqX3aNZ{EBSu+1gmSh3wfpTeto`t&JT zM6G1><*-HKB5GAt6=VPA0QDHVkAet2EiEmm!MwtI_wLd3*s)_g{nz-(lPBb_zrVkL zt)FCXZ{O9`MLOZi)~#D*I`-|`N8G`|K^bdt`tIF3VmmuK3)nhIs9&|UwWJW~{@}rb zN(I26X#oad#P=$TNUSRH5NL>QrLbN~c6K&-ga6Z~Pa6~e@Zkf&)~{c0fI(M94Dsq2 zU>7G>uU^F#A3l6o!C53kL_{!el9Q8#7$SCbbPy6{&Hx4niGilafUz{$vu6*Y;nAZ< zRHB*p6B85YQe=1}I(Dqe%gg0^VTf*OY9hNnK0XEXd3 zQdn(x`SPWbE8&tr+N-Op1#C&el@Epqg8+w%Jca1^NBb-kR}yn_a!4vGD@)0hkmiYv z1zfjood6+8I6;)IfJ9>n48D?4Kt!V>6ciF!kQ_aFR0xpRHR|%^%VLBiu?818jWDUH zsq`hNR@Tc*(IZE_ASjQNT z4eZPKfwExXqw#8kSA=WVu9cRSq8;Gz7^AA-f~Lc^5{eTcQ_8035@mRn=op3#P(g7I zRBvQu+Qd`zls9kQ#Onkuvh1vq8QDbu=Y_rCFhB4{hBJZgfKOv$ONP|tms>-+!3-vm zEzvL255}%vzs@7@vWalP1p%e-?c2BLl%GF;4(E8x-|-(>f&TzKwvsa^bnR;Z0000< KMNUMnLSTZsmOowq literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/settings/premium/large_readtime@2x.png b/Telegram/Resources/icons/settings/premium/large_readtime@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f30a355ee8d7aa1c3d7b77632e1b2ebefd048d84 GIT binary patch literal 3483 zcmV;M4P^3(P)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91V4wp41ONa40RR91U;qFB0I4%yP5=N61xZ9fRCodHoM*5V#S(xoK}F;# zL6oQj1tf?C2qNJr5=tPQ6);SNJ>Eg0xIYOB^L##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ST0 zVy7yOVoZX(|V z7G!l5cU6d20|I`x66x^S%cx!kDR{o{_@rNW;RRfLq@nP`Swq==BA}0l4IB3EyYI5} zeEW(cfW8i-U!!ipe)HyuecD6aYJ%<-j(d|QPY%KR<;|kaQ{Jb|7dPG9N6OxDNAxZk z>l(|qg_uOJv~-)n283~+)O`ow0C*?ElVj~bS{6v>>DskxoMO|CXtFq^s0v&pAcR7+ ziyzw)_6UEyeHtVLx^rK2cif!t{f0Kmg-<7N0e9iTg+%T(kLu|{E2aEs!002ov JPDHLkV1msInZW=6 literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/settings/premium/large_readtime@3x.png b/Telegram/Resources/icons/settings/premium/large_readtime@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..1e7d022a30e9918d4aa81a699eebb8daf0ff6823 GIT binary patch literal 5251 zcmZWtWmHsA*Cqy}q`L=(?(RlHhE}AzJ0%4MhZsN@L=X@JBm@Czq+{rA=?>}c@*V$t z-@DfPW1oHQzUSPv&biO?oV^cBM@#iN4mA!63d(bJHDx`dhyODyG-T@t@;gR4R3AN6 zMUxsQ+R)X#e*Xo`e4X z{eJ`H=c4k9?TtgO11at$Ht z_}v_&{!X~1ijegq>BZ&yc~9+0(D@)(u)n`S>^f1@L9p84SSC4LW}&dG?5RXT$0ui7 zei)L0F7nJ7e~Px~zXS2KJJunSl6lZ`!8j|*GK0gQpX|Z!xRrv=R-nlI;pQNdKtpvX(i6G#>0@4 zu1?lEv%{WlEkbWuirrrf8r!sQXZnnMl?lG0e4MFud6U@ua6T$$5wu&t_BCL=pDjCN zulRfD&DyiXb}5P?UbDv13Iq;?dBEB;hLDpsy{D(Adk@+A<(A-uu&OK+Jrx&0>I`#TU`{oL;*AO}Y6bSm*&-(vuPFm z*Gh5z+s$N#x3gB+@2-rJdstc)R2km+9@fs#k1Hdz2uKX2op)OAZfg!Z8zDQ=IiC)!{SwN!`_b)gIEBUZDEEp=fz5@ z@3*G?nR1I1GJluSO3XS+4ex)8<@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6we?)g8phY=rRK!cX*t-{@>Xymg+>B^FKp>^vg*O=+!Oa$d5bAdR0DWr$IQuqCjVTZ;7u zy}92)dvZu?d-K1EY#5F37{LvB-qQ$yL1!5xyiOsOB_A63DqVDAUaPS+m+#DWjh{&w zR}6{7!rlXl69DBttq2zDf)s;TlI4#q#p!`U{DUGM7*X+fEwjQ39~Qi#IMXa7K~qs2 zr;_$01&qHTbmvz!Sz(@2CGsd$$dRZmA>CQIZ8(T)>-m|*FyDgU5|1Xf{g0L z0hrYWket<2a?oUtp=9P_BMQPLelKj>N2n6xrAXqqqCw)4Dq{)Dx6bcz5EYEQ*=xUZ ztDB3O7O6}rhSRP?MXnC!ger!s$Gk|eu3Utn>>?*j q5``YWT%mhU|8wEyj8EDF`HK#S?QraOhMWGo091dWrTkOTGU7kg*!mj) literal 0 HcmV?d00001 diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index bf186e1f7..73d0fde25 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -170,21 +170,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_remember" = "Remember this choice"; -"lng_lastseen_show_title" = "Show your last seen"; -"lng_lastseen_show_about" = "To see **{user}'s** Last Seen time, either start showing your own Last Seen time..."; -"lng_lastseen_show_button" = "Show my Last Seen"; +"lng_lastseen_show_title" = "Show Your Last Seen"; +"lng_lastseen_show_about" = "To see **{user}'s** Last Seen time, either start\nshowing your own Last Seen time..."; +"lng_lastseen_show_button" = "Show My Last Seen"; "lng_lastseen_or" = "or"; "lng_lastseen_premium_title" = "Upgrade to Premium"; -"lng_lastseen_premium_about" = "Subscription will let you see **{user}'s** Last Seen status without showing yours."; +"lng_lastseen_premium_about" = "Subscription will let you see **{user}'s** Last Seen\nstatus without showing yours."; "lng_lastseen_premium_button" = "Subscribe to Telegram Premium"; "lng_lastseen_shown_toast" = "Your last seen time is now visible."; -"lng_readtime_show_title" = "Show your read date"; -"lng_readtime_show_about" = "To see when **{user}** read the message, either start showing your own read time..."; -"lng_readtime_show_button" = "Show my Read Time"; +"lng_readtime_show_title" = "Show Your Read Date"; +"lng_readtime_show_about" = "To see when **{user}** read the message,\neither start showing your own read time..."; +"lng_readtime_show_button" = "Show My Read Time"; "lng_readtime_or" = "or"; "lng_readtime_premium_title" = "Upgrade to Premium"; -"lng_readtime_premium_about" = "Subscription will let you see **{user}'s** read time without showing yours."; +"lng_readtime_premium_about" = "Subscription will let you see **{user}'s** read time\nwithout showing yours."; "lng_readtime_premium_button" = "Subscribe to Telegram Premium"; "lng_readtime_shown_toast" = "Your read times are now visible."; diff --git a/Telegram/SourceFiles/boxes/premium_preview_box.cpp b/Telegram/SourceFiles/boxes/premium_preview_box.cpp index 06835d603..4f5afd8f0 100644 --- a/Telegram/SourceFiles/boxes/premium_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/premium_preview_box.cpp @@ -55,6 +55,7 @@ constexpr auto kToggleStickerTimeout = 2 * crl::time(1000); constexpr auto kStarOpacityOff = 0.1; constexpr auto kStarOpacityOn = 1.; constexpr auto kStarPeriod = 3 * crl::time(1000); +constexpr auto kShowOrLineOpacity = 0.3; using Data::ReactionId; @@ -1315,6 +1316,200 @@ void PremiumUnavailableBox(not_null box) { }); } +[[nodiscard]] object_ptr MakeShowOrPremiumIcon( + not_null parent, + not_null icon) { + const auto margin = st::showOrIconMargin; + const auto padding = st::showOrIconPadding; + const auto inner = padding.top() + icon->height() + padding.bottom(); + const auto full = margin.top() + inner + margin.bottom(); + auto result = object_ptr(parent, full); + const auto raw = result.data(); + + raw->resize(st::boxWideWidth, full); + raw->paintRequest( + ) | rpl::start_with_next([=] { + auto p = QPainter(raw); + auto hq = PainterHighQualityEnabler(p); + const auto width = raw->width(); + const auto position = QPoint((width - inner) / 2, margin.top()); + const auto rect = QRect(position, QSize(inner, inner)); + const auto shift = QPoint(padding.left(), padding.top()); + p.setPen(Qt::NoPen); + p.setBrush(st::showOrIconBg); + p.drawEllipse(rect); + icon->paint(p, position + shift, width); + }, raw->lifetime()); + + return result; +} + +[[nodiscard]] object_ptr MakeShowOrLabel( + not_null parent, + rpl::producer text) { + auto result = object_ptr( + parent, + std::move(text), + st::showOrLabel); + const auto raw = result.data(); + + raw->paintRequest( + ) | rpl::start_with_next([=] { + auto p = QPainter(raw); + + const auto full = st::showOrLineWidth; + const auto left = (raw->width() - full) / 2; + const auto text = raw->textMaxWidth() + 2 * st::showOrLabelSkip; + const auto fill = (full - text) / 2; + const auto stroke = st::lineWidth; + const auto top = st::showOrLineTop; + p.setOpacity(kShowOrLineOpacity); + p.fillRect(left, top, fill, stroke, st::windowSubTextFg); + const auto start = left + full - fill; + p.fillRect(start, top, fill, stroke, st::windowSubTextFg); + }, raw->lifetime()); + + return result; +} + +void ShowOrPremiumBox( + not_null box, + ShowOrPremium type, + QString shortName, + Fn justShow, + Fn toPremium) { + struct Skin { + rpl::producer showTitle; + rpl::producer showAbout; + rpl::producer showButton; + rpl::producer orPremium; + rpl::producer premiumTitle; + rpl::producer premiumAbout; + rpl::producer premiumButton; + QString toast; + const style::icon *icon = nullptr; + }; + auto skin = (type == ShowOrPremium::LastSeen) + ? Skin{ + tr::lng_lastseen_show_title(), + tr::lng_lastseen_show_about( + lt_user, + rpl::single(TextWithEntities{ shortName }), + Ui::Text::RichLangValue), + tr::lng_lastseen_show_button(), + tr::lng_lastseen_or(), + tr::lng_lastseen_premium_title(), + tr::lng_lastseen_premium_about( + lt_user, + rpl::single(TextWithEntities{ shortName }), + Ui::Text::RichLangValue), + tr::lng_lastseen_premium_button(), + tr::lng_lastseen_shown_toast(tr::now), + &st::showOrIconLastSeen, + } + : (type == ShowOrPremium::ReadTime) + ? Skin{ + tr::lng_readtime_show_title(), + tr::lng_readtime_show_about( + lt_user, + rpl::single(TextWithEntities{ shortName }), + Ui::Text::RichLangValue), + tr::lng_readtime_show_button(), + tr::lng_readtime_or(), + tr::lng_readtime_premium_title(), + tr::lng_readtime_premium_about( + lt_user, + rpl::single(TextWithEntities{ shortName }), + Ui::Text::RichLangValue), + tr::lng_readtime_premium_button(), + tr::lng_readtime_shown_toast(tr::now), + &st::showOrIconReadTime, + } + : Skin(); + + box->setStyle(st::showOrBox); + box->setWidth(st::boxWideWidth); + box->addTopButton(st::boxTitleClose, [=] { + box->closeBox(); + }); + + box->addRow(MakeShowOrPremiumIcon(box, skin.icon)); + box->addRow( + object_ptr( + box, + std::move(skin.showTitle), + st::boostCenteredTitle), + st::showOrTitlePadding); + box->addRow( + object_ptr( + box, + std::move(skin.showAbout), + st::boostText), + st::showOrAboutPadding); + const auto show = box->addRow( + object_ptr( + box, + std::move(skin.showButton), + st::showOrShowButton), + QMargins( + st::showOrBox.buttonPadding.left(), + 0, + st::showOrBox.buttonPadding.right(), + 0)); + show->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); + box->addRow( + MakeShowOrLabel(box, std::move(skin.orPremium)), + st::showOrLabelPadding); + box->addRow( + object_ptr( + box, + std::move(skin.premiumTitle), + st::boostCenteredTitle), + st::showOrTitlePadding); + box->addRow( + object_ptr( + box, + std::move(skin.premiumAbout), + st::boostText), + st::showOrPremiumAboutPadding); + + const auto premium = Ui::CreateChild( + box.get(), + Ui::Premium::ButtonGradientStops()); + + const auto &st = st::premiumPreviewBox.button; + premium->resize(st::showOrShowButton.width, st::showOrShowButton.height); + + const auto label = Ui::CreateChild( + premium, + std::move(skin.premiumButton), + st::premiumPreviewButtonLabel); + label->setAttribute(Qt::WA_TransparentForMouseEvents); + rpl::combine( + premium->widthValue(), + label->widthValue() + ) | rpl::start_with_next([=](int outer, int width) { + label->moveToLeft( + (outer - width) / 2, + st::premiumPreviewBox.button.textTop, + outer); + }, label->lifetime()); + + box->setShowFinishedCallback([=] { + premium->startGlareAnimation(); + }); + + box->addButton( + object_ptr::fromRaw(premium)); + + show->setClickedCallback([box, justShow, toast = skin.toast] { + justShow(); + box->uiShow()->showToast(toast); + box->closeBox(); + }); + premium->setClickedCallback(std::move(toPremium)); +} + void DoubledLimitsPreviewBox( not_null box, not_null session) { diff --git a/Telegram/SourceFiles/boxes/premium_preview_box.h b/Telegram/SourceFiles/boxes/premium_preview_box.h index 60c5699ca..f49cdf618 100644 --- a/Telegram/SourceFiles/boxes/premium_preview_box.h +++ b/Telegram/SourceFiles/boxes/premium_preview_box.h @@ -83,6 +83,17 @@ void ShowPremiumPreviewToBuy( void PremiumUnavailableBox(not_null box); +enum class ShowOrPremium : uchar { + LastSeen, + ReadTime, +}; +void ShowOrPremiumBox( + not_null box, + ShowOrPremium type, + QString shortName, + Fn justShow, + Fn toPremium); + [[nodiscard]] object_ptr CreateUnlockButton( QWidget *parent, rpl::producer text); diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp index 3f9445787..15ec3df2b 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "info/profile/info_profile_cover.h" +#include "api/api_user_privacy.h" #include "data/data_peer_values.h" #include "data/data_channel.h" #include "data/data_chat.h" @@ -23,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "info/profile/info_profile_emoji_status_panel.h" #include "info/info_controller.h" #include "boxes/peers/edit_forum_topic_box.h" +#include "boxes/premium_preview_box.h" #include "history/view/media/history_view_sticker_player.h" #include "lang/lang_keys.h" #include "ui/controls/userpic_button.h" @@ -373,23 +375,54 @@ void Cover::setupShowLastSeen() { && !user->isBot() && !user->isServiceUser() && user->session().premiumPossible()) { + if (user->session().premium()) { + if (user->onlineTill == kOnlineHidden) { + user->updateFullForced(); + } + _showLastSeen->hide(); + return; + } + rpl::combine( user->session().changes().peerFlagsValue( user, Data::PeerUpdate::Flag::OnlineStatus), Data::AmPremiumValue(&user->session()) - ) | rpl::start_with_next([=] { - _showLastSeen->setVisible( - (user->onlineTill == kOnlineHidden) - && !user->session().premium() - && user->session().premiumPossible()); + ) | rpl::start_with_next([=](auto, bool premium) { + const auto wasShown = !_showLastSeen->isHidden(); + const auto onlineHidden = (user->onlineTill == kOnlineHidden); + const auto shown = onlineHidden + && !premium + && user->session().premiumPossible(); + _showLastSeen->setVisible(shown); + if (wasShown && premium && onlineHidden) { + user->updateFullForced(); + } + }, _showLastSeen->lifetime()); + + _controller->session().api().userPrivacy().value( + Api::UserPrivacy::Key::LastSeen + ) | rpl::filter([=](Api::UserPrivacy::Rule rule) { + return (rule.option == Api::UserPrivacy::Option::Everyone); + }) | rpl::start_with_next([=] { + if (user->onlineTill == kOnlineHidden) { + user->updateFullForced(); + } }, _showLastSeen->lifetime()); } else { _showLastSeen->hide(); } _showLastSeen->setClickedCallback([=] { - ::Settings::ShowPremium(_controller, u"lastseen_hidden"_q); + const auto type = ShowOrPremium::LastSeen; + auto box = Box(ShowOrPremiumBox, type, user->shortName(), [=] { + _controller->session().api().userPrivacy().save( + ::Api::UserPrivacy::Key::LastSeen, + {}); + }, [=] { + ::Settings::ShowPremium(_controller, u"lastseen_hidden"_q); + }); + _controller->show(std::move(box)); }); } diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index c38afcd32..34e98bd42 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -710,21 +710,13 @@ object_ptr LastSeenPrivacyController::setupBelowWidget( void LastSeenPrivacyController::confirmSave( bool someAreDisallowed, Fn saveCallback) { - const auto privacy = &_session->api().globalPrivacy(); - const auto hideReadTime = _hideReadTime; - const auto save = [=, saveCallback = std::move(saveCallback)] { - if (privacy->hideReadTimeCurrent() != hideReadTime) { - privacy->updateHideReadTime(hideReadTime); - } - saveCallback(); - }; if (someAreDisallowed && !Core::App().settings().lastSeenWarningSeen()) { auto callback = [ =, - save = std::move(save) + saveCallback = std::move(saveCallback) ](Fn &&close) { close(); - save(); + saveCallback(); Core::App().settings().setLastSeenWarningSeen(true); Core::App().saveSettingsDelayed(); }; @@ -735,7 +727,14 @@ void LastSeenPrivacyController::confirmSave( }); Ui::show(std::move(box), Ui::LayerOption::KeepOther); } else { - save(); + saveCallback(); + } +} + +void LastSeenPrivacyController::saveAdditional() { + const auto privacy = &_session->api().globalPrivacy(); + if (privacy->hideReadTimeCurrent() != _hideReadTime) { + privacy->updateHideReadTime(_hideReadTime); } } diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.h b/Telegram/SourceFiles/settings/settings_privacy_controllers.h index 5211d0731..7b097ec44 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.h +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.h @@ -117,6 +117,8 @@ public: bool someAreDisallowed, Fn saveCallback) override; + void saveAdditional() override; + private: const not_null<::Main::Session*> _session; bool _hideReadTime = false; diff --git a/Telegram/SourceFiles/ui/effects/premium.style b/Telegram/SourceFiles/ui/effects/premium.style index c9c9ccd84..5b97d8cb4 100644 --- a/Telegram/SourceFiles/ui/effects/premium.style +++ b/Telegram/SourceFiles/ui/effects/premium.style @@ -303,3 +303,29 @@ boostReplaceIconSkip: 3px; boostReplaceIconOutline: 2px; boostReplaceIconAdd: point(4px, 2px); boostReplaceArrow: icon{{ "mediaview/next", windowSubTextFg }}; + +showOrIconLastSeen: icon{{ "settings/premium/large_lastseen", windowFgActive }}; +showOrIconReadTime: icon{{ "settings/premium/large_readtime", windowFgActive }}; +showOrIconBg: windowBgActive; +showOrIconPadding: margins(12px, 12px, 12px, 12px); +showOrIconMargin: margins(0px, 28px, 0px, 12px); +showOrTitlePadding: margins(0px, 0px, 0px, 5px); +showOrAboutPadding: margins(0px, 0px, 0px, 16px); +showOrShowButton: RoundButton(defaultActiveButton) { + width: 308px; + height: 42px; + textTop: 12px; + font: font(13px semibold); +} +showOrLabel: FlatLabel(boostText) { + textFg: windowSubTextFg; +} +showOrLineWidth: 190px; +showOrLabelSkip: 7px; +showOrLineTop: 10px; +showOrLabelPadding: margins(0px, 17px, 0px, 13px); +showOrPremiumAboutPadding: margins(0px, 0px, 0px, 0px); +showOrBox: Box(boostBox) { + buttonPadding: margins(28px, 16px, 28px, 27px); + button: showOrShowButton; +}