Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Oct 28, 2024
0 parents commit bdb8aad
Show file tree
Hide file tree
Showing 7 changed files with 19,773 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Patch & Build mattermost app
on:
workflow_dispatch:
inputs:
version:
description: 'The mattermost version/commit hash'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: "Patch 'n Build"
run: bash build.sh
env:
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
RELEASE_PASSWORD: ${{ secrets.RELEASE_PASSWORD }}
75 changes: 75 additions & 0 deletions 0001-Render-text-emojis-as-text.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
From 284a8e4588aaf20a9b6025c30ba176a1d1709362 Mon Sep 17 00:00:00 2001
From: I-Al-Istannen <[email protected]>
Date: Wed, 16 Oct 2024 21:00:44 +0200
Subject: [PATCH 1/5] Render text emojis as text

---
app/components/markdown/markdown.tsx | 20 +++++++++++++++-----
app/utils/emoji/helpers.ts | 18 ------------------
2 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/app/components/markdown/markdown.tsx b/app/components/markdown/markdown.tsx
index c507797ea..0c0060671 100644
--- a/app/components/markdown/markdown.tsx
+++ b/app/components/markdown/markdown.tsx
@@ -276,13 +276,23 @@ const Markdown = ({
};

const renderEmoji = ({context, emojiName, literal}: MarkdownEmojiRenderer) => {
+ if (literal.replace(/[^:]/g, '').length >= 2) {
+ return (
+ <Emoji
+ emojiName={emojiName}
+ literal={literal}
+ testID='markdown_emoji'
+ textStyle={computeTextStyle(textStyles, baseTextStyle, context)}
+ />
+ );
+ }
return (
- <Emoji
- emojiName={emojiName}
- literal={literal}
+ <Text
+ style={computeTextStyle(textStyles, baseTextStyle, context)}
testID='markdown_emoji'
- textStyle={computeTextStyle(textStyles, baseTextStyle, context)}
- />
+ >
+ {literal}
+ </Text>
);
};

diff --git a/app/utils/emoji/helpers.ts b/app/utils/emoji/helpers.ts
index 1d8c22eb3..e0e376b66 100644
--- a/app/utils/emoji/helpers.ts
+++ b/app/utils/emoji/helpers.ts
@@ -17,24 +17,6 @@ const RE_NAMED_EMOJI = /(:([a-zA-Z0-9_+-]+):)/g;
const RE_UNICODE_EMOJI = emojiRegex();

const RE_EMOTICON: Record<string, RegExp> = {
- slightly_smiling_face: /(^|\s)(:-?\))(?=$|\s)/g, // :)
- wink: /(^|\s)(;-?\))(?=$|\s)/g, // ;)
- open_mouth: /(^|\s)(:o)(?=$|\s)/gi, // :o
- scream: /(^|\s)(:-o)(?=$|\s)/gi, // :-o
- smirk: /(^|\s)(:-?])(?=$|\s)/g, // :]
- smile: /(^|\s)(:-?d)(?=$|\s)/gi, // :D
- stuck_out_tongue_closed_eyes: /(^|\s)(x-d)(?=$|\s)/gi, // x-d
- stuck_out_tongue: /(^|\s)(:-?p)(?=$|\s)/gi, // :p
- rage: /(^|\s)(:-?[[@])(?=$|\s)/g, // :@
- slightly_frowning_face: /(^|\s)(:-?\()(?=$|\s)/g, // :(
- cry: /(^|\s)(:[`'’]-?\(|:&#x27;\(|:&#39;\()(?=$|\s)/g, // :`(
- confused: /(^|\s)(:-?\/)(?=$|\s)/g, // :/
- confounded: /(^|\s)(:-?s)(?=$|\s)/gi, // :s
- neutral_face: /(^|\s)(:-?\|)(?=$|\s)/g, // :|
- flushed: /(^|\s)(:-?\$)(?=$|\s)/g, // :$
- mask: /(^|\s)(:-x)(?=$|\s)/gi, // :-x
- heart: /(^|\s)(<3|&lt;3)(?=$|\s)/g, // <3
- broken_heart: /(^|\s)(<\/3|&lt;&#x2F;3)(?=$|\s)/g, // </3
};

// TODO This only check for named emojis: https://mattermost.atlassian.net/browse/MM-41505
--
2.46.1

Loading

0 comments on commit bdb8aad

Please sign in to comment.