From 42602351c7d975dd0585f605d8daf795ac220cce Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 22 Jan 2022 18:54:12 -0700 Subject: [PATCH 1/3] Update StatusTransformer, add emoji entities --- app/Transformer/Api/StatusTransformer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Transformer/Api/StatusTransformer.php b/app/Transformer/Api/StatusTransformer.php index 1ac8a700b..13d62b473 100644 --- a/app/Transformer/Api/StatusTransformer.php +++ b/app/Transformer/Api/StatusTransformer.php @@ -16,6 +16,7 @@ use App\Services\StatusMentionService; use App\Services\ProfileService; use Illuminate\Support\Str; use App\Services\PollService; +use App\Models\CustomEmoji; class StatusTransformer extends Fractal\TransformerAbstract { @@ -36,7 +37,7 @@ class StatusTransformer extends Fractal\TransformerAbstract 'content' => $status->rendered ?? $status->caption, 'content_text' => $status->caption, 'created_at' => $status->created_at->format('c'), - 'emojis' => [], + 'emojis' => CustomEmoji::scan($status->caption), 'reblogs_count' => 0, 'favourites_count' => $status->likes_count ?? 0, 'reblogged' => $status->shared(), From 0a4505ed3ac8c05f0e6834980ce13dd1818f2cae Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 22 Jan 2022 19:05:53 -0700 Subject: [PATCH 2/3] Update PostComponent, add custom emoji support --- resources/assets/js/components/PostComponent.vue | 10 ++++++++-- resources/assets/js/components/partials/StatusCard.vue | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 03790913e..9499cd8df 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -125,7 +125,7 @@

{{statusUsername}} - +


@@ -953,7 +953,8 @@ export default { }) } ] - } + }, + content: undefined } }, watch: { @@ -1027,6 +1028,11 @@ export default { } self.status = response.data.status; self.media = self.status.media_attachments; + self.content = response.data.status.content; + self.status.emojis.forEach(function(emoji) { + let img = `${emoji.shortcode}`; + self.content = self.content.replace(`:${emoji.shortcode}:`, img); + }); self.likesPage = 2; self.sharesPage = 2; self.showCaption = !response.data.status.sensitive; diff --git a/resources/assets/js/components/partials/StatusCard.vue b/resources/assets/js/components/partials/StatusCard.vue index 4d2422e4d..0b60723b2 100644 --- a/resources/assets/js/components/partials/StatusCard.vue +++ b/resources/assets/js/components/partials/StatusCard.vue @@ -160,7 +160,7 @@ {{status.account.username}} - +

@@ -241,11 +241,18 @@ replyText: '', replyNsfw: false, emoji: window.App.util.emoji, + content: undefined } }, mounted() { + let self = this; this.profile = window._sharedData.curUser; + this.content = this.status.content; + this.status.emojis.forEach(function(emoji) { + let img = `${emoji.shortcode}`; + self.content = self.content.replace(`:${emoji.shortcode}:`, img); + }); }, methods: { From 58f90e577b74941e3fcd07b69227072c1b1f3485 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 22 Jan 2022 19:12:43 -0700 Subject: [PATCH 3/3] Update compiled assets --- public/js/profile.js | Bin 134415 -> 134815 bytes public/js/rempos.js | Bin 158675 -> 159075 bytes public/js/rempro.js | Bin 100677 -> 101077 bytes public/js/spa.js | Bin 1738890 -> 1739290 bytes public/js/status.js | Bin 189678 -> 190474 bytes public/js/timeline.js | Bin 180724 -> 181124 bytes public/mix-manifest.json | Bin 1983 -> 1983 bytes 7 files changed, 0 insertions(+), 0 deletions(-) diff --git a/public/js/profile.js b/public/js/profile.js index 28a3de548b2f59dd6888321f2b2ab2fed23ae5a1..06f34539daec1e48e96617eba55eff4c7889e1af 100644 GIT binary patch delta 449 zcmZ{gF-pWh6o$!Su^@PcVVYzhSxG0+h>fLZkmqEQ8JT2c=4CCGC4~oY!9q~PD+m_b zdxGsfg2i6JBpVfF?cV$T|NZ=SlV6!P$;!^)el?BNx6a`#pkuFqI&@c4*3|=>a96F{OUjg98R);-s<2O(sI05>(hF`RpIvS^itCt?uqJK!}W0 zg{nYrcQl=)dz|_cv0>*!(zVJ^rZhgFL<&{Nwrn@=AN%YOe}3<4npknAfs249bX(^Z kv(T|QW4rUP6evyRlG*ZPrflFa-(4bAGwOPSO+d$O46Pj9%-DAL?x LyuHVmQTR3hO|=xc diff --git a/public/js/rempos.js b/public/js/rempos.js index 5071322748886d6761dd752c4791ae25163094a8..025996e91975f89944ff77b5ac6fc34486e822fa 100644 GIT binary patch delta 651 zcmZ`#L2DC16y|Lu5-IdxH9=Zk=8|mLO_PA!M1>yqCU_M*c@Vq^`U86NAPCMRK`7YM_ult?@0&O8%h&SHZ{_y`W5p&s zl{A%|A!ok1nZMgL)?R);^XkArEn9|6G!_PT)(DB^;2$?PEI69*h>090aCSni(GX{* zaBJ6C5}1C5g8=tq>Y_ay3yMqG|>6ZzXb=nXi&m`eK zwQIZ*~^Cov|pjymXnODo#4g*CRUv7JyEa$j^t#oMNF0EhQZ zy>ly`sAc4-AO%>3QfbM_t)-@mNjTQNCJ%?bBYbKGe-_1uiL9T7eG= zoGMJfE2dSrX(&9p0FRa+D(+kavJ756-GJMQ{IB?^<^Lu?p)e5BK-$%F(OepF2No!(~uGe_B8l=41z6oKrHlY@d@sqHodX{rwcS>V z(UA#A*UKEP?DxjW^~r}w|ZdV z?RticznIy8;y#)>(*va#W%)yEYBYc`r!P+3dvKNyRNC zXD=QUnWO)LP-#GKf_E?8y(xO};>DA*X zx3_3wq>j1DJHFv1)c0vCVh(E4C}qfSBbufT8XAb08E!9?qEqP)31rYnI>^j(xKvuq zP6LrhS9pw=$dFv-PA2|OJx$!dtGy)3`#dUXMI_wkF^!H_^m9qR9RJ5+pW7TcJ?5Sa z9CYO>G6Kf^K!?rGv)4_$BLBSJ!O2coH=-`H&@wtMv!*dg@eanjCyUkD-Sq|k^Xbq* zwA*E|w-)foLnIr#F997pku@!JyM7Dd6`^1bN~%_dCWM1mW$-{_@hsHFG~PT1i$%!P z_IdaQ*`R#^?t#WV1L_l{uxYh1vAE+2x7X1hp^>TbG*oq8eHt#olW@??lnyD=}F=-tU>!1(s*Y4`w{D!W!FyW0*y&-T1vb_qFbsRNm!<2?= zHoVibf7e+a-8*Myp~>4%V<+!h6yP K2hA#ceefIoi1R4` delta 360 zcmcaQmF?&xwhb4Ur!!_UicMls-@Js?On>q{QMT!?s~GtC5#Q6@k=Aea78D%UcZ?e=##wO>Zz^ z)Zhf_2?6WbzR`ry2;{dXri>aOO}yqn>#L@FnKSl@0#)T{>cIS=mz1AU8C|vgtvTb1 FAOPCaauNUl diff --git a/public/js/spa.js b/public/js/spa.js index 6cfcf89c039e78e1784bd2cc5477da1d79c0ac23..4d23f46bfb880daea5878351c10fe0b8ca3bc00f 100644 GIT binary patch delta 180 zcmeC0m^Euk)`o5t4xQxuypq(slIf1og0j;KLbwGcFJn=f?inPk$f&dZ@i)F0#_jKg zMI=}^Kjf6vntm%-n0vaBm7wJGfK~yKW?PeXTN6egW&&bnAZ7t#Rv=~rVs;?r0Afxc x<^p1FAm#yLULfWJVtybN0AfKP76M{nAQk~)Q6LrrVsRjr0Ak7QwkA@(AplJrH4y*+ delta 152 zcmWN=u?m7v7=TeS(=02so25QP(`{*Tb8%~L_cek9og(3fopEwRNOG;mOCa-qto*A2QvRWg8%>k diff --git a/public/js/status.js b/public/js/status.js index 04ddf45e7523d64ff6bb6c6586fdda0191b91d84..e1c8ae963627537ab56a7d3dacd9fa9a4fccc914 100644 GIT binary patch delta 2232 zcmb_dU2NM_6qZlZ{dDRE+S*9n+NR#t*u+hfZtG84x6RbizqEDRb%ce|xrv)NbL=#} z$u`=wjEOxA1giqv2VieJprIku2a7T$B#;mf119k>G$Cy-XhVfDAt50l!F7_>><5hp zp3eQw`OdlL-23_Zm#?;*`*zFuc3a~>(Ht?kf9-Jj<6!?I#1^_G*xnh(>l@;4S7sE zLKB1UrSF)f9{T14WUv;)b=EaYVWC9bE!>(Rx0dOD?;i4hTr4O&W$%BrZW zQyyZN!^l>NLIZihU@ExbJuUb=NquXy!7h(4xNO`x1C)?!U#+3yxudJQsDb4Zt5-}{^W8K7AKd-O zxg*RVjxNfO<_cXJAv?uy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4?s$_QwM#?LVB=Xu)|KIuf>Y}(NgClX@G-R_x~QzI=mRdhy-lQ7 zf>7V&=QP6NsHV+1MGq&^ik8&jcI{%rYhO2mKEmmYFtlfD#xD>L`8Z=g29Glj4SXYEws7${(_usRfKZt zV+l^xpb9}2LQyeBL*vj$o5#V4&Bw-Jx;%}8?P47PXG&4$^#!uXVO`7_mow!Zcrt9a z4|7qCVAR+ehh+vUM`Bid! zWyK7K`Mpnx_D#bC?)mmKs7#RlH4XQfpm8q(`^z)$oQ4skJukwUYQ%TrFvB$N*-yBv zFssG$Lx8%oN%#SeF>n_02w$Cr3pTVkN1srkiOMNxZU5gfpg>NI4#hZBXrg3X zP2m`*7c=mdvGzWE Wdfa>p=;8((dE}It5pKe_t^Wd1MA`HJ diff --git a/public/js/timeline.js b/public/js/timeline.js index f3515455224e402b59ef874140890b57a011ad2f..492d4c7f3483354b92e3d2107a00d7d59ec1c314 100644 GIT binary patch delta 450 zcmZ{gu};G<5QY`2AfXNju`*a*(nv`mhyem&V_-mxjL0}9F>+!QUjPYJ9a^btqz)Ni z&1C1NC1F+rw_ucQ`_cdq_N9{?0HeIGN;28uDNhcV&k4r=jTu6lOHe6^L4HSx{wg4K9r|M4V@z&>d^}UZa`u2%PV;to)j_Hl$A-Sbe zbAp+qT8G5oD&v?H8dU0;o?t2=BzFBMqtM}9ov0j`inwbN3<7E++xcg%bGDrJ&3ci` zdNHCvJ(Y`CWK=GZUqt;Av9eeMFxquv^e7@oLgF71oNy5*^RRWjdult!usYSe3e0u8 zIlq^b@eT>dU!mu+<7Q6Jae8jbAyJVIo~y}|bu@iFM_1PSMeD^I%>2>Jx27{6t(8Cg C7MpYc delta 40 wcmZo^=l;^ny`hw8dg3xBvB^uB)Hi#wnCVZRB_Y(@W!&Cn%(%VFnCVwP05;JN7XSbN diff --git a/public/mix-manifest.json b/public/mix-manifest.json index f1c7068d201ca243c48d2e726f8cb6961dcc59fb..a4a842cee04cfa380e89a2073312614312bc038b 100644 GIT binary patch delta 156 zcmWN{Ar`_g3;*;a&11Z@o@c;k- delta 156 zcmV~$AsWIk3#Cl)*LjmB6scuH3~Y@kXcvv8g?|UMp_*j6ZP?$ jx78^tRdPXb!(OZ?#&`Z)cxUM;H?v?JA!RFeJv~l;TreyJ