Compare commits

..

25 Commits

Author SHA1 Message Date
680669df00 new readme
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-27 17:48:57 -03:00
d13f35e045 fix linux: desabilita impeller para evitar tela preta em gpu hibrida intel/nvidia 2026-09-27 17:30:42 -03:00
9fce19dab2 feat: versao do app e aviso de alpha na pagina sobre
Mostra a versao (via getVersion/package_info_plus) ao lado de um badge
alpha e um aviso de que o app ainda esta em desenvolvimento.
2026-09-27 17:30:42 -03:00
c0a4c71766 feat: long press no grid do mural abre o viewer de imagem em tela cheia
Toque simples segue abrindo o showModalBottomSheet com o post; long press
abre o mesmo ImageViewer das imagens de sala, com pin-to-zoom e deslize
entre as midias do mural.
2026-09-27 17:30:37 -03:00
d65be8a1ef fix: back do android saia da sala em vez de fechar o viewer de imagem
O PopScope sozinho nao resolvia: GoRouterDelegate.popRoute() itera
_findCurrentNavigators(), que devolve [root, shell] e retorna
states.reversed, ou seja, o shell navigator e consultado primeiro. O
viewer e um showDialog no root navigator, entao o shell nunca ve o
PopEntry dele, popa a sala e retorna true antes de chegar no dialog.

BackButtonListener registra no BackButtonDispatcher raiz, que e
consultado antes do RouterDelegate.popRoute(), entao o viewer fecha
primeiro. Aplicado tambem no MxcImageViewer (avatar/sticker), que tinha
o mesmo defeito.
2026-09-27 17:30:37 -03:00
9f8877a741 fix: icones de notificacao e splash ainda usavam o artwork do FluffyChat
- notifications_icon.png: gera a silhueta branca a partir do logo atual
  nas 5 densidades (era o drawable do Initial commit, nunca trocado)
- splash.png: idem, mantendo os canvas originais e o logo a 64% da largura
- apaga ic_launcher_foreground.xml e ic_launcher_monochrome.xml, vectors
  antigos com o roxo do FluffyChat que competiam com os PNGs por densidade
- foreground service passa a usar notifications_icon em vez do inexistente
  ic_launcher (caia no icone do launcher)
- bumpara o id do canal para tatuchat_push_v2, senao o Android mantem o
  icone antigo congelado no canal ja criado
- titulo do foreground service: FluffyChat -> TatuChat
2026-09-27 17:30:32 -03:00
3f681feb26 Merge branch 'main' of https://gitea.weltonmoura.com.br/welton/tatuchat
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-25 14:41:51 -03:00
a31a88f87a feat: zoom widget de imagem 2026-09-25 14:41:13 -03:00
9382a1f946 feat: usar a cor escolhida tal e qual e opcao de suavizar
- TatuPalette.scheme aceita softenPrimary e passa a usar a seed como primary, onPrimary por contraste e surfaceTint, em vez da paleta tonal do Material 3
- nova opcao AppSettings.softenThemeColor (default false, ou seja cor exacta)
- interruptor 'Suavizar cor do tema' em Configuracoes > Aparencia, com l10n en/pt
- a opcao e sincronizada via account data (soften_theme_color) e mantida localmente como fallback, tal como a cor do tema
- setApplicationAccountColor e updateApplicationAccountConfig preservam o novo campo
- um unico sync de account data actualiza cor e opcao
- testes de serializacao e round-trip para o novo campo
2026-09-25 13:46:00 -03:00
6f32eb8972 fix: incluir o wallpaper padrao no bundle e mostrar na previa
O Flutter nao empacota subdirectorios de forma recursiva, e assets/logo/ nao estava listado no pubspec, portanto assets/logo/background.png nunca chegava ao bundle e o wallpaper padrao das conversas nao aparecia.

- pubspec: declara assets/logo/background.png
- chat_view: normaliza o path do asset
- settings_style_view: a previa passa a mostrar o wallpaper padrao quando nao ha imagem custom, com opacidade 0.3 e sem blur, em vez de ficar sem fundo
2026-09-25 13:15:03 -03:00
058926cf6f feat: sincronizar cor do tema via account data da conta Matrix
A cor escolhida no Appearance passa a ser guardada em im.fluffychat.account_config (primary_color), em vez de apenas nas preferencias locais do dispositivo.

- ApplicationAccountConfig ganha primaryColor, preservado em updateApplicationAccountConfig e no novo setApplicationAccountColor
- ThemeController restaura a cor da conta activa, aguarda accountDataLoading e reage a alteracoes remotas via onSync
- A cor final e derivada de _accountPrimaryColor ?? _localPrimaryColor, evitando corrida entre as preferencias locais e o sync
- Matrix notifica a troca de conta activa em initMatrix, setActiveClient e logout, corrigindo o indice do cliente activo
- Apagar o wallpaper preserva a cor; testes de serializacao do modelo
2026-09-25 12:53:21 -03:00
7534ecf7d1 fix: simplify chat context menu 2026-09-25 10:27:41 -03:00
c01372353c zoon map
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
2026-09-23 19:15:41 -03:00
288b5e70d4 feat: wallpaper padrao nas conversas, logo colorida na sidebar e ajustes na aba de espacos
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
2026-09-23 14:14:02 -03:00
c0463e51f9 fix: tema correto na lista de murais, borda nos itens de chat e ajustes no perfil 2026-09-23 12:14:18 -03:00
48a50744de feat: mural feed com criador, descricao e contador de inscritos
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-22 14:42:26 -03:00
5a72c71cfc feat: menu de contexto em bottom sheet, painel de anexos, perfil e feed do mural
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
- Salas (chat, canais, murais e salas de espacos) abrem bottom sheet com grid de acoes
- Botao + da barra de digitacao abre painel de anexos em grid de 3 colunas que empurra a caixa de texto
- Modal do perfil permite editar nome/status e ler QR code (mobile)
- Alterar status atualiza localmente via extensao do SDK matrix
- Mural pre-carrega historico para exibir todas as midias em dispositivos sem cache
2026-09-21 14:30:47 -03:00
762178d9f9 feat: adiciona menu Desenvolvedor as configuracoes, nova modal Sobre e icones da marca TatuChat
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
- Submenu Desenvolvedor em Configuracoes (Sobre o servidor, Registros, Variaveis e ambiente)
- Modal Sobre maior com logo, descricao com link e rodape (codigo-fonte, licenca, fechar)
- Descricao legivel no tema dark
- Drawer com a logo do projeto e links de support/formulario atualizados
- flutter_launcher_icons: regenera icones Android (mipmap + adaptive), Web, iOS, macOS, Windows
2026-09-20 18:16:35 -03:00
6c689d1f34 feat: tela de apps com logos/menu de exclusao, correcao de tema nas mini apps e sidebar de navegacao
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-19 00:08:35 -03:00
1f692b1e4e feat: mini apps customizados com importacao por arquivo/URL, paleta de cores, avatar autenticado e documentacao
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-18 15:11:12 -03:00
94632e0611 botao nova sala
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
2026-09-18 08:27:19 -03:00
5c28e91279 tratução e site
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-16 14:22:34 -03:00
ab8637bf6a feat: suporte a tabelas markdown nas legendas, remoção de borda de imagens e separação de comentários no mural
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-15 17:24:18 -03:00
43e0dc177c feat: marcar legenda com markdown, barra de ações nos posts do canal e limites de mensagem na modal
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
2026-09-14 19:18:09 -03:00
9d69e833bd fix: salas removidas de vez, paginação no mural, mídia em largura total e teclado nos comentários 2026-09-14 17:15:52 -03:00
143 changed files with 6129 additions and 1448 deletions

View File

@@ -1,4 +1,4 @@
- [ ] I have read and understood the [contributing guidelines](https://github.com/krille-chan/fluffychat/blob/main/CONTRIBUTING.md). - [ ] I have read and understood the [contributing guidelines](https://gitea.weltonmoura.com.br/welton/tatuchat/blob/main/CONTRIBUTING.md).
### Pull Request has been tested on: ### Pull Request has been tested on:

View File

@@ -5,4 +5,4 @@ SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
SPDX-License-Identifier: AGPL-3.0-or-later SPDX-License-Identifier: AGPL-3.0-or-later
--> -->
Has been moved to https://fluffychat.im/privacy Has been moved to https://tatuchat.weltonmoura.com.br/home/politica-de-privacidade/

296
README.md
View File

@@ -5,134 +5,280 @@ SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
SPDX-License-Identifier: AGPL-3.0-or-later SPDX-License-Identifier: AGPL-3.0-or-later
--> -->
[TatuChat](https://fluffy.chat) is an open source, nonprofit and cute [[matrix](https://matrix.org)] client written in [Flutter](https://flutter.dev). The goal of the app is to create an easy to use instant messenger which is open source and accessible for everyone. # TatuChat
### Links: <p align="center">
<img src="https://tatuchat.weltonmoura.com.br/home/assets/logo.png" height="180" alt="TatuChat">
</p>
- 🌐 [[Weblate] Translate TatuChat into your language](https://hosted.weblate.org/projects/fluffychat/) <p align="center">
- 🌍 [[m] Join the community](https://matrix.to/#/#fluffy-space:matrix.org) Cliente de mensagens instantâneas <strong>open source</strong>, <strong>sem fins lucrativos</strong> e
- 📰 [[Mastodon] Get updates on social media](https://troet.cafe/@krille) multiplataforma, construído sobre o protocolo
- 💝 [[Liberapay] Support TatuChat development](https://de.liberapay.com/KrilleChritzelius) <a href="https://matrix.org">Matrix</a> com <a href="https://flutter.dev">Flutter</a>.
TatuChat é um <em>fork</em> do acclaimed
<a href="https://fluffy.chat">FluffyChat</a>, com foco em privacidade, simplicidade e
código aberto.
</p>
<a href='https://ko-fi.com/krille' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi5.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a> > 🌐 **Site, downloads e novidades:** <https://tatuchat.weltonmoura.com.br/home/>
### Screenshots: > ⚠️ **Status do projeto: alfa.** O aplicativo está em desenvolvimento ativo e ainda pode
> apresentar erros, perder dados ou mudar de comportamento entre versões. Use com cuidado e
> reporte problemas para ajudar a tornar o TatuChat mais estável.
<img src="https://github.com/krille-chan/fluffychat-website/blob/main/public/img/screenshot_mobile.png?raw=true" height="300"> ## O que é o TatuChat
<img src="https://github.com/krille-chan/fluffychat-website/blob/main/public/img/screenshot_desktop.png?raw=true" height="300">
# Features Um mensageiro federado e descentralizado: nenhuma empresa no meio, nenhum servidor único. Você
escolhe o *homeserver* que quiser (ou usa um dos recomendados), conversa com quem está em outros
servidores e continua sendo dono dos seus dados. Tudo com criptografia ponta a ponta
(Olm/Megolm via [Vodozemac](https://github.com/matrix-org/vodozemac) em WebAssembly).
- 📩 Send all kinds of messages, images and files - 🔐 Criptografia ponta a ponta, com verificação por emoji e *cross-signing*
- 🤙 Video calls with Matrix RTC - 💾 Backup de conversas criptografado
- 🎙️ Voice messages - 📩 Texto, imagens, áudio, vídeo, arquivos, stickers, emotes e localização
- 📍 Location sharing - 🤙 Videochamadas pelo Matrix RTC (LiveKit)
- 🔔 Push notifications - 🎙️ Mensagens de voz
- 💬 Unlimited private and public group chats - 🔔 Notificações push, com ou sem Google (UnifiedPush / ntfy)
- 📣 Public channels with thousands of participants - 🌌 Espaços para navegar hierarquias inteiras de salas
- 🛠️ Feature rich group moderation including all matrix features - 🎨 Design Material You, com cores dinâmicas do Android
- 🔍 Discover and join public groups
- 🎨 Material You design
- 😄 Custom emotes and stickers
- 🌌 Spaces
- 🔐 End to end encryption
- 🔒 Encrypted chat backup
- 😀 Emoji verification & cross signing
... and much more.
## 🚀 Inovações do TatuChat
# Installation O TatuChat reescreveu a forma de navegar e de consumir conteúdo dentro do Matrix. As seções
abaixo descrevem os módulos desenvolvidos sobre o FluffyChat.
Please visit the website for installation instructions: ### Abas e barra lateral
- https://fluffy.chat O app não usa mais a *navigation rail* do FluffyChat. A navegação principal virou uma
**barra lateral** (desktop e tablet) com as entradas *Criar grupo*, *Definir status*,
*Convidar contato*, *Arquivo*, **Apps** e *Configurações*, além do seletor de contas.
# Configuration and Mobile Device Management (MDM) A tela inicial foi dividida em **quatro abas**, com barra superior em telas largas e barra
inferior em telas compactas:
TatuChat supports configuration via MDM on Android&iOS (since v2.10.0) and via a config.json file on web. You can see the populated configuration for MDM on Android in this file under `/android/app/src/main/res/xml/app_restrictions.xml`. | Aba | O que mostra |
An example configuration can be found in the `config.sample.json` file. | --- | --- |
| **Conversas** | Apenas conversas normais |
| **Canais** | Apenas canais |
| **Espaços** | Os espaços em que você entrou, como tela inicial |
| **Murais** | Apenas murais |
# How to build Canais e murais **não aparecem** na lista de conversas, e vice-versa: cada tipo tem sua própria
aba, com busca própria — e os murais mostram ainda o número de inscritos de cada um.
1. To build TatuChat you need [Flutter](https://flutter.dev) and [Rust](https://www.rust-lang.org/tools/install) ### 📣 Canais
2. Clone the repo: Um canal é uma sala pública de distribuição, no estilo de um feed, não de um chat. O tipo é
``` gravado no estado compartilhado da sala (`tatuchat.room_type = "canal"`), com uma tag pessoal
git clone https://github.com/krille-chan/fluffychat.git (`tatuchat_canal`) para identificação local.
cd fluffychat
```
3. Choose your target platform below and enable support for it.
3.1 If you want, enable Googles Firebase Cloud Messaging:
`./scripts/add-firebase-messaging.sh` A sala usa a página de chat normal, mas em **modo feed**:
4. Debug with: `flutter run` - 🗞️ Publicações viram **cartões de largura total**, em vez de balões
- ✍️ O nome do autor aparece **sempre**, inclusive nas suas próprias publicações, para que o
feed nunca pareça anônimo
- ⬅️ Tudo alinhado à esquerda, com balões totalmente arredondados
- 🖼️ Imagens ocupam a largura total, mantendo a proporção original
- 🔐 **Somente administradores publicam no nível principal**; dentro das threads, qualquer
participante comenta
- 💬 Cada publicação abre uma **thread de comentários**, com reações, respostas, edição,
exclusão e denúncia
### 🖼️ Murais
Um mural é uma página dedicada — não uma variante da timeline. O tipo é gravado em
`tatuchat.room_type = "mural"` (tag pessoal `tatuchat_mural`), e abrir o mural **nunca** mostra
a lista de mensagens: mostra um **grid visual**.
- 🟦 Grade responsiva de 3 colunas alimentada apenas por **imagens, vídeos e stickers**
- 🎨 Cabeçalho com capa, avatar, nome, descrição, autor e número de inscritos
- 👆 **Toque simples** abre o visualizador do post, com painel de comentários e campo de
resposta
- 🤏 **Toque longo** abre a imagem em tela cheia, com *pinch-to-zoom* e deslize entre as mídias
do mural
- 💬 Comentários são **threads Matrix reais**, com árvore aninhada, reações, resposta,
exclusão do próprio comentário e denúncia
- 🧹 A timeline carrega em blocos conforme você desce, para não travar em murais grandes
### 🌌 Espaços
Matrix costuma tratar espaços como um recurso de segunda classe. No TatuChat eles viraram uma
**tela inicial** completa:
- 🧭 A aba **Espaços** é a porta de entrada: explorer a hierarquia inteira de uma conta sem sair
do app
- 🔎 Busca e filtro dentro do espaço, com capa do espaço e destaque da sala ativa
- ➕ Ingresso rápido em salas filhas públicas, direto da hierarquia
- 🛠️ Edição das salas filhas a partir do próprio explorador
- ↔️ A sala ativa é carregada na coluna lateral e preservada entre navegações
### 🧩 Mini Apps
O TatuChat é **extensível pela comunidade**: qualquer pessoa pode escrever um mini app e
instalá-lo no próprio app, sem loja, sem build e sem publishing.
Um mini app é **um único arquivo `.html`**, executado em um *web view* isolado:
- 📥 Instalação **por arquivo** ou **por URL**
- 🔐 Cada app tem seu próprio armazenamento chave-valor, persistido no *account data* do Matrix
(ou seja, o app sincroniza entre os seus dispositivos)
- 🎨 A ponte expõe a paleta e o brilho do tema atual, para o app acompanhar o Material You
- 👤 A ponte expõe o perfil do usuário (id, nome, avatar e homeserver)
- 📦 Dois mini apps já vêm embutidos: **`tasks`** (lista de tarefas) e **`accountdata`**
(editor de *account data*)
As ações disponíveis na ponte são:
| Ação | O que faz |
| --- | --- |
| `io.tatuchat.storage.load` | Lê o armazenamento do app |
| `io.tatuchat.storage.save` | Sobrescreve o armazenamento do app |
| `io.tatuchat.identity.get` | Perfil do usuário + avatar como data URI |
| `io.tatuchat.theme.get` | Paleta e brilho do tema em hex CSS |
| `io.tatuchat.accountdata.list` | Lista todas as chaves de *account data* |
| `io.tatuchat.accountdata.get` | Lê uma chave de *account data* |
| `io.tatuchat.accountdata.set` | Escreve uma chave de *account data* |
**📖 Documentação completa:** [`docs/miniapps.md`](docs/miniapps.md) — manifesto em `<meta>`,
protocolo da ponte, exemplo de HTML e limitações.
> 🔐 **Segurança — leia antes de instalar apps de terceiros.** As ações de `accountdata.*` não
> são restritas por app: um mini app pode ler e escrever qualquer chave de *account data* da
> conta, incluindo as chaves de outros mini apps. Não existe modelo de permissões nem pedido de
> consentimento. Instale apenas apps cujo código você auditou. O app **não** expõe salas,
> mensagens, arquivos nem envio de mensagens pela ponte.
### Outros detalhes
- 🎨 **Identidade visual própria:** cor primária esmeralda `#00D084`, paleta de sementes
customizada, ícone, splash e ícone de notificação próprios
- ⏱️ **Status personalizado aparece na hora:** a atualização de status é aplicada no cache local
imediatamente, sem esperar o *sync* do homeserver
- 🖼️ **Papel de parede e tema sincronizados:** via *account data* da conta Matrix, o tema segue
entre dispositivos; há também a opção de suavizar a cor primária
- 🔗 Deep links próprios (`im.tatuchat://chat/`) e convites com `client=im.tatuchat`
## 📲 Instalação
Downloads para Android, iOS, Linux, Windows, macOS e Web (PWA), além de notas de versão:
- <https://tatuchat.weltonmoura.com.br/home/>
## ⚙️ Configuração e MDM
O TatuChat aceita configuração gerenciada em Android e iOS (via MDM) e por um arquivo
`config.json` na versão web.
- **Android:** as restrições declaradas ficam em
`android/app/src/main/res/xml/app_restrictions.xml`, com as chaves `defaultHomeserver`,
`presetHomeserver` e `welcomeText`. O restante das chaves é lido de `ManagedConfigurations`.
- **Web:** sirva um `config.json` no mesmo caminho do app. O exemplo completo está em
[`config.sample.json`](config.sample.json).
⚠️ Passe **somente os valores que você realmente precisa alterar**. Todas as chaves são
opcionais; por exemplo, para trocar o homeserver padrão, altere apenas `defaultHomeserver`.
## 🛠️ Como compilar
1. Para compilar o TatuChat você precisa do [Flutter](https://flutter.dev) (3.47.3, Dart
`>=3.11.1 <4.0.0`); para a versão web, também do [Rust](https://www.rust-lang.org/tools/install),
usado para compilar o Vodozemac.
2. Clone o repositório:
```bash
git clone https://gitea.weltonmoura.com.br/welton/tatuchat.git
cd tatuchat
```
3. Escolha a plataforma alvo abaixo e habilite o suporte a ela.
4. Opcionalmente, habilite o Google Firebase Cloud Messaging:
```bash
./scripts/add-firebase-messaging.sh
```
5. Debug com `flutter run`.
### Android ### Android
* Build with: `flutter build apk` ```bash
flutter build apk --release
# ou, por arquitetura (APKs bem menores):
flutter build apk --release --split-per-abi
```
Para assinar, preencha `android/key.properties` (já ignorado pelo Git) com `storeFile`,
`keyAlias`, `storePassword` e `keyPassword`; o script `prepare-android-release.sh` faz isso a
partir do segredo `$FDROID_KEY` em CI.
### iOS / iPadOS ### iOS / iPadOS
* Have a Mac with Xcode installed, and set up for Xcode-managed app signing * Um Mac com Xcode instalado, configurado para o *app signing* gerenciado pelo Xcode
* If you want automatic app installation to connected devices, make sure you have Apple Configurator installed, with the Automation Tools (`cfgutil`) enabled * Se quiser instalar automaticamente nos dispositivos conectados, tenha o Apple Configurator com
* Set a few environment variables as ferramentas de automação (`cfgutil`) habilitadas
* FLUFFYCHAT_NEW_TEAM: the Apple Developer team that your certificates should live under * Defina algumas variáveis de ambiente:
* FLUFFYCHAT_NEW_GROUP: the group you want App IDs and such to live under (ie: com.example.fluffychat) * `FLUFFYCHAT_NEW_TEAM`: o time de Apple Developer que deve emitir os certificados
* FLUFFYCHAT_INSTALL_IPA: set to `1` if you want the IPA to be deployed to connected devices after building, otherwise unset * `FLUFFYCHAT_NEW_GROUP`: o grupo onde os App IDs vivem (ex.: `com.example.tatuchat`)
* Run `./scripts/build-ios.sh` * `FLUFFYCHAT_INSTALL_IPA`: defina como `1` para fazer o *deploy* do IPA nos dispositivos
conectados após o build
* Execute `./scripts/build-ios.sh`
### Web ### Web
* Build with:
```bash ```bash
./scripts/prepare-web.sh # To install Vodozemac ./scripts/prepare-web.sh # compila o Vodozemac para WebAssembly
flutter build web --release flutter build web --release
``` ```
* Optionally configure by serving a `config.json` at the same path as fluffychat.
An example can be found at `config.sample.json`. All values there are optional.
**Please only the values, you really need**. If you e.g. only want
to change the default homeserver, then only modify the `defaultHomeserver` key.
### Desktop (Linux, Windows, macOS) ### Desktop (Linux, Windows, macOS)
* Enable Desktop support in Flutter: https://flutter.dev/desktop Habilite o suporte a desktop do Flutter: <https://flutter.dev/desktop>
#### Install custom dependencies (Linux) Dependências no Linux:
```bash ```bash
sudo apt install libjsoncpp1 libsecret-1-dev libsecret-1-0 librhash0 libwebkit2gtk-4.0-dev lld sudo apt install libjsoncpp1 libsecret-1-dev libsecret-1-0 librhash0 libwebkit2gtk-4.0-dev lld
``` ```
* Build with one of these:
```bash ```bash
flutter build linux --release flutter build linux --release
flutter build windows --release flutter build windows --release
flutter build macos --release flutter build macos --release
``` ```
## How to run integration tests ## 🧪 Testes de integração
You need to have docker installed locally! Run the preparation script before every test run: Os testes completos precisam de Docker (Synapse) rodando localmente. Antes de cada execução:
```sh ```bash
./scripts/prepare_integration_test.sh ./scripts/prepare_integration_test.sh
```
Then run all tests with:
```sh
flutter test integration_test/mobile_test.dart flutter test integration_test/mobile_test.dart
``` ```
## 📜 Licença
# Special thanks TatuChat é software livre, licença **AGPL-3.0-or-later**. Ele é derivado do FluffyChat, também
AGPL-3.0-or-later, Copyright de Christian Kußowski e colaboradores. O arquivo `LICENSES/` traz as
licenças de todas as dependências (REUSE).
* <a href="https://github.com/fabiyamada">Fabiyamada</a> is a graphics designer and has made the tatuchat logo and the banner. Big thanks for her great designs. ## 🔗 Links
* Also thanks to all translators and testers! With your help, tatuchat is now available in more than 12 languages. - 🌐 [Site do TatuChat](https://tatuchat.weltonmoura.com.br/home/)
- 💻 [Código-fonte](https://gitea.weltonmoura.com.br/welton/tatuchat)
- 🐞 [Issues e bugs](https://gitea.weltonmoura.com.br/welton/tatuchat/issues)
- 🧩 [Documentação dos Mini Apps](docs/miniapps.md)
- 🌍 [[Weblate] Traduza o TatuChat](https://hosted.weblate.org/projects/fluffychat/)
- 🦊 [Código do FluffyChat, o projeto original](https://github.com/krille-chan/fluffy-chat)
- 📄 [Política de privacidade](PRIVACY.md) · [Segurança](SECURITY.md) · [Contribuindo](CONTRIBUTING.md) · [Changelog](CHANGELOG.md)
* The Matrix Foundation for making and maintaining the [emoji translations](https://github.com/matrix-org/matrix-spec/blob/main/data-definitions/sas-emoji.json) used for emoji verification, licensed Apache 2.0 ## 🙏 Agradecimentos
* Special thanks to MTRNord, Sorunome and Advocatux. * **[Fabiyamada](https://github.com/fabiyamada)** é designer gráfico e criou o logo e o banner do
TatuChat. Muito obrigado pelos belos designs.
* A todos os tradutores e testadores! Com a ajuda de vocês o TatuChat já está disponível em mais
de 12 idiomas.
* À **Matrix Foundation**, por manter e licenciar (Apache 2.0) as
[traduções de emoji](https://github.com/matrix-org/matrix-spec/blob/main/data-definitions/sas-emoji.json)
usadas na verificação por emoji.
* A **MTRNord**, **Sorunome** e **Advocatux**.
* Ao **FluffyChat** e a toda a comunidade Matrix — o TatuChat existe graças a esse trabalho.

View File

@@ -11,7 +11,7 @@ If you believe you have discovered a security vulnerability in this project, **d
To report a security issue responsibly, please go to the Security tab or visit: To report a security issue responsibly, please go to the Security tab or visit:
https://github.com/krille-chan/fluffychat/security/advisories/new https://gitea.weltonmoura.com.br/welton/tatuchat
The following information can help us address the issue: The following information can help us address the issue:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -1,29 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.33822063"
android:scaleY="0.33822063"
android:translateX="30.24"
android:translateY="31.24">
<path
android:pathData="M130.9,74.3c1.5,-0.3 2.8,-1 3.8,-2 4,-5.3 0.8,-11.8 -4.5,-12.6 -0.8,0 -1.5,-0.8 -1.5,-1.5v-0.5c0.8,-0.8 1.5,-1.8 2.5,-3.3 8.1,-10.8 11.8,-50.6 3.8,-53.7 -9.8,-3.3 -29.7,6.3 -38.3,17.4 -0.5,-0.3 -1,-1 -1,-1.8a7,7 0,0 0,-3.5 -6.8,7.8 7.8,0 0,0 -10.6,3.3c-0.5,0.8 -1.3,1.3 -2,1 -0.8,0 -1.5,-0.8 -1.5,-1.5 -0.5,-2.5 -2,-4.5 -4.3,-5.5 -4.8,-2 -9.8,0.8 -10.6,5.3 -0.3,0.8 -0.8,1.5 -1.5,1.5 -0.8,0.3 -1.5,-0.3 -2,-1a8,8 0,0 0,-6.5 -3.8,8 8,0 0,0 -7.8,7.3v0.6c0,0.8 -0.5,1.5 -1,1.8h-0.3c-8.3,-10.8 -28.5,-20.7 -38.5,-17.4 -8.1,2.8 -4.3,42.6 4,53.4 1.5,2 2.8,3.5 3.8,4.5 -0.3,0.8 -1,1.5 -1.8,1.5 -1.3,0 -2.5,0.5 -3.5,1.3a7.7,7.7 0,0 0,3 13.4c0.8,0.3 1.5,1 1.5,1.8s-0.5,1.8 -1.3,2c-1,0.5 -2,1 -2.8,2 -4,5.8 0,12.3 5.5,12.3a2,2 0,0 1,1.8 1.3c0.3,0.8 0.3,1.5 -0.5,2a6.5,6.5 0,0 0,-2 5.5c0.3,2.8 2,5.3 4.8,6.5 1.5,0.8 3,0.8 4.5,0.5 0.8,-0.3 1.5,0 2,0.8 0.5,0.5 0.5,1.5 0.3,2 -0.8,1.5 -1,3.3 -0.5,5a7.7,7.7 0,0 0,5.5 5.5c2.5,0.5 4.3,-0.3 5.5,-0.8 0.5,-0.3 -3.3,9.1 -6,15.4 -0.8,2 1.3,4.3 3.5,3.3 8.3,-3.8 22.2,-10.3 22.2,-9.8 0.5,5.3 6.5,9.1 12.3,5.3 1.3,-0.8 2,-2.3 2.3,-3.5 0.3,-0.8 1,-1.5 2,-1.5s1.8,0.5 2,1.5c0.3,1.3 0.8,2.3 1.8,3 5.8,4.5 12.3,0.8 12.8,-4.8a2,2 0,0 1,1.3 -1.8c0.8,-0.3 1.5,0 2,0.5a7.6,7.6 0,0 0,5.3 2.5c2.5,0 5,-1.3 6.5,-3.8 1,-1.5 1.3,-3 1,-5 0,-0.8 0.3,-1.5 0.8,-2s1.5,-0.5 2,0c1.5,0.8 3.3,1.3 5,0.8 2.8,-0.5 5,-2.8 5.8,-5.3 0.5,-1.8 0.3,-3.5 -0.5,-5.3 -0.3,-0.8 -0.3,-1.5 0.3,-2s1.3,-0.8 2,-0.8c1.8,0.3 3.3,0.3 4.8,-0.5 2.3,-1 3.8,-3 4.3,-5.5a7,7 0,0 0,-2 -6.5c-0.5,-0.5 -0.8,-1.3 -0.5,-2 0.3,-0.7 1,-1.3 1.8,-1.3 1.8,0 3.8,-0.5 5,-2a7.6,7.6 0,0 0,-2.5 -12.6c-0.8,-0.3 -1.3,-1 -1.3,-2 0,-0.9 0.7,-1.6 1.5,-1.6z"
android:fillColor="#4d3f92"/>
<path
android:pathData="M110.7,21.4a7,7 0,0 1,0 4.5c-0.3,0.8 0,1.5 0.5,2s1.3,0.8 2,0.5c1,-0.5 2,-0.5 3,-0.5a7,7 0,0 1,5.8 3c1,1.3 1.8,3 1.5,4.8a7,7 0,0 1,-1.3 4c-0.5,0.5 -0.5,1.5 0,2 0.3,0.3 0.5,0.8 1,0.8 1,-0.3 2,-1 2.8,-2 4.5,-6.3 5.3,-26.2 0.8,-27.7s-12.3,1.5 -17.9,6c1.1,0.5 1.6,1.3 1.8,2.6z"
android:fillColor="#fff"/>
<path
android:pathData="M18.3,42.8l0.8,-0.8c0.5,-0.8 0.3,-1.5 0,-2a7.6,7.6 0,0 1,-1.3 -5.8c0.5,-2.8 2.8,-5 5.5,-5.8 1.5,-0.5 3,-0.3 4.5,0.3 0.8,0.3 1.5,0 2,-0.5s0.8,-1.3 0.5,-2a7,7 0,0 1,0 -4.5c0.3,-1 0.8,-2 1.5,-2.8 -5.5,-4.5 -13.9,-7.8 -18.4,-6.3 -4.5,1.5 -3.7,21.4 0.9,27.7 1,1.5 2.2,2.2 4,2.5z"
android:fillColor="#fff"/>
<path
android:pathData="M40.2,73.8m-9.3,0a9.3,9.3 0,1 1,18.6 0a9.3,9.3 0,1 1,-18.6 0"
android:fillColor="#fff"/>
<path
android:pathData="M80,73.8a9.3,9.3 0,1 1,-18.6 0c0,-5 18.6,-5.3 18.6,0z"
android:fillColor="#fff"/>
<path
android:pathData="M100.9,73.8m-9.3,0a9.3,9.3 0,1 1,18.6 0a9.3,9.3 0,1 1,-18.6 0"
android:fillColor="#fff"/>
</group>
</vector>

File diff suppressed because one or more lines are too long

BIN
assets/logo/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 56 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -2,8 +2,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
<defs> <defs>
<linearGradient id="background" x1="0%" y1="0%" x2="0%" y2="100%"> <linearGradient id="background" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0" style="stop-color:#7c67e4; stop-opacity:1" /> <stop offset="0" style="stop-color:#7c67e4; stop-opacity:0" />
<stop offset="1" style="stop-color:#261386; stop-opacity:1" /> <stop offset="1" style="stop-color:#261386; stop-opacity:0" />
</linearGradient> </linearGradient>
</defs> </defs>
<rect width="200" height="200" fill="url(#background)" /> <rect width="200" height="200" fill="url(#background)" />

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 419 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,513 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="mini-app-id" content="accountdata">
<meta name="mini-app-name" content="Account Data">
<meta name="mini-app-category" content="developer">
<meta name="mini-app-description" content="Read and edit the account data of your Matrix account.">
<meta name="mini-app-logo" content="">
<meta name="mini-app-in-chat" content="false">
<title>Account Data</title>
<style>
:root {
--accent: #1F8EF1;
--bg: #ffffff;
--fg: #1a1a1a;
--card: #f6f6f6;
--border: #e3e3e3;
--muted: #757575;
--danger: #d93025;
--ok: #00D084;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #121212;
--fg: #e3e3e3;
--card: #1e1e1e;
--border: #333333;
--muted: #9e9e9e;
}
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: var(--bg);
color: var(--fg);
min-height: 100vh;
}
main { max-width: 800px; margin: 0 auto; padding: 20px 16px 32px; }
header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
header .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
header h1 { font-size: 1.3rem; font-weight: 700; }
/* Profile card */
#profile {
display: flex;
align-items: center;
gap: 16px;
padding: 16px;
border: 1px solid var(--border);
border-radius: 12px;
background: var(--card);
margin-bottom: 20px;
}
#profile img {
width: 56px;
height: 56px;
border-radius: 50%;
object-fit: cover;
background: var(--border);
}
#profile .placeholder {
width: 56px;
height: 56px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background: var(--accent);
color: #fff;
font-weight: 700;
font-size: 1.3rem;
}
#profile .info { min-width: 0; }
#profile .name { font-weight: 700; font-size: 1.05rem; word-break: break-word; }
#profile .meta { color: var(--muted); font-size: .85rem; word-break: break-word; }
/* Toolbar */
#toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; flex-wrap: wrap; }
#toolbar h2 { font-size: 1rem; font-weight: 600; }
#toolbar .actions { display: flex; gap: 8px; }
button {
border: 1px solid var(--border);
border-radius: 8px;
background: var(--card);
color: var(--fg);
padding: 8px 14px;
font-size: .88rem;
cursor: pointer;
font-family: inherit;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { opacity: .9; }
button.danger { color: var(--danger); }
#addKeyBtn { flex-shrink: 0; }
/* Key cards */
#list { list-style: none; }
.key-card {
border: 1px solid var(--border);
border-radius: 12px;
background: var(--card);
margin-bottom: 10px;
overflow: hidden;
}
.key-head {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 14px;
cursor: pointer;
user-select: none;
}
.key-head .key {
flex: 1;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: .85rem;
word-break: break-all;
}
.key-head .chevron {
color: var(--muted);
font-size: .8rem;
transition: transform .15s;
}
.key-card.open .chevron { transform: rotate(90deg); }
.key-head .size {
color: var(--muted);
font-size: .75rem;
white-space: nowrap;
}
.key-body {
display: none;
border-top: 1px solid var(--border);
padding: 12px 14px;
}
.key-card.open .key-body { display: block; }
textarea {
width: 100%;
min-height: 160px;
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg);
color: var(--fg);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: .8rem;
resize: vertical;
outline: none;
}
textarea:focus { border-color: var(--accent); }
.key-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.status {
display: none;
margin-top: 10px;
padding: 8px 12px;
border-radius: 8px;
font-size: .85rem;
}
.status.ok { display: block; background: rgba(0, 208, 132, .15); color: var(--ok); }
.status.err { display: block; background: rgba(217, 48, 37, .12); color: var(--danger); }
.empty { text-align: center; padding: 48px 0 24px; color: var(--muted); }
.spinner {
margin: 60px auto;
width: 32px; height: 32px;
border: 3px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Add key modal */
#modalBg {
display: none;
position: fixed; inset: 0;
background: rgba(0,0,0,.5);
align-items: center; justify-content: center;
padding: 16px; z-index: 10;
}
#modalBg.open { display: flex; }
#modal {
width: 100%; max-width: 560px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 14px;
padding: 20px;
max-height: 90vh;
overflow-y: auto;
}
#modal h3 { margin-bottom: 6px; font-size: 1rem; }
#modal p.hint { color: var(--muted); font-size: .82rem; margin-bottom: 14px; }
#modal label { display: block; font-size: .85rem; margin-bottom: 4px; }
#newKeyType {
width: 100%;
padding: 9px 12px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--card);
color: var(--fg);
font-family: ui-monospace, Menlo, Consolas, monospace;
font-size: .82rem;
margin-bottom: 12px;
outline: none;
}
#modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
</style>
</head>
<body>
<main>
<header>
<div class="dot"></div>
<h1>Account Data</h1>
</header>
<div id="profile"></div>
<div id="toolbar">
<h2>Keys</h2>
<div class="actions">
<button id="reloadBtn" title="Reload">&#x21bb; Reload</button>
<button id="addKeyBtn" class="primary">+ Add key</button>
</div>
</div>
<ul id="list"></ul>
<div id="modalBg">
<div id="modal">
<h3>Add new key</h3>
<p class="hint">The content must be a valid JSON object.</p>
<label for="newKeyType">Key type</label>
<input id="newKeyType" placeholder="e.g. com.example.data" />
<label for="newKeyContent">Content (JSON)</label>
<textarea id="newKeyContent" style="min-height:120px">{}</textarea>
<div class="modal-actions">
<button id="modalCancel">Cancel</button>
<button id="modalSave" class="primary">Save</button>
</div>
</div>
</div>
</main>
<script>
const APP_ID = 'accountdata';
// ----- Bridge (same protocol as tasks.html).
const _pending = new Map();
let _requestCounter = 0;
function bridgeRequest(action, data) {
return new Promise(function (resolve, reject) {
const requestId = 'r' + (++_requestCounter);
_pending.set(requestId, { resolve: resolve, reject: reject });
window.parent.postMessage({
api: 'fromMiniApp',
widgetId: APP_ID,
requestId: requestId,
action: action,
data: data
}, '*');
});
}
window.addEventListener('message', function (event) {
const msg = event.data;
if (!msg || msg.api !== 'fromMiniApp' || !msg.requestId) return;
if (msg.response === undefined) return;
if (!_pending.has(msg.requestId)) return;
const pending = _pending.get(msg.requestId);
_pending.delete(msg.requestId);
const response = msg.response || {};
if (response.error) {
pending.reject(new Error(response.error));
} else {
pending.resolve(response.data);
}
});
// ----- App state and DOM.
const profileEl = document.getElementById('profile');
const listEl = document.getElementById('list');
const modalBg = document.getElementById('modalBg');
const newKeyType = document.getElementById('newKeyType');
const newKeyContent = document.getElementById('newKeyContent');
const KEY_DENYLIST = ['m.cross_signing.user_signing', 'm.cross_signing.master'];
document.getElementById('reloadBtn').addEventListener('click', init);
document.getElementById('addKeyBtn').addEventListener('click', openModal);
document.getElementById('modalCancel').addEventListener('click', closeModal);
modalBg.addEventListener('click', function (e) {
if (e.target === modalBg) closeModal();
});
document.getElementById('modalSave').addEventListener('click', saveNewKey);
function openModal() {
newKeyType.value = '';
newKeyContent.value = '{}';
modalBg.classList.add('open');
newKeyType.focus();
}
function closeModal() {
modalBg.classList.remove('open');
}
async function saveNewKey() {
const type = newKeyType.value.trim();
if (!type) { alert('Enter a key type.'); return; }
let content;
try {
content = JSON.parse(newKeyContent.value);
} catch (e) {
alert('Invalid JSON: ' + e.message);
return;
}
if (!content || typeof content !== 'object' || Array.isArray(content)) {
alert('Content must be a JSON object.');
return;
}
try {
await bridgeRequest('io.tatuchat.accountdata.set', {
key: type,
content: content
});
closeModal();
init();
} catch (e) {
alert('Failed to save: ' + e.message);
}
}
async function init() {
listEl.innerHTML = '<div class="spinner"></div>';
try {
const [identity, data] = await Promise.all([
bridgeRequest('io.tatuchat.identity.get'),
bridgeRequest('io.tatuchat.accountdata.list')
]);
renderProfile(identity || {});
renderList(data || {});
} catch (e) {
listEl.innerHTML = '<div class="empty">Failed to load: ' + escapeHtml(String(e.message || e)) + '</div>';
}
}
function renderProfile(info) {
const displayName = info.displayName || info.userId || 'Anonymous';
const initials = displayName.trim().charAt(0).toUpperCase() || '?';
const avatar = (info.avatarDataUri || info.avatarHttpUrl)
? '<img src="' + escapeHtml(info.avatarDataUri || info.avatarHttpUrl) + '" alt="avatar">'
: '<div class="placeholder">' + escapeHtml(initials) + '</div>';
const meta = [];
if (info.userId) meta.push(escapeHtml(info.userId));
if (info.homeserver) meta.push(escapeHtml(info.homeserver));
profileEl.innerHTML =
avatar +
'<div class="info">' +
'<div class="name">' + escapeHtml(displayName) + '</div>' +
'<div class="meta">' + meta.join(' &middot; ') + '</div>' +
'</div>';
}
function renderList(data) {
const keys = Object.keys(data || {}).sort();
listEl.textContent = '';
if (keys.length === 0) {
const empty = document.createElement('div');
empty.className = 'empty';
empty.textContent = 'No account data yet';
listEl.appendChild(empty);
return;
}
keys.forEach(function (key) {
listEl.appendChild(buildCard(key, data[key]));
});
}
function buildCard(key, content) {
const card = document.createElement('li');
card.className = 'key-card';
const head = document.createElement('div');
head.className = 'key-head';
const keySpan = document.createElement('span');
keySpan.className = 'key';
keySpan.textContent = key;
const chevron = document.createElement('span');
chevron.className = 'chevron';
chevron.textContent = '\u25B8';
const size = document.createElement('span');
size.className = 'size';
let sizeText;
try {
sizeText = (JSON.stringify(content) || '').length + ' B';
} catch (e) {
sizeText = '?';
}
size.textContent = sizeText;
head.append(keySpan, size, chevron);
const body = document.createElement('div');
body.className = 'key-body';
const textarea = document.createElement('textarea');
textarea.spellcheck = false;
try {
textarea.value = JSON.stringify(content, null, 2);
} catch (e) {
textarea.value = '// not serializable';
}
const actions = document.createElement('div');
actions.className = 'key-actions';
const status = document.createElement('div');
status.className = 'status';
const saveBtn = document.createElement('button');
saveBtn.className = 'primary';
saveBtn.textContent = 'Save';
saveBtn.addEventListener('click', async function () {
status.className = 'status';
if (KEY_DENYLIST.includes(key)) {
status.className = 'status err';
status.textContent = 'This key is protected and cannot be edited.';
return;
}
let value;
try {
value = JSON.parse(textarea.value);
} catch (e) {
status.className = 'status err';
status.textContent = 'Invalid JSON: ' + e.message;
return;
}
if (!value || typeof value !== 'object' || Array.isArray(value)) {
status.className = 'status err';
status.textContent = 'Content must be a JSON object.';
return;
}
try {
await bridgeRequest('io.tatuchat.accountdata.set', { key: key, content: value });
status.className = 'status ok';
status.textContent = 'Saved. Reloading...';
await init();
} catch (e) {
status.className = 'status err';
status.textContent = 'Save failed: ' + (e.message || e);
}
});
const resetBtn = document.createElement('button');
resetBtn.textContent = 'Reset';
resetBtn.addEventListener('click', function () {
try {
textarea.value = JSON.stringify(content, null, 2);
} catch (e) {}
});
actions.append(saveBtn, resetBtn);
body.append(textarea, actions, status);
head.addEventListener('click', function () {
card.classList.toggle('open');
});
// Don't toggle when clicking buttons inside the body.
body.addEventListener('click', function (e) { e.stopPropagation(); });
card.append(head, body);
return card;
}
function escapeHtml(value) {
return String(value)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;');
}
// Follow the theme TatuChat is *actually* using instead of the environment's
// `prefers-color-scheme` (which on native webviews follows the device, not
// the app). Applies the palette reported by `io.tatuchat.theme.get`.
function applyTatuTheme(palette) {
if (!palette) return;
var root = document.documentElement.style;
var vars = {
'--accent': palette.primary,
'--bg': palette.surface,
'--fg': palette.onSurface,
'--card': palette.surfaceContainer,
'--border': palette.outlineVariant,
'--muted': palette.onSurfaceVariant,
'--danger': palette.error,
'--ok': palette.primary
};
Object.keys(vars).forEach(function (key) {
if (vars[key]) root.setProperty(key, vars[key]);
});
if (palette.brightness) {
document.documentElement.style.colorScheme = palette.brightness;
}
}
bridgeRequest('io.tatuchat.theme.get').then(function (res) {
applyTatuTheme(res && res.palette);
}).catch(function () {});
init();
</script>
</body>
</html>

242
assets/miniapps/tasks.html Normal file
View File

@@ -0,0 +1,242 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="mini-app-id" content="tasks">
<meta name="mini-app-name" content="Tasks">
<meta name="mini-app-category" content="productivity">
<meta name="mini-app-description" content="A simple task checklist that lives in your Matrix account data.">
<meta name="mini-app-logo" content="">
<meta name="mini-app-in-chat" content="false">
<title>Tasks</title>
<style>
:root {
--accent: #00D084;
--bg: #ffffff;
--fg: #1a1a1a;
--card: #f6f6f6;
--border: #e3e3e3;
--muted: #757575;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #121212;
--fg: #e3e3e3;
--card: #1e1e1e;
--border: #333333;
--muted: #9e9e9e;
}
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: var(--bg);
color: var(--fg);
min-height: 100vh;
}
main { max-width: 640px; margin: 0 auto; padding: 20px 16px 32px; }
header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
header .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
header h1 { font-size: 1.3rem; font-weight: 700; }
#addForm { display: flex; gap: 8px; margin-bottom: 20px; }
#taskInput {
flex: 1;
padding: 11px 14px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--card);
color: var(--fg);
font-size: 0.95rem;
outline: none;
}
#taskInput:focus { border-color: var(--accent); }
#addBtn {
width: 44px;
border: none;
border-radius: 10px;
background: var(--accent);
color: #fff;
font-size: 1.4rem;
line-height: 1;
cursor: pointer;
}
ul { list-style: none; }
li {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 14px;
border: 1px solid var(--border);
border-radius: 10px;
margin-bottom: 10px;
background: var(--card);
}
li.done span { text-decoration: line-through; opacity: .55; }
li input[type="checkbox"] {
flex-shrink: 0;
width: 18px;
height: 18px;
accent-color: var(--accent);
cursor: pointer;
}
li span { flex: 1; word-break: break-word; }
li button {
flex-shrink: 0;
background: none;
border: none;
color: var(--muted);
font-size: 0.9rem;
cursor: pointer;
padding: 4px;
}
li button:hover { color: var(--fg); }
.empty { text-align: center; padding: 48px 0 24px; color: var(--muted); }
</style>
</head>
<body>
<main>
<header>
<div class="dot"></div>
<h1>Tasks</h1>
</header>
<form id="addForm" autocomplete="off">
<input id="taskInput" placeholder="What do you need to do?" />
<button id="addBtn" type="submit">+</button>
</form>
<ul id="list"></ul>
</main>
<script>
const APP_ID = 'tasks';
// ----- Bridge: the app talks to the TatuChat client through postMessage.
// The host replies with {api, widgetId, requestId, response:{data,error}}.
const _pending = new Map();
let _requestCounter = 0;
function bridgeRequest(action, data) {
return new Promise(function (resolve, reject) {
const requestId = 'r' + (++_requestCounter);
_pending.set(requestId, { resolve: resolve, reject: reject });
window.parent.postMessage({
api: 'fromMiniApp',
widgetId: APP_ID,
requestId: requestId,
action: action,
data: data
}, '*');
});
}
window.addEventListener('message', function (event) {
const msg = event.data;
if (!msg || msg.api !== 'fromMiniApp' || !msg.requestId) return;
if (msg.response === undefined) return;
if (!_pending.has(msg.requestId)) return;
const pending = _pending.get(msg.requestId);
_pending.delete(msg.requestId);
const response = msg.response || {};
if (response.error) {
pending.reject(new Error(response.error));
} else {
pending.resolve(response.data);
}
});
// ----- Tasks application logic.
let tasks = [];
const listEl = document.getElementById('list');
const addForm = document.getElementById('addForm');
const taskInput = document.getElementById('taskInput');
addForm.addEventListener('submit', function (event) {
event.preventDefault();
const text = taskInput.value.trim();
if (!text) return;
tasks.push({ id: String(Date.now()), text: text, done: false });
taskInput.value = '';
render();
save();
});
function toggleTask(id) {
const task = tasks.find(function (t) { return t.id === id; });
if (!task) return;
task.done = !task.done;
render();
save();
}
function deleteTask(id) {
tasks = tasks.filter(function (t) { return t.id !== id; });
render();
save();
}
function render() {
listEl.textContent = '';
if (tasks.length === 0) {
const empty = document.createElement('div');
empty.className = 'empty';
empty.textContent = 'No tasks yet';
listEl.appendChild(empty);
return;
}
tasks.forEach(function (task) {
const li = document.createElement('li');
if (task.done) li.className = 'done';
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.checked = task.done;
checkbox.addEventListener('change', function () { toggleTask(task.id); });
const span = document.createElement('span');
span.textContent = task.text;
const del = document.createElement('button');
del.textContent = '\u2715';
del.setAttribute('aria-label', 'Delete task');
del.addEventListener('click', function () { deleteTask(task.id); });
li.append(checkbox, span, del);
listEl.appendChild(li);
});
}
function load() {
return bridgeRequest('io.tatuchat.storage.load').then(function (data) {
if (data && Array.isArray(data.tasks)) tasks = data.tasks;
}).catch(function () {});
}
function save() {
return bridgeRequest('io.tatuchat.storage.save', { tasks: tasks }).catch(function () {});
}
// Follow the theme TatuChat is *actually* using instead of the environment's
// `prefers-color-scheme` (which on native webviews follows the device, not
// the app). Applies the palette reported by `io.tatuchat.theme.get`.
function applyTatuTheme(palette) {
if (!palette) return;
var root = document.documentElement.style;
var vars = {
'--accent': palette.primary,
'--bg': palette.surface,
'--fg': palette.onSurface,
'--card': palette.surfaceContainer,
'--border': palette.outlineVariant,
'--muted': palette.onSurfaceVariant
};
Object.keys(vars).forEach(function (key) {
if (vars[key]) root.setProperty(key, vars[key]);
});
if (palette.brightness) {
document.documentElement.style.colorScheme = palette.brightness;
}
}
bridgeRequest('io.tatuchat.theme.get').then(function (res) {
applyTatuTheme(res && res.palette);
}).catch(function () {});
load().finally(render);
</script>
</body>
</html>

View File

@@ -3,7 +3,7 @@
"defaultHomeserver": "https://matrix.weltonmoura.com.br", "defaultHomeserver": "https://matrix.weltonmoura.com.br",
"presetHomeserver": "https://matrix.weltonmoura.com.br", "presetHomeserver": "https://matrix.weltonmoura.com.br",
"welcomeText": "", "welcomeText": "",
"privacyUrl": "https://github.com/krille-chan/fluffychat/blob/main/PRIVACY.md", "privacyUrl": "https://tatuchat.weltonmoura.com.br/home/politica-de-privacidade/",
"audioRecordingNumChannels": 1, "audioRecordingNumChannels": 1,
"audioRecordingAutoGain": true, "audioRecordingAutoGain": true,
"audioRecordingEchoCancel": false, "audioRecordingEchoCancel": false,

209
docs/miniapps.md Normal file
View File

@@ -0,0 +1,209 @@
# TatuChat Mini Apps
Mini apps are small, self-contained HTML documents that run inside TatuChat in a
sandboxed web view. They can read/write their own key-value store, inspect the
user's profile and read/write arbitrary account data through a tiny messaging
bridge. There are no dependencies and no build step: an app is just one `.html`
file.
## Creating a mini app
1. Write a single `.html` file (assets may be inlined; see limitations below).
2. Import it in TatuChat:
- **From file:** open *Apps* → the **import** menu → *Import from file* and
pick your `.html` file.
- **From URL:** *Apps* → import menu → *Import from URL* and paste a link to
the HTML document.
3. Open the app from the *Installed* list. Use the reload button in the top bar
while developing.
The available apps page (`/rooms/apps`) lists the built-in apps (`tasks`,
`accountdata`) under *Installed* once you install them, plus every app you
import.
## Manifest (meta tags)
Before installing an app, TatuChat reads the `<meta>` tags of the document and
uses them as the app's manifest. **Every tag listed below must be present** in
the `<head>` of your document, even if the value is empty — except `id` and
`name`, which must also be non-empty. An app that is missing any of these tags
**cannot be installed**.
```html
<meta name="mini-app-id" content="myapp">
<meta name="mini-app-name" content="My App">
<meta name="mini-app-category" content="productivity">
<meta name="mini-app-description" content="What my app does">
<meta name="mini-app-logo" content=""> <!-- empty is allowed -->
<meta name="mini-app-in-chat" content="false"> <!-- true|false -->
```
`mini-app-in-chat` must be `true` or `false` (empty defaults to `false`).
Values are trimmed and read case-insensitively.
The `mini-app-id` is used **as the key in the account data store**: the app's
store is persisted under `im.tatuchat.miniapps.data.<id>` and its HTML source
under `im.tatuchat.miniapps.source.<id>`. It must be unique: ids of built-in
apps (`tasks`, `accountdata`) are reserved and an already installed id cannot
be reused. This id is also the `widgetId` your app must send in the bridge
protocol.
The remaining fields are stored as metadata (`category`, `description`, `logo`,
`inChat`) and shown in the *Apps* page.
## Talking to TatuChat
The host listens for `message` events. A channel app sends a request with
`window.parent.postMessage`, and the host answers with the same `requestId`.
Replies are delivered in an event with a `response` object of the form
`{data, error}`.
Request payload:
```js
{
api: 'fromMiniApp',
widgetId: '<appId>',
requestId: 'any-unique-string',
action: 'io.tatuchat.storage.load', // one of the actions below
data: { /* action-specific payload */ }
}
```
Helper for your app (copy this into your HTML):
```js
const APP_ID = 'myapp'; // must match the app id
const _pending = new Map();
let _requestCounter = 0;
function bridgeRequest(action, data) {
return new Promise(function (resolve, reject) {
const requestId = 'r' + (++_requestCounter);
_pending.set(requestId, { resolve: resolve, reject: reject });
window.parent.postMessage({
api: 'fromMiniApp',
widgetId: APP_ID,
requestId: requestId,
action: action,
data: data
}, '*');
});
}
window.addEventListener('message', function (event) {
const msg = event.data;
if (!msg || msg.api !== 'fromMiniApp' || !msg.requestId) return;
if (msg.response === undefined) return;
if (!_pending.has(msg.requestId)) return;
const pending = _pending.get(msg.requestId);
_pending.delete(msg.requestId);
const response = msg.response;
if (response.error) pending.reject(new Error(response.error));
else pending.resolve(response.data);
});
```
## Available actions
### `io.tatuchat.storage.load`
Loads the app's own key-value store (persisted in the user's account data under
`im.tatuchat.miniapps.data.<appId>`). Resolves with a plain object.
```js
const data = await bridgeRequest('io.tatuchat.storage.load');
// data => { ... } (any JSON values previously saved)
```
### `io.tatuchat.storage.save`
Replaces the whole store. `data` must be an object. Resolves with `null`.
```js
await bridgeRequest('io.tatuchat.storage.save', { tasks: [...], version: 1 });
```
> Note: this **replaces** the entire store; there is no per-key merge. Load,
> mutate, then save.
### `io.tatuchat.identity.get`
Resolves with the signed-in user's profile:
```js
const info = await bridgeRequest('io.tatuchat.identity.get');
// => {
// userId: '@user:server',
// displayName: 'Tatu',
// avatarUrl: 'mxc://server/...',
// avatarHttpUrl: 'https://.../download/...', // may require auth
// avatarDataUri: 'data:image/png;base64,...', // always renderable
// homeserver: 'https://server.example'
// }
```
The `avatarDataUri` is a base64 data URI fetched by TatuChat with the user's
credentials. **Use `avatarDataUri` for `<img src>`** – the homeserver usually
requires an authenticated media request that a plain `<img>` tag cannot send
(this is what caused the `M_MISSING_TOKEN` error). Fall back to `avatarHttpUrl`
only if `avatarDataUri` is absent.
### `io.tatuchat.theme.get`
Resolves with the color palette currently used by TatuChat, so your app can
match the ecosystem (light/dark aware). Colors are `#RRGGBBAA` hex strings
(CSS 8-digit order: red, green, blue, alpha) suitable for CSS.
```js
const { palette } = await bridgeRequest('io.tatuchat.theme.get');
// => {
// brightness: 'light' | 'dark',
// primary: '#00D084FF',
// onPrimary: '#000000FF',
// primaryContainer: '#00D08433',
// surface: '#FEF7FF00',
// surfaceContainerLowest/Low/Container/High/Highest: '#…',
// secondary..., tertiary..., error...,
// outline, outlineVariant, background, onBackground, onSurface, ...
// }
document.documentElement.style.setProperty('--primary', palette.primary);
```
### `io.tatuchat.accountdata.list`
Resolves with a map of **all** account data of the signed-in user as an object
of `{ key: { ...content } }`.
### `io.tatuchat.accountdata.get`
`data: { key: 'org.example.something' }` resolves with `{ key, content }` where
`content` is the stored JSON content (or `{}` if absent).
### `io.tatuchat.accountdata.set`
`data: { key: 'org.example.something', content: { ... } }` stores or replaces
the content of that account data key. Resolves with `null`.
## Caveats & limitations
- **Distribution / installation:** apps imported from URL must be served with
permissive CORS headers (`Access-Control-Allow-Origin`) so the browser can
read them. On the web, TatuChat retries through a CORS proxy if you configure
one (setting `miniAppCorsProxy` in the app settings/config). If the server
blocks cross-origin reads, import the `.html` file manually instead.
- **Size:** the HTML source is stored in the user's account data, where
individual events are limited to about **64 KB** (homeservers like matrix.org
enforce this). Keep mini apps small and inline the assets; or load heavy
content from a URL at runtime.
- **Security:** the app runs in a sandboxed web view with `allow-scripts` /
`allow-forms` / `allow-same-origin`. It can only reach TatuChat through the
bridge actions above – it cannot access the user's rooms, messages or files.
- **No unsolicited access:** data is only exchanged when the app explicitly
calls the bridge. The host never pushes data into the app on its own.
- **Store is per app:** every app has its own `storage.load`/`save` namespace.
`accountdata.*` is the only way to share data between apps.
- **`storage.save` overwrites:** there is no merge/patch semantics.
- **Native platforms:** the HTML is rendered by the platform web view; take
care with features that differ between browsers (e.g. storage APIs inside the
sandbox, `window.parent` assumptions). Prefer the bridge over `localStorage`.

View File

@@ -19,7 +19,7 @@ extension on TatuChatTester {
await ensureLoggedIn(); await ensureLoggedIn();
// Login user 2 // Login user 2
await tapOn(Key('accounts_and_settings_buttons')); await tapOn(Icons.menu);
await tapOn('Add account'); await tapOn('Add account');
await login(username: user2Name, password: user2Pw); await login(username: user2Name, password: user2Pw);
await initCryptoIdentity(username: user2Name); await initCryptoIdentity(username: user2Name);

View File

@@ -17,10 +17,11 @@ abstract class AppConfig {
static const String inviteLinkPrefix = 'https://matrix.to/#/'; static const String inviteLinkPrefix = 'https://matrix.to/#/';
static const String deepLinkPrefix = 'im.tatuchat://chat/'; static const String deepLinkPrefix = 'im.tatuchat://chat/';
static const String schemePrefix = 'matrix:'; static const String schemePrefix = 'matrix:';
static const String pushNotificationsChannelId = 'tatuchat_push'; static const String pushNotificationsChannelId = 'tatuchat_push_v2';
static const String pushNotificationsAppId = 'chat.fluffy.tatuchat'; static const String pushNotificationsAppId = 'chat.fluffy.tatuchat';
static const double borderRadius = 18.0; static const double borderRadius = 18.0;
static const double spaceBorderRadius = 11.0; static const double spaceBorderRadius = 11.0;
static const double muralBorderRadius = 11.0;
static const double columnWidth = 360.0; static const double columnWidth = 360.0;
static const String enablePushTutorial = static const String enablePushTutorial =
@@ -36,10 +37,13 @@ abstract class AppConfig {
static const String muralTag = 'tatuchat_mural'; static const String muralTag = 'tatuchat_mural';
static const String sourceCodeUrl = static const String sourceCodeUrl =
'https://github.com/krille-chan/fluffychat'; 'https://gitea.weltonmoura.com.br/welton/tatuchat';
static const String licenseUrl =
'https://gitea.weltonmoura.com.br/welton/tatuchat/src/branch/main/LICENSE';
static const String supportUrl = static const String supportUrl =
'https://github.com/krille-chan/fluffychat/issues'; 'https://gitea.weltonmoura.com.br/welton/tatuchat/issues';
static const String changelogUrl = 'https://fluffychat.im/changelog/'; static const String changelogUrl =
'https://tatuchat.weltonmoura.com.br/home/';
static const String helpUrl = static const String helpUrl =
'https://ko-fi.com/post/How-can-I-support-FluffyChat-J2G325WE6I'; 'https://ko-fi.com/post/How-can-I-support-FluffyChat-J2G325WE6I';
@@ -47,8 +51,8 @@ abstract class AppConfig {
static final Uri newIssueUrl = Uri( static final Uri newIssueUrl = Uri(
scheme: 'https', scheme: 'https',
host: 'github.com', host: 'gitea.weltonmoura.com.br',
path: '/krille-chan/fluffychat/issues/new', path: '/welton/tatuchat/issues/new',
); );
static final Uri homeserverList = Uri( static final Uri homeserverList = Uri(

View File

@@ -0,0 +1,162 @@
// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/utils/miniapp_store.dart';
/// ID of the built-in tasks example app.
const String miniAppTasksId = 'tasks';
/// ID of the built-in account data explorer app.
const String miniAppAccountDataId = 'accountdata';
/// Static registry of all built-in mini apps that ship with this build. A mini
/// app only shows up in the "Apps" page once the user installs it (see
/// [installedMiniApps]). Additionally to this list, users can import their own
/// single-file HTML apps which are resolved through [resolveMiniAppConfig].
const List<MiniAppConfig> availableMiniApps = [
MiniAppConfig(
id: miniAppTasksId,
icon: Icons.checklist_rounded,
color: Color(0xFF00D084),
category: 'productivity',
description:
'A simple task checklist that lives in your Matrix account data.',
inChat: false,
htmlAsset: 'assets/miniapps/tasks.html',
),
MiniAppConfig(
id: miniAppAccountDataId,
icon: Icons.storage_rounded,
color: Color(0xFF1F8EF1),
category: 'developer',
description: 'Read and edit the account data of your Matrix account.',
inChat: false,
htmlAsset: 'assets/miniapps/accountdata.html',
),
];
/// Declarative description of a mini app. The rendering is either a
/// self-contained HTML document loaded from [htmlAsset] (built-in apps) or
/// from [html] which is stored in the user's account data (imported apps).
class MiniAppConfig {
final String id;
final IconData icon;
final Color color;
final String? name;
final String? category;
final String? description;
/// Logo of the app: either an http(s) URL or a `data:` URI.
final String? logo;
/// Whether the mini app can run inside a chat room.
final bool inChat;
final String? htmlAsset;
final String? html;
const MiniAppConfig({
required this.id,
required this.icon,
required this.color,
this.name,
this.category,
this.description,
this.logo,
this.inChat = false,
this.htmlAsset,
this.html,
});
/// Config for a user-imported app whose HTML source is persisted in the
/// account data store.
MiniAppConfig.custom({
required String id,
String? name,
String? category,
String? description,
String? logo,
bool inChat = false,
String? html,
}) : this(
id: id,
icon: Icons.web_asset_rounded,
color: const Color(0xFF9C27B0),
name: name,
category: category,
description: description,
logo: logo,
inChat: inChat,
html: html,
);
bool get isCustom => html != null || htmlAsset == null;
/// Resolves the HTML source that should be rendered for this app. Returns a
/// bundled asset path for built-in apps or the raw HTML for imported apps.
String? get htmlSource => html ?? htmlAsset;
}
/// Resolves the config of a single installed app, whether it is built-in or
/// user-imported. Returns null if the app is not installed or not available.
MiniAppConfig? resolveMiniAppConfig(Client client, String appId) {
for (final app in availableMiniApps) {
if (app.id == appId) return app;
}
if (client.isMiniAppInstalled(appId)) {
final html = client.getMiniAppSource(appId);
if (html != null) {
return MiniAppConfig.custom(
id: appId,
name: client.getMiniAppName(appId),
category: client.getMiniAppCategory(appId),
description: client.getMiniAppDescription(appId),
logo: client.getMiniAppLogo(appId),
inChat: client.getMiniAppInChat(appId),
html: html,
);
}
}
return null;
}
/// Returns the configs of all installed apps: built-in ones plus the
/// user-imported ones. The visual order is: installed built-in apps first,
/// then imported apps.
List<MiniAppConfig> installedMiniAppConfigs(Client client) {
final installed = client.installedMiniApps;
return [
for (final app in availableMiniApps)
if (installed.contains(app.id)) app,
for (final id in installed)
if (!availableMiniApps.any((app) => app.id == id))
if (client.getMiniAppSource(id) != null)
MiniAppConfig.custom(
id: id,
name: client.getMiniAppName(id),
category: client.getMiniAppCategory(id),
description: client.getMiniAppDescription(id),
logo: client.getMiniAppLogo(id),
inChat: client.getMiniAppInChat(id),
html: client.getMiniAppSource(id),
),
];
}
/// Resolves the localized display name of a mini app configuration.
String miniAppName(BuildContext context, MiniAppConfig app) {
final customName = app.name;
if (customName != null && customName.isNotEmpty) return customName;
switch (app.id) {
case miniAppTasksId:
return L10n.of(context).tasks;
case miniAppAccountDataId:
return L10n.of(context).accountDataEditor;
default:
return app.id;
}
}

View File

@@ -6,6 +6,8 @@
import 'dart:async'; import 'dart:async';
import 'package:tatchat/config/themes.dart'; import 'package:tatchat/config/themes.dart';
import 'package:tatchat/pages/apps/apps.dart';
import 'package:tatchat/pages/apps/miniapp_page.dart';
import 'package:tatchat/pages/archive/archive.dart'; import 'package:tatchat/pages/archive/archive.dart';
import 'package:tatchat/pages/bootstrap/bootstrap_page.dart'; import 'package:tatchat/pages/bootstrap/bootstrap_page.dart';
import 'package:tatchat/pages/chat/chat.dart'; import 'package:tatchat/pages/chat/chat.dart';
@@ -241,6 +243,23 @@ abstract class AppRoutes {
), ),
redirect: loggedOutRedirect, redirect: loggedOutRedirect,
), ),
GoRoute(
path: 'apps',
pageBuilder: (context, state) =>
defaultPageBuilder(context, state, const Apps()),
routes: [
GoRoute(
path: ':appId',
pageBuilder: (context, state) => defaultPageBuilder(
context,
state,
MiniAppPage(appId: state.pathParameters['appId']!),
),
redirect: loggedOutRedirect,
),
],
redirect: loggedOutRedirect,
),
ShellRoute( ShellRoute(
pageBuilder: (context, state, child) => defaultPageBuilder( pageBuilder: (context, state, child) => defaultPageBuilder(
context, context,

View File

@@ -6,12 +6,12 @@
import 'dart:convert'; import 'dart:convert';
import 'package:async/async.dart'; import 'package:async/async.dart';
import 'package:tatchat/utils/platform_infos.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:managed_configurations/managed_configurations.dart'; import 'package:managed_configurations/managed_configurations.dart';
import 'package:matrix/matrix_api_lite/utils/logs.dart'; import 'package:matrix/matrix_api_lite/utils/logs.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:tatchat/utils/platform_infos.dart';
enum AppSettings<T> { enum AppSettings<T> {
textMessageMaxLength<int>('textMessageMaxLength', 16384), textMessageMaxLength<int>('textMessageMaxLength', 16384),
@@ -29,7 +29,7 @@ enum AppSettings<T> {
unifiedPushEndpoint<String>('chat.fluffy.unifiedpush.endpoint', ''), unifiedPushEndpoint<String>('chat.fluffy.unifiedpush.endpoint', ''),
pushNotificationsGatewayUrl<String>( pushNotificationsGatewayUrl<String>(
'pushNotificationsGatewayUrl', 'pushNotificationsGatewayUrl',
'https://push.fluffychat.im/_matrix/push/v1/notify', 'https://push.tatuchat.weltonmoura.com.br/_matrix/push/v1/notify',
), ),
pushNotificationsPusherFormat<String>( pushNotificationsPusherFormat<String>(
'pushNotificationsPusherFormat', 'pushNotificationsPusherFormat',
@@ -59,6 +59,11 @@ enum AppSettings<T> {
), ),
// colorSchemeSeed stored as ARGB int // colorSchemeSeed stored as ARGB int
colorSchemeSeedInt<int>('chat.fluffy.color_scheme_seed', 0xFF00D084), colorSchemeSeedInt<int>('chat.fluffy.color_scheme_seed', 0xFF00D084),
/// When false the chosen seed color is used verbatim as the theme primary
/// color. When true the Material 3 tonal palette is used instead, which
/// softens it.
softenThemeColor<bool>('chat.fluffy.soften_theme_color', false),
emojiSuggestionLocale<String>('emoji_suggestion_locale', ''), emojiSuggestionLocale<String>('emoji_suggestion_locale', ''),
enableSoftLogout<bool>('chat.fluffy.enable_soft_logout', true), enableSoftLogout<bool>('chat.fluffy.enable_soft_logout', true),
enableMatrixNativeOIDC<bool>('chat.fluffy.enable_matrix_native_oidc', true), enableMatrixNativeOIDC<bool>('chat.fluffy.enable_matrix_native_oidc', true),
@@ -67,16 +72,16 @@ enum AppSettings<T> {
'https://matrix.weltonmoura.com.br', 'https://matrix.weltonmoura.com.br',
), ),
welcomeText<String>('chat.fluffy.welcome_text', ''), welcomeText<String>('chat.fluffy.welcome_text', ''),
website<String>('chat.fluffy.website_url', 'https://fluffychat.im'), website<String>('chat.fluffy.website_url', 'https://tatuchat.weltonmoura.com.br/home'),
logoUrl<String>( logoUrl<String>(
'chat.fluffy.logo_url', 'chat.fluffy.logo_url',
'https://fluffychat.im/assets/favicon.png', 'https://tatuchat.weltonmoura.com.br/assets/assets/logo/mini/logo_mini.png',
), ),
privacyPolicy<String>( privacyPolicy<String>(
'chat.fluffy.privacy_policy_url', 'chat.fluffy.privacy_policy_url',
'https://fluffychat.im/privacy', 'https://tatuchat.weltonmoura.com.br/home/politica-de-privacidade/',
), ),
tos<String>('chat.fluffy.tos_url', 'https://fluffychat.im/tos'), tos<String>('chat.fluffy.tos_url', 'https://tatuchat.weltonmoura.com.br/tos'),
sendTimelineEventTimeout<int>('chat.fluffy.send_timeline_event_timeout', 15), sendTimelineEventTimeout<int>('chat.fluffy.send_timeline_event_timeout', 15),
webNotificationSound<bool>('chat.fluffy.web_notification_sound', true), webNotificationSound<bool>('chat.fluffy.web_notification_sound', true),
chatFilter<String>('chat.fluffy.chat_filter', 'allChats'), chatFilter<String>('chat.fluffy.chat_filter', 'allChats'),
@@ -87,7 +92,11 @@ enum AppSettings<T> {
benchmarksInLogs<bool>('chat.fluffy.benchmarks_in_logs', false), benchmarksInLogs<bool>('chat.fluffy.benchmarks_in_logs', false),
autoSendErrorReports<bool?>('chat.fluffy.auto_send_eror_reports', null), autoSendErrorReports<bool?>('chat.fluffy.auto_send_eror_reports', null),
knownErrorHashes<List<String>>('chat.fluffy.known_crash_hashes', []), knownErrorHashes<List<String>>('chat.fluffy.known_crash_hashes', []),
customLiveKitInstance<String>('chat.fluffy.custom_live_kit_instance', ''); customLiveKitInstance<String>('chat.fluffy.custom_live_kit_instance', ''),
/// URL of a CORS proxy used as a fallback when importing a mini app from a
/// URL on web, if the target server does not send CORS headers. Should end
/// with `?url=` or `?` (the target URL gets appended). Empty means disabled.
miniAppCorsProxy<String>('chat.fluffy.miniapp_cors_proxy', '');
final String key; final String key;
final T _defaultValue; final T _defaultValue;

View File

@@ -97,7 +97,14 @@ abstract class TatuPalette {
/// When a [seed] is provided (e.g. a color chosen by the user or a system /// When a [seed] is provided (e.g. a color chosen by the user or a system
/// dynamic color), its tonal values are used for the primary family while /// dynamic color), its tonal values are used for the primary family while
/// the brand surfaces, accent and error colors are preserved. /// the brand surfaces, accent and error colors are preserved.
static ColorScheme scheme(Brightness brightness, [Color? seed]) { ///
/// Unless [softenPrimary] is set, the seed is used verbatim as the primary
/// color, because the Material 3 tonal palette noticeably dulls it down.
static ColorScheme scheme(
Brightness brightness, [
Color? seed,
bool softenPrimary = false,
]) {
final isDark = brightness == Brightness.dark; final isDark = brightness == Brightness.dark;
final p = isDark ? _dark : _light; final p = isDark ? _dark : _light;
final base = ColorScheme.fromSeed( final base = ColorScheme.fromSeed(
@@ -106,12 +113,17 @@ abstract class TatuPalette {
dynamicSchemeVariant: DynamicSchemeVariant.rainbow, dynamicSchemeVariant: DynamicSchemeVariant.rainbow,
); );
final useBrandPrimary = seed == null; final useBrandPrimary = seed == null;
// Only force the exact color when the caller did not ask for the soft
// Material 3 palette. `null` here means "keep the value from [base]".
final exactPrimary = !useBrandPrimary && !softenPrimary ? seed : null;
return base.copyWith( return base.copyWith(
primary: useBrandPrimary ? p.primary : null, primary: useBrandPrimary ? p.primary : exactPrimary,
onPrimary: useBrandPrimary ? p.onPrimary : null, onPrimary: useBrandPrimary
? p.onPrimary
: (exactPrimary == null ? null : _contrastOn(exactPrimary)),
primaryContainer: useBrandPrimary ? p.primaryContainer : null, primaryContainer: useBrandPrimary ? p.primaryContainer : null,
onPrimaryContainer: useBrandPrimary ? p.onPrimaryContainer : null, onPrimaryContainer: useBrandPrimary ? p.onPrimaryContainer : null,
surfaceTint: useBrandPrimary ? p.primary : null, surfaceTint: useBrandPrimary ? p.primary : exactPrimary,
secondary: p.secondary, secondary: p.secondary,
onSecondary: p.onSecondary, onSecondary: p.onSecondary,
secondaryContainer: p.secondaryContainer, secondaryContainer: p.secondaryContainer,
@@ -141,6 +153,12 @@ abstract class TatuPalette {
surfaceBright: p.surfaceBright, surfaceBright: p.surfaceBright,
); );
} }
/// Picks the readable foreground for an arbitrary background color.
static Color _contrastOn(Color background) =>
ThemeData.estimateBrightnessForColor(background) == Brightness.dark
? Colors.white
: Colors.black;
} }
class _Scheme { class _Scheme {

View File

@@ -15,6 +15,9 @@ abstract class FluffyThemes {
static const double navRailWidth = 80.0; static const double navRailWidth = 80.0;
/// Width of the navigation sidebar (column mode only).
static const double sidebarWidth = 280.0;
static bool isColumnModeByWidth(double width) => static bool isColumnModeByWidth(double width) =>
width > columnWidth * 2 + navRailWidth; width > columnWidth * 2 + navRailWidth;
@@ -44,8 +47,9 @@ abstract class FluffyThemes {
BuildContext context, BuildContext context,
Brightness brightness, [ Brightness brightness, [
Color? seed, Color? seed,
bool softenPrimary = false,
]) { ]) {
final colorScheme = TatuPalette.scheme(brightness, seed); final colorScheme = TatuPalette.scheme(brightness, seed, softenPrimary);
final isColumnMode = FluffyThemes.isColumnMode(context); final isColumnMode = FluffyThemes.isColumnMode(context);
final dividerColor = brightness == Brightness.dark final dividerColor = brightness == Brightness.dark
? colorScheme.surfaceContainerHighest ? colorScheme.surfaceContainerHighest

View File

@@ -540,7 +540,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "دعاك {username} إلى FluffyChat.\n1. قم بزيارة موقع fluffychat.im وقم بتثبيت التطبيق\n2. قم بإنشاءحساب أو تسجيل الدخول\n3. افتح رابط الدعوة:\n {link}", "inviteText": "دعاك {username} إلى TatuChat.\n1. قم بزيارة موقع tatuchat.weltonmoura.com.br وقم بتثبيت التطبيق\n2. قم بإنشاءحساب أو تسجيل الدخول\n3. افتح رابط الدعوة:\n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -672,7 +672,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 رسالة جديدة في FluffyChat", "newMessageInFluffyChat": "💬 رسالة جديدة في TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2455,7 +2455,7 @@
"advancedConfigurations": "التكويناتالمتقدمة", "advancedConfigurations": "التكويناتالمتقدمة",
"signIn": "تسجيل الدخول", "signIn": "تسجيل الدخول",
"createNewAccount": "إنشاء حساب جديد", "createNewAccount": "إنشاء حساب جديد",
"signUpGreeting": "FluffyChat لا مركزي! اختر الخادم الذي تريد إنشاء حسابك عليه ولنبدأ!", "signUpGreeting": "TatuChat لا مركزي! اختر الخادم الذي تريد إنشاء حسابك عليه ولنبدأ!",
"signInGreeting": "هل لديك حساب بالفعل في ماتريكس؟ أهلاً بك مجدداً! اختر خادمك المنزلي وسجّل الدخول.", "signInGreeting": "هل لديك حساب بالفعل في ماتريكس؟ أهلاً بك مجدداً! اختر خادمك المنزلي وسجّل الدخول.",
"theProcessWasCanceled": "تم إلغاء العملية.", "theProcessWasCanceled": "تم إلغاء العملية.",
"join": "انضمام", "join": "انضمام",
@@ -2474,7 +2474,7 @@
}, },
"createNewChat": "إنشاء محادثة جديدة", "createNewChat": "إنشاء محادثة جديدة",
"reset": "إعادة تعيين", "reset": "إعادة تعيين",
"supportFluffyChat": "ادعم FluffyChat", "supportFluffyChat": "ادعم TatuChat",
"support": "دعم", "support": "دعم",
"setLowPriority": "حدد أولوية منخفضة", "setLowPriority": "حدد أولوية منخفضة",
"unsetLowPriority": "إلغاء تعيين الأولوية المنخفضة", "unsetLowPriority": "إلغاء تعيين الأولوية المنخفضة",
@@ -2484,7 +2484,7 @@
"tagName": "اسم الوسم", "tagName": "اسم الوسم",
"createNewTag": "إنشاء وسم جديد", "createNewTag": "إنشاء وسم جديد",
"hideRoomsInSpaces": "إخفاء الغرف الموجودة في مساحة", "hideRoomsInSpaces": "إخفاء الغرف الموجودة في مساحة",
"possibleByYou": "لم يكن هذا الإصدار ليتحقق لولا دعمكم. سيظل FluffyChat مجانيًا ومفتوح المصدر، ويعتمد كليًا على جهود المجتمع.", "possibleByYou": "لم يكن هذا الإصدار ليتحقق لولا دعمكم. سيظل TatuChat مجانيًا ومفتوح المصدر، ويعتمد كليًا على جهود المجتمع.",
"showThumbnailsInTimeline": "عرض الصور المصغرة للصور ومقاطع الفيديو", "showThumbnailsInTimeline": "عرض الصور المصغرة للصور ومقاطع الفيديو",
"appSubtitle": "اتصال آمن [مصفوفة]", "appSubtitle": "اتصال آمن [مصفوفة]",
"appDescription": "التواصل بشكل مشفر عبر شبكة [المصفوفة] اللامركزية بطريقة سهلة ومتاحة للجميع.", "appDescription": "التواصل بشكل مشفر عبر شبكة [المصفوفة] اللامركزية بطريقة سهلة ومتاحة للجميع.",
@@ -2558,7 +2558,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newPassphraseDescription": "يستخدم تطبيق FluffyChat التشفير التام بين الطرفين. ولضمان عدم فقدان رسائلك، يُرجى اختيار عبارة مرور قوية لحماية هويتك الرقمية ونسخة احتياطية من رسائلك المشفرة.", "newPassphraseDescription": "يستخدم تطبيق TatuChat التشفير التام بين الطرفين. ولضمان عدم فقدان رسائلك، يُرجى اختيار عبارة مرور قوية لحماية هويتك الرقمية ونسخة احتياطية من رسائلك المشفرة.",
"@newPassphraseDescription": { "@newPassphraseDescription": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}

View File

@@ -924,7 +924,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} запрасіў вас у FluffyChat.\n1. Перайдзіце на fluffychat.im і ўстанавіце праграму\n2. Зарэгестрыруйцесь альбо ўвайдзіце\n3. Перайдзіце па запрашальнай спасылцы:\n{link}", "inviteText": "{username} запрасіў вас у TatuChat.\n1. Перайдзіце на tatuchat.weltonmoura.com.br і ўстанавіце праграму\n2. Зарэгестрыруйцесь альбо ўвайдзіце\n3. Перайдзіце па запрашальнай спасылцы:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -1085,7 +1085,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 Новае паведамленне ў FluffyChat", "newMessageInFluffyChat": "💬 Новае паведамленне ў TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2464,7 +2464,7 @@
"advancedConfigurations": "Пашыраная канфігурацыя", "advancedConfigurations": "Пашыраная канфігурацыя",
"signIn": "Увайсці", "signIn": "Увайсці",
"createNewAccount": "Стварыць новы ўліковы запіс", "createNewAccount": "Стварыць новы ўліковы запіс",
"signUpGreeting": "FluffyChat дэцэнтралізаваны! Выберыце свой сервер, дзе вы хаціце стварыць уліковы запіс і прайягвайце!", "signUpGreeting": "TatuChat дэцэнтралізаваны! Выберыце свой сервер, дзе вы хаціце стварыць уліковы запіс і прайягвайце!",
"signInGreeting": "Вы ўжо маеце ўліковы запіс у Matrix? З вяртаннем! Выберыце свой хатні сервер і аўтарызуйцеся.", "signInGreeting": "Вы ўжо маеце ўліковы запіс у Matrix? З вяртаннем! Выберыце свой хатні сервер і аўтарызуйцеся.",
"theProcessWasCanceled": "Працэс быў скасаваны.", "theProcessWasCanceled": "Працэс быў скасаваны.",
"join": "Далучыцца", "join": "Далучыцца",
@@ -2484,7 +2484,7 @@
}, },
"createNewChat": "Стварыць новы чат", "createNewChat": "Стварыць новы чат",
"reset": "Скінуць", "reset": "Скінуць",
"supportFluffyChat": "Падтрымаць FluffyChat", "supportFluffyChat": "Падтрымаць TatuChat",
"support": "Падтрымаць", "support": "Падтрымаць",
"setLowPriority": "Прызначыць нізкі прыярытэт", "setLowPriority": "Прызначыць нізкі прыярытэт",
"unsetLowPriority": "Скасаваць нізкі прыярытэт", "unsetLowPriority": "Скасаваць нізкі прыярытэт",

View File

@@ -625,7 +625,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} t'ha convidat a FluffyChat.\n1. Visita fluffychat.im i instaŀla l'app\n2. Registra't o inicia sessió\n3. Obre l'enllaç d'invitació:\n{link}", "inviteText": "{username} t'ha convidat a TatuChat.\n1. Visita tatuchat.weltonmoura.com.br i instaŀla l'app\n2. Registra't o inicia sessió\n3. Obre l'enllaç d'invitació:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -772,7 +772,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 Missatge nou al FluffyChat", "newMessageInFluffyChat": "💬 Missatge nou al TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -797,7 +797,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"noGoogleServicesWarning": "Sembla que no teniu els Serveis de Google al telèfon. Això és una bona decisió respecte a la vostra privadesa! Per a rebre notificacions automàtiques del FluffyChat, us recomanem instaŀlar ntfy. Amb ntfy o qualsevol altre proveïdor de Unified Push, pots rebre notificacions de forma segura i lliure. Pots instaŀlar ntfy des de la PlayStore o des de F-Droid.", "noGoogleServicesWarning": "Sembla que no teniu els Serveis de Google al telèfon. Això és una bona decisió respecte a la vostra privadesa! Per a rebre notificacions automàtiques del TatuChat, us recomanem instaŀlar ntfy. Amb ntfy o qualsevol altre proveïdor de Unified Push, pots rebre notificacions de forma segura i lliure. Pots instaŀlar ntfy des de la PlayStore o des de F-Droid.",
"@noGoogleServicesWarning": { "@noGoogleServicesWarning": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2476,7 +2476,7 @@
"advancedConfigurations": "Configuracions avançades", "advancedConfigurations": "Configuracions avançades",
"signIn": "Obre sessió", "signIn": "Obre sessió",
"createNewAccount": "Crea un compte nou", "createNewAccount": "Crea un compte nou",
"signUpGreeting": "El FluffyChat és descentralitzat! Tria un servidor on vulguis crear-t'hi un compte, i som-hi!", "signUpGreeting": "El TatuChat és descentralitzat! Tria un servidor on vulguis crear-t'hi un compte, i som-hi!",
"signInGreeting": "Si ja tens un compte a Matrix, benvingudi! Tria el teu servidor i inicia-hi sessió.", "signInGreeting": "Si ja tens un compte a Matrix, benvingudi! Tria el teu servidor i inicia-hi sessió.",
"theProcessWasCanceled": "S'ha canceŀlat el procés.", "theProcessWasCanceled": "S'ha canceŀlat el procés.",
"join": "Entra", "join": "Entra",
@@ -2496,7 +2496,7 @@
}, },
"createNewChat": "Crea un nou xat", "createNewChat": "Crea un nou xat",
"reset": "Reseteja", "reset": "Reseteja",
"supportFluffyChat": "Dona suport a FluffyChat", "supportFluffyChat": "Dona suport a TatuChat",
"support": "Aporta", "support": "Aporta",
"setLowPriority": "Estableix una prioritat baixa", "setLowPriority": "Estableix una prioritat baixa",
"unsetLowPriority": "Restableix la prioritat", "unsetLowPriority": "Restableix la prioritat",

View File

@@ -814,7 +814,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} vás pozval/a na FluffyChat.\n1. Navštivte fluffychat.im a nainstalujte si aplikaci.\n2. Zaregistrujte se nebo se přihlaste.\n3. Otevřte pozvánku: \n {link}", "inviteText": "{username} vás pozval/a na TatuChat.\n1. Navštivte tatuchat.weltonmoura.com.br.im a nainstalujte si aplikaci.\n2. Zaregistrujte se nebo se přihlaste.\n3. Otevřte pozvánku: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -971,7 +971,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 Nová zpráva ve FluffyChatu", "newMessageInFluffyChat": "💬 Nová zpráva ve TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2327,7 +2327,7 @@
"advancedConfigs": "Pokročilá nastavení", "advancedConfigs": "Pokročilá nastavení",
"signIn": "Přihlásit se", "signIn": "Přihlásit se",
"createNewAccount": "Vytvořit nový účet", "createNewAccount": "Vytvořit nový účet",
"signUpGreeting": "FluffyChat je decentralizovaný! Vyberte server, kde si chcete vytvořit účet, a jdeme na věc!", "signUpGreeting": "TatuChat je decentralizovaný! Vyberte server, kde si chcete vytvořit účet, a jdeme na věc!",
"signInGreeting": "Již máte účet na Matrixu? Vítejte zpět! Vyberte svůj domácí server a přihlaste se.", "signInGreeting": "Již máte účet na Matrixu? Vítejte zpět! Vyberte svůj domácí server a přihlaste se.",
"theProcessWasCanceled": "Proces byl zrušen.", "theProcessWasCanceled": "Proces byl zrušen.",
"sendImages": "Poslat {count} obrazků", "sendImages": "Poslat {count} obrazků",

View File

@@ -809,7 +809,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} hat Dich zu FluffyChat eingeladen. \n1. Gehe auf fluffychat.im und installiere die App \n2. Melde Dich in der App an \n3. Öffne den Einladungslink: \n {link}", "inviteText": "{username} hat Dich zu TatuChat eingeladen. \n1. Gehe auf TatuChat und installiere die App \n2. Melde Dich in der App an \n3. Öffne den Einladungslink: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -966,7 +966,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 Neue Nachricht in FluffyChat", "newMessageInFluffyChat": "💬 Neue Nachricht in TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2483,7 +2483,7 @@
"advancedConfigurations": "Erweiterte Konfigurationen", "advancedConfigurations": "Erweiterte Konfigurationen",
"signIn": "Anmelden", "signIn": "Anmelden",
"createNewAccount": "Neues Konto erstellen", "createNewAccount": "Neues Konto erstellen",
"signUpGreeting": "FluffyChat ist dezentral! Wähle einen Server, auf dem du dein Konto erstellen möchtest, und los geht's!", "signUpGreeting": "TatuChat ist dezentral! Wähle einen Server, auf dem du dein Konto erstellen möchtest, und los geht's!",
"signInGreeting": "Du hast bereits ein Konto bei Matrix? Willkommen zurück! Wähle deinen Homeserver aus und melde dich an.", "signInGreeting": "Du hast bereits ein Konto bei Matrix? Willkommen zurück! Wähle deinen Homeserver aus und melde dich an.",
"theProcessWasCanceled": "Der Vorgang wurde abgebrochen.", "theProcessWasCanceled": "Der Vorgang wurde abgebrochen.",
"federationBaseUrl": "Basis-URL der Föderation", "federationBaseUrl": "Basis-URL der Föderation",
@@ -2505,7 +2505,7 @@
"description": "This should be a very short string because there is not much space in the button!" "description": "This should be a very short string because there is not much space in the button!"
}, },
"createNewChat": "Neuen Chat erstellen", "createNewChat": "Neuen Chat erstellen",
"supportFluffyChat": "FluffyChat unterstützen", "supportFluffyChat": "TatuChat unterstützen",
"support": "Unterstützen", "support": "Unterstützen",
"createNewTag": "Neuen tag erstellen", "createNewTag": "Neuen tag erstellen",
"tagName": "Tag-Name", "tagName": "Tag-Name",
@@ -2523,7 +2523,7 @@
"showMore": "Mehr anzeigen", "showMore": "Mehr anzeigen",
"showLess": "Weniger anzeigen", "showLess": "Weniger anzeigen",
"hideRoomsInSpaces": "Räume ausblenden, die sich in einem space befinden", "hideRoomsInSpaces": "Räume ausblenden, die sich in einem space befinden",
"possibleByYou": "Diese Veröffentlichung war nur dank eurer Unterstützung möglich. FluffyChat bleibt kostenlos, Open-Source und vollständig von der Community getragen.", "possibleByYou": "Diese Veröffentlichung war nur dank eurer Unterstützung möglich. TatuChat bleibt kostenlos, Open-Source und vollständig von der Community getragen.",
"showThumbnailsInTimeline": "Thumbnails von Bildern und Videos anzeigen", "showThumbnailsInTimeline": "Thumbnails von Bildern und Videos anzeigen",
"appSubtitle": "Sichere [matrix]-Kommunikation", "appSubtitle": "Sichere [matrix]-Kommunikation",
"interactiveVerification": "Interaktive Verifikation", "interactiveVerification": "Interaktive Verifikation",
@@ -2606,7 +2606,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newPassphraseDescription": "FluffyChat verwendet Ende-zu-Ende-Verschlüsselung. Um deine Nachrichten nicht zu verlieren, wähle bitte eine starke Passphrase, um deine Krypto-Identität und dein verschlüsseltes Nachrichten-Backup zu sichern.", "newPassphraseDescription": "TatuChat verwendet Ende-zu-Ende-Verschlüsselung. Um deine Nachrichten nicht zu verlieren, wähle bitte eine starke Passphrase, um deine Krypto-Identität und dein verschlüsseltes Nachrichten-Backup zu sichern.",
"@newPassphraseDescription": { "@newPassphraseDescription": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}

View File

@@ -1,9 +1,12 @@
{ {
"developer": "Developer",
"editImage": "Edit image", "editImage": "Edit image",
"@editImage": { "@editImage": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"environmentVariables": "Environment variables",
"licence": "Licence",
"rotateLeft": "Rotate left", "rotateLeft": "Rotate left",
"@rotateLeft": { "@rotateLeft": {
"type": "String", "type": "String",
@@ -245,7 +248,7 @@
} }
}, },
"sendTypingNotifications": "Send typing notifications", "sendTypingNotifications": "Send typing notifications",
"swipeRightToLeftToReply": "Swipe right to left to reply", "swipeRightToLeftToReply": "Swipe left to right to reply",
"sendOnEnter": "Send on enter", "sendOnEnter": "Send on enter",
"noMoreChatsFound": "No more chats found...", "noMoreChatsFound": "No more chats found...",
"noChatsFoundHere": "No chats found here yet. Start a new chat with someone by using the button below. ⤵️", "noChatsFoundHere": "No chats found here yet. Start a new chat with someone by using the button below. ⤵️",
@@ -996,7 +999,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} invited you to FluffyChat.\n1. Visit fluffychat.im and install the app \n2. Sign up or sign in \n3. Open the invite link: \n {link}", "inviteText": "{username} invited you to TatuChat.\n1. Visit tatuchat.weltonmoura.com.br and install the app \n2. Sign up or sign in \n3. Open the invite link: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -1157,7 +1160,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 New message in FluffyChat", "newMessageInFluffyChat": "💬 New message in TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2359,6 +2362,7 @@
}, },
"appWantsToUseForLoginDescription": "You hereby allow the app and website to share information about you.", "appWantsToUseForLoginDescription": "You hereby allow the app and website to share information about you.",
"open": "Open", "open": "Open",
"refresh": "Refresh",
"waitingForServer": "Waiting for server...", "waitingForServer": "Waiting for server...",
"newChatRequest": "📩 New chat request", "newChatRequest": "📩 New chat request",
"contentNotificationSettings": "Content notification settings", "contentNotificationSettings": "Content notification settings",
@@ -2465,6 +2469,16 @@
} }
} }
}, },
"countFollowers": "{count, plural, =1{1 subscriber} other{{count} subscribers}}",
"@countFollowers": {
"type": "String",
"placeholders": {
"count": {
"type": "int"
}
}
},
"by": "by",
"spaceMemberOf": "Space member of {spaces}", "spaceMemberOf": "Space member of {spaces}",
"@spaceMemberOf": { "@spaceMemberOf": {
"type": "String", "type": "String",
@@ -2551,12 +2565,19 @@
"advancedConfigurations": "Advanced configurations", "advancedConfigurations": "Advanced configurations",
"signIn": "Sign in", "signIn": "Sign in",
"createNewAccount": "Create new account", "createNewAccount": "Create new account",
"signUpGreeting": "FluffyChat is decentralized! Select a server where you want to create your account and let's go!", "signUpGreeting": "TatuChat is decentralized! Select a server where you want to create your account and let's go!",
"signInGreeting": "You already have an account in Matrix? Welcome back! Select your homeserver and sign in.", "signInGreeting": "You already have an account in Matrix? Welcome back! Select your homeserver and sign in.",
"theProcessWasCanceled": "The process was canceled.", "theProcessWasCanceled": "The process was canceled.",
"join": "Join", "join": "Join",
"searchOrEnterHomeserverAddress": "Search or enter homeserver address", "searchOrEnterHomeserverAddress": "Search or enter homeserver address",
"matrixId": "Matrix ID", "matrixId": "Matrix ID",
"@matrixId": {
"description": "The Matrix ID of the user"
},
"menu": "Menu",
"@menu": {
"description": "Label for the navigation menu button"
},
"setPowerLevel": "Set power level", "setPowerLevel": "Set power level",
"makeModerator": "Make moderator", "makeModerator": "Make moderator",
"makeAdmin": "Make admin", "makeAdmin": "Make admin",
@@ -2571,7 +2592,7 @@
}, },
"createNewChat": "Create new chat", "createNewChat": "Create new chat",
"reset": "Reset", "reset": "Reset",
"supportFluffyChat": "Support FluffyChat", "supportFluffyChat": "Support TatuChat",
"support": "Support", "support": "Support",
"setLowPriority": "Set low priority", "setLowPriority": "Set low priority",
"unsetLowPriority": "Unset low priority", "unsetLowPriority": "Unset low priority",
@@ -2581,7 +2602,7 @@
"tagName": "Tag name", "tagName": "Tag name",
"createNewTag": "Create new tag", "createNewTag": "Create new tag",
"hideRoomsInSpaces": "Hide rooms that are in a space", "hideRoomsInSpaces": "Hide rooms that are in a space",
"possibleByYou": "This release was only possible thanks to your support. FluffyChat remains free, open-source, and entirely community-driven.", "possibleByYou": "This release was only possible thanks to your support. TatuChat remains free, open-source, and entirely community-driven.",
"showThumbnailsInTimeline": "Show thumbnails of images and videos", "showThumbnailsInTimeline": "Show thumbnails of images and videos",
"appSubtitle": "Um App de comunicação segura", "appSubtitle": "Um App de comunicação segura",
"appDescription": "Communicate encrypted over the decentralized [matrix] network in an easy and accessible way for everyone.", "appDescription": "Communicate encrypted over the decentralized [matrix] network in an easy and accessible way for everyone.",
@@ -2665,7 +2686,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newPassphraseDescription": "FluffyChat uses end to end encryption. To not lose your messages, please choose a strong passphrase to secure your crypto identity and your encrypted message backup.", "newPassphraseDescription": "TatuChat uses end to end encryption. To not lose your messages, please choose a strong passphrase to secure your crypto identity and your encrypted message backup.",
"@newPassphraseDescription": { "@newPassphraseDescription": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2923,5 +2944,100 @@
"areYouSureDeletePost": "Delete", "areYouSureDeletePost": "Delete",
"@areYouSureDeletePost": { "@areYouSureDeletePost": {
"description": "Delete this post from the mural" "description": "Delete this post from the mural"
},
"apps": "Apps",
"@apps": {
"type": "String",
"placeholders": {}
},
"tasks": "Tasks",
"@tasks": {
"type": "String",
"placeholders": {}
},
"accountDataEditor": "Account data",
"@accountDataEditor": {
"type": "String",
"placeholders": {}
},
"addTask": "Add task",
"@addTask": {
"type": "String",
"placeholders": {}
},
"taskInputPlaceholder": "What do you need to do?",
"@taskInputPlaceholder": {
"type": "String",
"placeholders": {}
},
"noTasksYet": "No tasks yet",
"@noTasksYet": {
"type": "String",
"placeholders": {}
},
"install": "Install",
"@install": {
"type": "String",
"placeholders": {}
},
"uninstall": "Uninstall",
"@uninstall": {
"type": "String",
"placeholders": {}
},
"installedApps": "Installed apps",
"@installedApps": {
"type": "String",
"placeholders": {}
},
"availableApps": "Available apps",
"@availableApps": {
"type": "String",
"placeholders": {}
},
"importApp": "Import app",
"@importApp": {
"type": "String",
"placeholders": {}
},
"importFromFile": "Import from file",
"@importFromFile": {
"type": "String",
"placeholders": {}
},
"importFromUrl": "Import from URL",
"@importFromUrl": {
"type": "String",
"placeholders": {}
},
"appImported": "App imported",
"@appImported": {
"type": "String",
"placeholders": {}
},
"moreOptions": "More options",
"@moreOptions": {
"type": "String",
"placeholders": {}
},
"uninstallApp": "Uninstall app?",
"@uninstallApp": {
"type": "String",
"placeholders": {}
},
"uninstallAppConfirm": "Do you really want to uninstall this app?",
"@uninstallAppConfirm": {
"type": "String",
"placeholders": {}
},
"softenThemeColor": "Soften theme color",
"@softenThemeColor": {
"type": "String",
"placeholders": {}
},
"softenThemeColorSubtitle": "Use a soft Material 3 palette derived from the selected color instead of the exact color.",
"@softenThemeColorSubtitle": {
"type": "String",
"placeholders": {}
} }
} }

View File

@@ -803,7 +803,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} invitis vin al FluffyChat. \n1. Instalu la aplikaĵon FluffyChat: https://fluffychat.im \n2. Registriĝu aŭ salutu \n3. Malfermu la invitan ligilon: {link}", "inviteText": "{username} invitis vin al TatuChat. \n1. Instalu la aplikaĵon TatuChat: https://tatuchat.weltonmoura.com.br \n2. Registriĝu aŭ salutu \n3. Malfermu la invitan ligilon: {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -950,7 +950,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "Nova mesaĝo en FluffyChat", "newMessageInFluffyChat": "Nova mesaĝo en TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}

View File

@@ -622,7 +622,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} te invitó a FluffyChat.\n1.Visita fluffychat.im e instala la app\n2. Regístrate o inicia sesión\n3. Abre el enlace de invitación:\n{link}", "inviteText": "{username} te invitó a TatuChat.\n1.Visita TatuChat e instala la app\n2. Regístrate o inicia sesión\n3. Abre el enlace de invitación:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -759,7 +759,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "Nuevo mensaje en FluffyChat", "newMessageInFluffyChat": "Nuevo mensaje en TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2485,7 +2485,7 @@
"advancedConfigurations": "Configuraciones Avanzadas", "advancedConfigurations": "Configuraciones Avanzadas",
"signIn": "Iniciar sesión", "signIn": "Iniciar sesión",
"createNewAccount": "Crear nueva cuenta", "createNewAccount": "Crear nueva cuenta",
"signUpGreeting": "¡FluffyChat está descentralizado! ¡Selecciona un servidor donde quieres crear tu cuenta y sigamos!", "signUpGreeting": "TatuChat está descentralizado! ¡Selecciona un servidor donde quieres crear tu cuenta y sigamos!",
"signInGreeting": "¿Ya tienes una cuenta en Matrix? ¡Bienvenido de nuevo! Selecciona tu servidor e inicia sesión.", "signInGreeting": "¿Ya tienes una cuenta en Matrix? ¡Bienvenido de nuevo! Selecciona tu servidor e inicia sesión.",
"theProcessWasCanceled": "El proceso se ha cancelado.", "theProcessWasCanceled": "El proceso se ha cancelado.",
"join": "Unirse", "join": "Unirse",
@@ -2505,7 +2505,7 @@
}, },
"createNewChat": "Crear nuevo chat", "createNewChat": "Crear nuevo chat",
"reset": "Resetear", "reset": "Resetear",
"supportFluffyChat": "Apoyar FluffyChat", "supportFluffyChat": "Apoyar TatuChat",
"support": "Apoyar", "support": "Apoyar",
"setLowPriority": "Colocar baja prioridad", "setLowPriority": "Colocar baja prioridad",
"unsetLowPriority": "Desactivar baja prioridad", "unsetLowPriority": "Desactivar baja prioridad",
@@ -2522,7 +2522,7 @@
"showMore": "Mostrar más", "showMore": "Mostrar más",
"showLess": "Mostrar menos", "showLess": "Mostrar menos",
"hideRoomsInSpaces": "Esconder salas que estén en un espacio", "hideRoomsInSpaces": "Esconder salas que estén en un espacio",
"possibleByYou": "Esta versión sólo fue posible gracias a tu apoyo. FluffyChat sigue siendo gratis, de código abierto y totalmente impulsado por la comunidad.", "possibleByYou": "Esta versión sólo fue posible gracias a tu apoyo. TatuChat sigue siendo gratis, de código abierto y totalmente impulsado por la comunidad.",
"showThumbnailsInTimeline": "Mostrar miniaturas de imágenes y videos", "showThumbnailsInTimeline": "Mostrar miniaturas de imágenes y videos",
"appSubtitle": "Comunicación [matrix] Segura", "appSubtitle": "Comunicación [matrix] Segura",
"appDescription": "Comunicación cifrada a través de la red descentralizada [matrix] de una manera fácil y accesible para todos.", "appDescription": "Comunicación cifrada a través de la red descentralizada [matrix] de una manera fácil y accesible para todos.",

View File

@@ -814,7 +814,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} kutsus sind kasutama Matrix'i-põhist suhtlusrakendust FluffyChat. \n1. Ava fluffychat.im ja paigalda FluffyChat'i rakendus \n2. Liitu kasutajaks või logi sisse olemasoleva Matrix'i kasutajakontoga\n3. Ava kutse link: \n {link}", "inviteText": "{username} kutsus sind kasutama Matrix'i-põhist suhtlusrakendust TatuChat. \n1. Ava TatuChat ja paigalda TatuChat'i rakendus \n2. Liitu kasutajaks või logi sisse olemasoleva Matrix'i kasutajakontoga\n3. Ava kutse link: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -971,7 +971,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 Uus sõnum FluffyChati vahendusel", "newMessageInFluffyChat": "💬 Uus sõnum TatuChat vahendusel",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -1006,7 +1006,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"noGoogleServicesWarning": "Tundub, et sinu nutiseadmes pole Firebase Cloud Messaging teenuseid. Sinu privaatsuse mõttes on see kindlasti hea otsus! Kui sa soovid FluffyChatis näha tõuketeavitusi, siis soovitame, et selle jaoks kasutad ntfy liidestust. Kasutades ntfyd või mõnda muud Unified Push standardil põhinevat liidestust saad tõuketeavitusi turvalisel moel. Ntfy rakendus on saadaval nii PlayStore kui F-Droidi rakendusepoodides.", "noGoogleServicesWarning": "Tundub, et sinu nutiseadmes pole Firebase Cloud Messaging teenuseid. Sinu privaatsuse mõttes on see kindlasti hea otsus! Kui sa soovid TatuChat näha tõuketeavitusi, siis soovitame, et selle jaoks kasutad ntfy liidestust. Kasutades ntfyd või mõnda muud Unified Push standardil põhinevat liidestust saad tõuketeavitusi turvalisel moel. Ntfy rakendus on saadaval nii PlayStore kui F-Droidi rakendusepoodides.",
"@noGoogleServicesWarning": { "@noGoogleServicesWarning": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2480,7 +2480,7 @@
"advancedConfigurations": "Täiendavad seadistused", "advancedConfigurations": "Täiendavad seadistused",
"signIn": "Logi sisse", "signIn": "Logi sisse",
"createNewAccount": "Loo uus kasutajakonto", "createNewAccount": "Loo uus kasutajakonto",
"signUpGreeting": "FluffyChat kasutab hajutatud võrku! Vali server, kuhu tahad oma kasutajakonto lisada ning alustame!", "signUpGreeting": "TatuChat kasutab hajutatud võrku! Vali server, kuhu tahad oma kasutajakonto lisada ning alustame!",
"signInGreeting": "Sul juba on Matrixi kasutajakonto olemas? Tere tulemast tagasi! Vali oma koduserver ja logi sisse.", "signInGreeting": "Sul juba on Matrixi kasutajakonto olemas? Tere tulemast tagasi! Vali oma koduserver ja logi sisse.",
"theProcessWasCanceled": "Protsess on katkestatud.", "theProcessWasCanceled": "Protsess on katkestatud.",
"join": "Liitu", "join": "Liitu",
@@ -2500,7 +2500,7 @@
}, },
"createNewChat": "Loo uus vestlus", "createNewChat": "Loo uus vestlus",
"reset": "Lähtesta", "reset": "Lähtesta",
"supportFluffyChat": "Toeta FluffyChati", "supportFluffyChat": "Toeta TatuChat",
"support": "Toeta meid", "support": "Toeta meid",
"setLowPriority": "Märgi vähetähtsaks", "setLowPriority": "Märgi vähetähtsaks",
"unsetLowPriority": "Eemalda märkimine vähetähtsaks", "unsetLowPriority": "Eemalda märkimine vähetähtsaks",
@@ -2515,7 +2515,7 @@
"placeholders": {} "placeholders": {}
}, },
"hideRoomsInSpaces": "Peida jututoad, mis on osa kogukonnast", "hideRoomsInSpaces": "Peida jututoad, mis on osa kogukonnast",
"possibleByYou": "Selle versiooni väljaandmine oli võimalik vaid sinu toetusele. FluffyChat jääb vabaks, avatud lähtekoodi põhiseks ja kogukonnakeskseks.", "possibleByYou": "Selle versiooni väljaandmine oli võimalik vaid sinu toetusele. TatuChat jääb vabaks, avatud lähtekoodi põhiseks ja kogukonnakeskseks.",
"showThumbnailsInTimeline": "Näita piltide ja videote pisipilte", "showThumbnailsInTimeline": "Näita piltide ja videote pisipilte",
"appSubtitle": "Turvaline suhtlus [matrix]'i võrgus", "appSubtitle": "Turvaline suhtlus [matrix]'i võrgus",
"appDescription": "Suhtle krüptitult hajutatud [matrix] võrgustikus viisil, mis on lihtne ja kõigile kättesaadav.", "appDescription": "Suhtle krüptitult hajutatud [matrix] võrgustikus viisil, mis on lihtne ja kõigile kättesaadav.",
@@ -2617,7 +2617,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newPassphraseDescription": "FluffyChat kasutab läbivat krüptimist. Et sa ei kaotaks oma sõnumeid, turvaks oma krüptidentitedi ja krüptiks sõnumite varunduse, siis palun sisesta korralik ja tugev salafraas.", "newPassphraseDescription": "TatuChat kasutab läbivat krüptimist. Et sa ei kaotaks oma sõnumeid, turvaks oma krüptidentitedi ja krüptiks sõnumite varunduse, siis palun sisesta korralik ja tugev salafraas.",
"@newPassphraseDescription": { "@newPassphraseDescription": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}

View File

@@ -534,7 +534,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username}(e)k FluffyChatera gonbidatu zaitu.\n1. Bisitatu https://fluffychat.im eta instalatu aplikazioa\n2. Eman izena edo hasi saioa\n3. Ireki gonbidapen-esteka:\n{link}", "inviteText": "{username}(e)k TatuChat gonbidatu zaitu.\n1. Bisitatu TatuChat eta instalatu aplikazioa\n2. Eman izena edo hasi saioa\n3. Ireki gonbidapen-esteka:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -666,7 +666,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 Mezu berria FluffyChaten", "newMessageInFluffyChat": "💬 Mezu berria TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2477,7 +2477,7 @@
"identityServer": "Identitate-zerbitzaria:", "identityServer": "Identitate-zerbitzaria:",
"signIn": "Hasi saioa", "signIn": "Hasi saioa",
"createNewAccount": "Sortu kontu berria", "createNewAccount": "Sortu kontu berria",
"signUpGreeting": "FluffyChat deszentralizatua da! Hautatu zure kontua zein zerbitzaritan sortu nahi duzun, eta hasi erabiltzen!", "signUpGreeting": "TatuChat deszentralizatua da! Hautatu zure kontua zein zerbitzaritan sortu nahi duzun, eta hasi erabiltzen!",
"signInGreeting": "Baduzu dagoeneko Matrix kontu bat? Ongi etorri berriro ere! Hautatu zure zerbitzaria eta hasi saioa.", "signInGreeting": "Baduzu dagoeneko Matrix kontu bat? Ongi etorri berriro ere! Hautatu zure zerbitzaria eta hasi saioa.",
"theProcessWasCanceled": "Eragiketa bertan behera utzi da.", "theProcessWasCanceled": "Eragiketa bertan behera utzi da.",
"join": "Batu", "join": "Batu",
@@ -2497,7 +2497,7 @@
}, },
"createNewChat": "Sortu txat berria", "createNewChat": "Sortu txat berria",
"reset": "Berrezarri", "reset": "Berrezarri",
"supportFluffyChat": "Eman babesa FluffyChat-i", "supportFluffyChat": "Eman babesa TatuChat-i",
"support": "Lagundu", "support": "Lagundu",
"setLowPriority": "Ezarri lehentasun baxua", "setLowPriority": "Ezarri lehentasun baxua",
"unsetLowPriority": "Kendu lehentasun baxua", "unsetLowPriority": "Kendu lehentasun baxua",
@@ -2514,7 +2514,7 @@
"showMore": "Erakutsi gehiago", "showMore": "Erakutsi gehiago",
"showLess": "Erakutsi gutxiago", "showLess": "Erakutsi gutxiago",
"hideRoomsInSpaces": "Ezkutatu gune batean dauden gelak", "hideRoomsInSpaces": "Ezkutatu gune batean dauden gelak",
"possibleByYou": "Bertsio hau zure laguntzari esker izan da posible. FluffyChat-ek doakoa, kode irekikoa eta guztiz komunitarioa izaten jarraitzen du.", "possibleByYou": "Bertsio hau zure laguntzari esker izan da posible. TatuChat-ek doakoa, kode irekikoa eta guztiz komunitarioa izaten jarraitzen du.",
"showThumbnailsInTimeline": "Erakutsi irudi eta bideoen iruditxoa", "showThumbnailsInTimeline": "Erakutsi irudi eta bideoen iruditxoa",
"appSubtitle": "[matrix] komunikazio segurua", "appSubtitle": "[matrix] komunikazio segurua",
"appDescription": "Komunikatu [matrix] sare deszentralizatuaren bidez, era zifratuan, mundu guztiarentzat modu erraz eta eskuragarrian.", "appDescription": "Komunikatu [matrix] sare deszentralizatuaren bidez, era zifratuan, mundu guztiarentzat modu erraz eta eskuragarrian.",

View File

@@ -1337,7 +1337,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} شما را به فلافی‌چت دعوت کرد.\n۱. به fluffychat.im بروید و برنامه را نصب کنید\n۲. ثبت‌نام کنید یا وارد شوید\n۳. پیوند دعوت را باز کنید:\n {link}", "inviteText": "{username} شما را به فلافی‌چت دعوت کرد.\n۱. به TatuChat بروید و برنامه را نصب کنید\n۲. ثبت‌نام کنید یا وارد شوید\n۳. پیوند دعوت را باز کنید:\n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -1,6 +1,6 @@
{ {
"repeatPassword": "Salasana uudelleen", "repeatPassword": "Salasana uudelleen",
"about": "Tietoa FluffyChatista", "about": "Tietoa TatuChat",
"@about": { "@about": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -638,7 +638,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} kutsui sinut FluffyChattiin.\n1. Viereaile sivulla: https://fluffychat.im ja asenna sovellus\n2. Rekisteröidy tai kirjaudu sisään\n3. Avaa kutsulinkki:\n{link}", "inviteText": "{username} kutsui sinut TatuChat.\n1. Viereaile sivulla: TatuChat ja asenna sovellus\n2. Rekisteröidy tai kirjaudu sisään\n3. Avaa kutsulinkki:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -815,7 +815,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} vous a invité·e sur FluffyChat.\n1. Visiter fluffychat.im et installer l'application\n2. Inscrivez-vous ou connectez-vous\n3. Ouvrez le lien d'invitation :\n{link}", "inviteText": "{username} vous a invité·e sur TatuChat.\n1. Visiter TatuChat et installer l'application\n2. Inscrivez-vous ou connectez-vous\n3. Ouvrez le lien d'invitation :\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -972,7 +972,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "💬 Nouveau message dans FluffyChat", "newMessageInFluffyChat": "💬 Nouveau message dans TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2317,7 +2317,7 @@
"notificationRuleIsUserMentionDescription": "Notifie l'utilisateur/trice lorsqu'il est mentionné directement dans un message.", "notificationRuleIsUserMentionDescription": "Notifie l'utilisateur/trice lorsqu'il est mentionné directement dans un message.",
"notificationRuleServerAcl": "Retire les Évènements ACL du Serveur", "notificationRuleServerAcl": "Retire les Évènements ACL du Serveur",
"advancedConfigurations": "Configurations avancées", "advancedConfigurations": "Configurations avancées",
"signUpGreeting": "FluffyChat est décentralisé ! Selectionnez un hôte sur lequel vous voulez créer un compte et c'est parti !", "signUpGreeting": "TatuChat est décentralisé ! Selectionnez un hôte sur lequel vous voulez créer un compte et c'est parti !",
"notificationRuleCall": "Appeler", "notificationRuleCall": "Appeler",
"baseUrl": "URL racine", "baseUrl": "URL racine",
"pause": "Pause", "pause": "Pause",
@@ -2487,7 +2487,7 @@
"approve": "Approuver", "approve": "Approuver",
"notificationRuleRoomnotifDescription": "Notifie l'utilisateur/trice lorsqu'un message contient '@room'.", "notificationRuleRoomnotifDescription": "Notifie l'utilisateur/trice lorsqu'un message contient '@room'.",
"generalNotificationSettings": "Réglages généraux des notifications", "generalNotificationSettings": "Réglages généraux des notifications",
"supportFluffyChat": "Soutenir FluffyChat", "supportFluffyChat": "Soutenir TatuChat",
"notificationRuleEncrypted": "Chiffré", "notificationRuleEncrypted": "Chiffré",
"pleaseFillOut": "Veuillez remplir", "pleaseFillOut": "Veuillez remplir",
"changedTheChatName": "{username} a changé le nom de la discussion", "changedTheChatName": "{username} a changé le nom de la discussion",
@@ -2508,7 +2508,7 @@
"showMore": "Voir plus", "showMore": "Voir plus",
"showLess": "Voir moins", "showLess": "Voir moins",
"hideRoomsInSpaces": "Cacher les salons qui sont dans un espace", "hideRoomsInSpaces": "Cacher les salons qui sont dans un espace",
"possibleByYou": "Cette mise à jour a été possible uniquement grâce à votre support. FluffyChat restera gratuit, open-source et entièrement communautaire.", "possibleByYou": "Cette mise à jour a été possible uniquement grâce à votre support. TatuChat restera gratuit, open-source et entièrement communautaire.",
"showThumbnailsInTimeline": "Afficher les apperçus des images et vidéos", "showThumbnailsInTimeline": "Afficher les apperçus des images et vidéos",
"appSubtitle": "Communication [matrix] Sécurisée", "appSubtitle": "Communication [matrix] Sécurisée",
"appDescription": "Communiquez de façon chiffrée sur le réseau décentralisé [matrix] de façon aisée et accessible pour tous.", "appDescription": "Communiquez de façon chiffrée sur le réseau décentralisé [matrix] de façon aisée et accessible pour tous.",
@@ -2590,7 +2590,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newPassphraseDescription": "FluffyChat utilise le chiffrement de bout en bout. Pour ne pas perdre vos messages, veuillez choisir une phrase de passe forte pour sécuriser votre profile crypto et votre sauvegarde chiffrée des messages.", "newPassphraseDescription": "TatuChat utilise le chiffrement de bout en bout. Pour ne pas perdre vos messages, veuillez choisir une phrase de passe forte pour sécuriser votre profile crypto et votre sauvegarde chiffrée des messages.",
"@newPassphraseDescription": { "@newPassphraseDescription": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}

View File

@@ -999,7 +999,7 @@
"placeholders": {} "placeholders": {}
}, },
"scanQrCode": "Scan cód QR", "scanQrCode": "Scan cód QR",
"inviteText": "Thug {username} cuireadh duit chuig FluffyChat.\n1. Tabhair cuairt ar fluffychat.im agus a shuiteáil an app\n2. Cláraigh nó sínigh isteach\n3. Oscail an nasc cuirí:\n {link}", "inviteText": "Thug {username} cuireadh duit chuig FluffyChat.\n1. Tabhair cuairt ar tatuchat.weltonmoura.com.br/home/ agus a shuiteáil an app\n2. Cláraigh nó sínigh isteach\n3. Oscail an nasc cuirí:\n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -814,7 +814,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} convidoute a FluffyChat.\n1. Visita fluffychat.im e instala a app\n2. Crea unha conta ou Accede\n3. Abre a ligazón do convite: \n {link}", "inviteText": "{username} convidoute a FluffyChat.\n1. Visita tatuchat.weltonmoura.com.br/home/ e instala a app\n2. Crea unha conta ou Accede\n3. Abre a ligazón do convite: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -619,7 +619,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} הזמין אותך ל-FluffyChat.\n1. התקן את FluffyChat: https://fluffychat.im\n2. הירשם או היכנס\n3. פתח את קישור ההזמנה: {link}", "inviteText": "{username} הזמין אותך ל-FluffyChat.\n1. התקן את FluffyChat: https://tatuchat.weltonmoura.com.br/home/\n2. הירשם או היכנס\n3. פתח את קישור ההזמנה: {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -800,7 +800,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} te je pozvao/la u FluffyChat. \n1. Posjeti strnicu fluffychat.im i instaliraj aplikaciju \n2. Registriraj ili prijavi se \n3. Otvori poveznicu poziva: \n {link}", "inviteText": "{username} te je pozvao/la u FluffyChat. \n1. Posjeti strnicu tatuchat.weltonmoura.com.br/home/ i instaliraj aplikaciju \n2. Registriraj ili prijavi se \n3. Otvori poveznicu poziva: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -569,7 +569,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} meghívta a FluffyChat-be.\n1. Keresse fel a fluffychat.im oldalt, és telepítse az alkalmazást \n2. Regisztráljon vagy jelentkezzen be \n3. Nyissa meg a meghívó linket: \n {link}", "inviteText": "{username} meghívta a FluffyChat-be.\n1. Keresse fel a tatuchat.weltonmoura.com.br/home/ oldalt, és telepítse az alkalmazást \n2. Regisztráljon vagy jelentkezzen be \n3. Nyissa meg a meghívó linket: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -88,7 +88,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} mengundang kamu ke FluffyChat. \n1. Kunjungi fluffychat.im dan instal aplikasi\n2. Daftar atau masuk \n3. Buka tautan undangan: \n {link}", "inviteText": "{username} mengundang kamu ke FluffyChat. \n1. Kunjungi tatuchat.weltonmoura.com.br/home/ dan instal aplikasi\n2. Daftar atau masuk \n3. Buka tautan undangan: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -690,7 +690,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} ti ha invitato/a a FluffyChat.\n1. Visita fluffychat.im e installa l'applicazione\n2. Iscriviti o accedi\n3. Apri il collegamento di invito: \n {link}", "inviteText": "{username} ti ha invitato/a a FluffyChat.\n1. Visita tatuchat.weltonmoura.com.br/home/ e installa l'applicazione\n2. Iscriviti o accedi\n3. Apri il collegamento di invito: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -697,7 +697,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username}があなたをFluffyChatに招待しました。\n1. FluffyChatをインストール: fluffychat.im \n2. アカウントの作成、またはサインインを行う\n3. 招待リンクを開く\n {link}", "inviteText": "{username}があなたをFluffyChatに招待しました。\n1. FluffyChatをインストール: tatuchat.weltonmoura.com.br/home/ \n2. アカウントの作成、またはサインインを行う\n3. 招待リンクを開く\n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -1139,7 +1139,7 @@
} }
}, },
"noChatDescriptionYet": "Ulac aglam n udiwenni i d-yenulfan yakan.", "noChatDescriptionYet": "Ulac aglam n udiwenni i d-yenulfan yakan.",
"inviteText": "{username} yeɛreḍ-ik·m ɣer FluffyChat.\n1. Rzu ɣer fluffychat.im syin sbedd asnas \n2. Jerred neɣ kcem \n3. Ldi aseɣwen n tinubga: \n {link}", "inviteText": "{username} yeɛreḍ-ik·m ɣer FluffyChat.\n1. Rzu ɣer tatuchat.weltonmoura.com.br/home/ syin sbedd asnas \n2. Jerred neɣ kcem \n3. Ldi aseɣwen n tinubga: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -1493,7 +1493,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username}님이 당신을 FluffyChat에 초대했습니다.\n1. FluffyChat 설치: https://fluffychat.im \n2. 가입하거나 로그인 \n3. 초대 링크 열기: \n {link}", "inviteText": "{username}님이 당신을 FluffyChat에 초대했습니다.\n1. FluffyChat 설치: https://tatuchat.weltonmoura.com.br/home/ \n2. 가입하거나 로그인 \n3. 초대 링크 열기: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -1461,7 +1461,7 @@
} }
} }
}, },
"inviteText": "{username} pakvietė jus prisijungti prie FluffyChat. \n1. Įdiekite FluffyChat: https://fluffychat.im \n2. Prisiregistruokite arba prisijunkite \n3. Atidarykite pakvietimo nuorodą: {link}", "inviteText": "{username} pakvietė jus prisijungti prie FluffyChat. \n1. Įdiekite FluffyChat: https://tatuchat.weltonmoura.com.br/home/ \n2. Prisiregistruokite arba prisijunkite \n3. Atidarykite pakvietimo nuorodą: {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -515,7 +515,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} uzaicināja pievienoties FluffyChat.\n1. Jāapmeklē fluffychat.im un jāuzstāda lietotne \n2. Jāizveido konts vai jāpiesakās \n3. Jāatver uzaicinājuma saite: \n {link}", "inviteText": "{username} uzaicināja pievienoties FluffyChat.\n1. Jāapmeklē tatuchat.weltonmoura.com.br/home/ un jāuzstāda lietotne \n2. Jāizveido konts vai jāpiesakās \n3. Jāatver uzaicinājuma saite: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -663,7 +663,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} har invitert deg til FluffyChat. \n1. Installer FluffyChat: https://fluffychat.im \n2. Registrer deg eller logg inn \n3. Åpne invitasjonslenken: \n {link}", "inviteText": "{username} har invitert deg til FluffyChat. \n1. Installer FluffyChat: https://tatuchat.weltonmoura.com.br/home/ \n2. Registrer deg eller logg inn \n3. Åpne invitasjonslenken: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -814,7 +814,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} heeft je uitgenodigd voor FluffyChat.\n1. Bezoek https://fluffychat.im en installeer de app\n2. Registreer of log in\n3. Open deze uitnodigingslink:\n{link}", "inviteText": "{username} heeft je uitgenodigd voor FluffyChat.\n1. Bezoek https://tatuchat.weltonmoura.com.br/home/ en installeer de app\n2. Registreer of log in\n3. Open deze uitnodigingslink:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -726,7 +726,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} zaprosił/-a Cię do FluffyChat.\n1. Odwiedź fluffychat.im i zainstaluj aplikację\n2. Zarejestuj się lub zaloguj\n3. Otwórz link zaproszenia:\n{link}", "inviteText": "{username} zaprosił/-a Cię do FluffyChat.\n1. Odwiedź tatuchat.weltonmoura.com.br/home/ i zainstaluj aplikację\n2. Zarejestuj się lub zaloguj\n3. Otwórz link zaproszenia:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -2043,5 +2043,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"areYouSureDeletePost": "Eliminar" "areYouSureDeletePost": "Eliminar",
"softenThemeColor": "Suavizar cor do tema",
"softenThemeColorSubtitle": "Usa uma paleta suave do Material 3 derivada da cor escolhida em vez da cor exata."
} }

View File

@@ -563,6 +563,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"developer": "Desenvolvedor",
"devices": "Dispositivos", "devices": "Dispositivos",
"@devices": { "@devices": {
"type": "String", "type": "String",
@@ -672,6 +673,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"environmentVariables": "Variáveis e ambiente",
"errorObtainingLocation": "Erro ao obter localização: {error}", "errorObtainingLocation": "Erro ao obter localização: {error}",
"@errorObtainingLocation": { "@errorObtainingLocation": {
"type": "String", "type": "String",
@@ -892,6 +894,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"licence": "Licença",
"lightTheme": "Claro", "lightTheme": "Claro",
"@lightTheme": { "@lightTheme": {
"type": "String", "type": "String",
@@ -1875,9 +1878,9 @@
"tryAgain": "Tentar novamente", "tryAgain": "Tentar novamente",
"unbanUserDescription": "O usuário poderá entrar novamente na conversa, caso tente.", "unbanUserDescription": "O usuário poderá entrar novamente na conversa, caso tente.",
"messagesStyle": "Mensagens:", "messagesStyle": "Mensagens:",
"newSpaceDescription": "Os espaços permitem que você consolide suas conversas e construa comunidades públicas ou privadas.", "newSpaceDescription": "Os Espaços permitem que você consolide suas conversas e construa comunidades públicas ou privadas.",
"newCanalDescription": "O canal é uma sala onde somente administradores podem publicar. Use-o para transmitir comunicados oficiais.", "newCanalDescription": "O Canal é uma sala onde somente administradores podem publicar. Use-o para transmitir comunicados oficiais.",
"newMuralDescription": "O mural é um quadro de avisos onde todos podem publicar. Use-o para deixar recados para a sua comunidade.", "newMuralDescription": "O Mural é um sala onde você pode publicar sua fotos e vídeos para a comunidade ver, ou apenas seus amigos.",
"chatDescription": "Descrição da conversa", "chatDescription": "Descrição da conversa",
"encryptThisChat": "Criptografar esta conversa", "encryptThisChat": "Criptografar esta conversa",
"reopenChat": "Reabrir conversa", "reopenChat": "Reabrir conversa",
@@ -1898,7 +1901,7 @@
}, },
"fileIsTooBigForServer": "Não foi possível enviar! O servidor suporta anexos somente até {max}.", "fileIsTooBigForServer": "Não foi possível enviar! O servidor suporta anexos somente até {max}.",
"readUpToHere": "Lido até aqui", "readUpToHere": "Lido até aqui",
"optionalRedactReason": "(Opcional) Motivo para apagar esta mensagem.", "optionalRedactReason": "Por que você está apagando?",
"archiveRoomDescription": "A conversa será movida para o arquivo. Outros usuários verão que você deixou a conversa.", "archiveRoomDescription": "A conversa será movida para o arquivo. Outros usuários verão que você deixou a conversa.",
"redactedByBecause": "Apagado por {username}, pois: \"{reason}\"", "redactedByBecause": "Apagado por {username}, pois: \"{reason}\"",
"@redactedByBecause": { "@redactedByBecause": {
@@ -1921,7 +1924,7 @@
} }
} }
}, },
"redactMessageDescription": "A mensagem será apagada para todos os participantes desta conversa. Isto não poderá ser desfeito.", "redactMessageDescription": "A mensagem será apagada para todos nessa conversa. Isto não poderá ser desfeito.",
"invalidInput": "Entrada inválida!", "invalidInput": "Entrada inválida!",
"report": "relatar", "report": "relatar",
"hasKnocked": "🚪 {user} bateu na porta", "hasKnocked": "🚪 {user} bateu na porta",
@@ -1974,6 +1977,7 @@
"createCanalAndInviteUsers": "Criar um canal e convidar pessoas", "createCanalAndInviteUsers": "Criar um canal e convidar pessoas",
"createMuralAndInviteUsers": "Criar um mural e convidar pessoas", "createMuralAndInviteUsers": "Criar um mural e convidar pessoas",
"mural": "Mural", "mural": "Mural",
"menu": "Menu",
"muralIsPublic": "O mural é público", "muralIsPublic": "O mural é público",
"muralName": "Nome do mural", "muralName": "Nome do mural",
"noBackupWarning": "Atenção! Se não ativar o backup de conversas, você perderá acesso a suas mensagens criptografadas. É altamente recomendável ativar o backup antes de sair.", "noBackupWarning": "Atenção! Se não ativar o backup de conversas, você perderá acesso a suas mensagens criptografadas. É altamente recomendável ativar o backup antes de sair.",
@@ -1986,7 +1990,7 @@
"blockedUsers": "Usuários bloqueados", "blockedUsers": "Usuários bloqueados",
"passwordIsWrong": "A senha digitada está incorreta", "passwordIsWrong": "A senha digitada está incorreta",
"pleaseEnterYourCurrentPassword": "Digite sua senha atual", "pleaseEnterYourCurrentPassword": "Digite sua senha atual",
"groupCanBeFoundViaSearch": "Grupos podem ser encontrados por pesquisa", "groupCanBeFoundViaSearch": "Sala pode ser encontrada na pesquisa",
"noUsersFoundWithQuery": "Infelizmente, não foi encontrado usuário com \"{query}\". Verifique se digitou corretamente.", "noUsersFoundWithQuery": "Infelizmente, não foi encontrado usuário com \"{query}\". Verifique se digitou corretamente.",
"@noUsersFoundWithQuery": { "@noUsersFoundWithQuery": {
"type": "String", "type": "String",
@@ -2006,7 +2010,7 @@
"select": "Selecionar", "select": "Selecionar",
"pleaseChooseAStrongPassword": "Escolha uma senha forte", "pleaseChooseAStrongPassword": "Escolha uma senha forte",
"blockUsername": "Ignorar nome de usuário", "blockUsername": "Ignorar nome de usuário",
"addChatOrSubSpace": "Adicionar conversa ou subespaço", "addChatOrSubSpace": "Criar grupo aqui",
"groupName": "Nome do grupo", "groupName": "Nome do grupo",
"leaveEmptyToClearStatus": "Deixe em branco para limpar seu estado.", "leaveEmptyToClearStatus": "Deixe em branco para limpar seu estado.",
"joinSpace": "Entrar no espaço", "joinSpace": "Entrar no espaço",
@@ -2343,11 +2347,11 @@
} }
} }
}, },
"swipeRightToLeftToReply": "Deslizar da direita pra esquerda para responder", "swipeRightToLeftToReply": "Deslizar da esquerda pra direita para responder",
"verifiedDevicesOnly": "Somente dispositivos verificados", "verifiedDevicesOnly": "Somente dispositivos verificados",
"boldText": "Texto em negrito", "boldText": "Texto em negrito",
"recordAVideo": "Gravar um vídeo", "recordAVideo": "Gravar um vídeo",
"optionalMessage": "(Opcional) mensagem...", "optionalMessage": "Comentar...",
"notSupportedOnThisDevice": "Não há suporte neste dispositivo", "notSupportedOnThisDevice": "Não há suporte neste dispositivo",
"commandHint_roomupgrade": "Atualizar esta sala para a versão de sala especificada", "commandHint_roomupgrade": "Atualizar esta sala para a versão de sala especificada",
"noMoreChatsFound": "Mais nenhuma conversa foi encontrada...", "noMoreChatsFound": "Mais nenhuma conversa foi encontrada...",
@@ -2401,6 +2405,16 @@
} }
} }
}, },
"countFollowers": "{count, plural, =0{0 inscritos} =1{1 inscrito} other{{count} inscritos}}",
"@countFollowers": {
"type": "String",
"placeholders": {
"count": {
"type": "int"
}
}
},
"by": "por",
"spaceMemberOf": "Membro do espaço de {spaces}", "spaceMemberOf": "Membro do espaço de {spaces}",
"@spaceMemberOf": { "@spaceMemberOf": {
"type": "String", "type": "String",
@@ -2498,7 +2512,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"muralsComingSoon": "Murais em breve", "muralsComingSoon": "Nenhum mural por aqui",
"@muralsComingSoon": { "@muralsComingSoon": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -2570,7 +2584,7 @@
}, },
"areYouSureDeletePost": "Apagar", "areYouSureDeletePost": "Apagar",
"accountsAndSettings": "Contas e configurações", "accountsAndSettings": "Contas e configurações",
"addTag": "Adicionar etiqueta", "addTag": "Adicionar tag",
"advancedConfigs": "Configurações avançadas", "advancedConfigs": "Configurações avançadas",
"advancedConfigurations": "Configurações avançadas", "advancedConfigurations": "Configurações avançadas",
"appDescription": "Comunique-se com criptografia na rede descentralizada [matrix], de forma simples e acessível para todos.", "appDescription": "Comunique-se com criptografia na rede descentralizada [matrix], de forma simples e acessível para todos.",
@@ -2603,7 +2617,7 @@
}, },
"createNewAccount": "Criar nova conta", "createNewAccount": "Criar nova conta",
"createNewChat": "Criar nova conversa", "createNewChat": "Criar nova conversa",
"createNewTag": "Criar nova etiqueta", "createNewTag": "Criar nova tag",
"crop": "Cortar", "crop": "Cortar",
"decline": "Recusar", "decline": "Recusar",
"deviceIdentityKey": "Chave de identidade do dispositivo", "deviceIdentityKey": "Chave de identidade do dispositivo",
@@ -2698,7 +2712,7 @@
"raiseHand": "Levantar a mão", "raiseHand": "Levantar a mão",
"removeAdminRights": "Remover direitos de administrador", "removeAdminRights": "Remover direitos de administrador",
"removeModeratorRights": "Remover direitos de moderador", "removeModeratorRights": "Remover direitos de moderador",
"removeTag": "Remover etiqueta", "removeTag": "Remover tag",
"repeatPassphrase": "Repita a frase secreta", "repeatPassphrase": "Repita a frase secreta",
"reset": "Redefinir", "reset": "Redefinir",
"resetAccount": "Redefinir conta", "resetAccount": "Redefinir conta",
@@ -2756,7 +2770,7 @@
"storeRecoveryKeyDescription": "Anote sua chave de recuperação para poder restaurar suas mensagens criptografadas e sua identidade criptográfica.", "storeRecoveryKeyDescription": "Anote sua chave de recuperação para poder restaurar suas mensagens criptografadas e sua identidade criptográfica.",
"support": "Suporte", "support": "Suporte",
"supportFluffyChat": "Apoie o TatuChat", "supportFluffyChat": "Apoie o TatuChat",
"tagName": "Nome da etiqueta", "tagName": "Nome da tag",
"theProcessWasCanceled": "O processo foi cancelado.", "theProcessWasCanceled": "O processo foi cancelado.",
"today": "Hoje", "today": "Hoje",
"toggleCamera": "Alternar câmera", "toggleCamera": "Alternar câmera",

View File

@@ -761,7 +761,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} convidou-te para o FluffyChat.\n1. Instala o FluffyChat: https://fluffychat.im\n2. Regista-te ou inicia sessão.\n3. Abre a ligação de convite: {link}", "inviteText": "{username} convidou-te para o TatuChat.\n1. Instala o TatuChat: https://tatuchat.weltonmoura.com.br. Regista-te ou inicia sessão.\n3. Abre a ligação de convite: {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {
@@ -918,7 +918,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"newMessageInFluffyChat": "Nova mensagem no FluffyChat", "newMessageInFluffyChat": "Nova mensagem no TatuChat",
"@newMessageInFluffyChat": { "@newMessageInFluffyChat": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -938,7 +938,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"noConnectionToTheServer": "Nenhuma ligação ao servidor", "noConnectionToTheServer": "Sem conexão com o servidor",
"@noConnectionToTheServer": { "@noConnectionToTheServer": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -953,7 +953,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"noGoogleServicesWarning": "Parece que não tens nenhuns serviços da Google no seu telemóvel. É uma boa decisão para a sua privacidade! Para receber notificações instantâneas no FluffyChat, recomendamos que uses https://microg.org/ ou https://unifiedpush.org/.", "noGoogleServicesWarning": "Parece que não tens nenhuns serviços da Google no seu telemóvel. É uma boa decisão para a sua privacidade! Para receber notificações instantâneas no TatuChat, recomendamos que uses https://microg.org/ ou https://unifiedpush.org/.",
"@noGoogleServicesWarning": { "@noGoogleServicesWarning": {
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
@@ -1819,7 +1819,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"swipeRightToLeftToReply": "Deslize da direita para a esquerda para responder", "swipeRightToLeftToReply": "Deslize da esquerda para a direita para responder",
"doNotShowAgain": "Não mostrar novamente", "doNotShowAgain": "Não mostrar novamente",
"report": "reportar", "report": "reportar",
"status": "Estado", "status": "Estado",

View File

@@ -714,7 +714,7 @@
} }
} }
}, },
"inviteText": "{username} v-a invitat la FluffyChat.\n1. Instalați FluffyChat: https://fluffychat.im\n2. Înregistrați-vă sau conectați-vă\n3. Deschideți invitația: {link}", "inviteText": "{username} v-a invitat la FluffyChat.\n1. Instalați FluffyChat: https://tatuchat.weltonmoura.com.br/home/\n2. Înregistrați-vă sau conectați-vă\n3. Deschideți invitația: {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -814,7 +814,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} пригласил(а) вас в FluffyChat. \n1. Посетите https://fluffychat.im и установите приложение \n2. Зарегистрируйтесь или войдите \n3. Откройте ссылку приглашения: \n {link}", "inviteText": "{username} пригласил(а) вас в FluffyChat. \n1. Посетите https://tatuchat.weltonmoura.com.br/home/ и установите приложение \n2. Зарегистрируйтесь или войдите \n3. Откройте ссылку приглашения: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -516,7 +516,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} vás pozval na FluffyChat.\n1. Nainštalujte si FluffyChat: https://fluffychat.im\n2. Zaregistrujte sa alebo sa prihláste\n3. Otvorte odkaz na pozvánku: {link}", "inviteText": "{username} vás pozval na FluffyChat.\n1. Nainštalujte si FluffyChat: https://tatuchat.weltonmoura.com.br/home/\n2. Zaregistrujte sa alebo sa prihláste\n3. Otvorte odkaz na pozvánku: {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -766,7 +766,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} вас позива у FluffyChat. \n1. Инсталирајте FluffyChat: https://fluffychat.im \n2. Региструјте се или пријавите \n3. Отворите везу позивнице: {link}", "inviteText": "{username} вас позива у FluffyChat. \n1. Инсталирајте FluffyChat: https://tatuchat.weltonmoura.com.br/home/ \n2. Региструјте се или пријавите \n3. Отворите везу позивнице: {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -648,7 +648,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} bjöd in dig till FluffyChat.\n1. Besök fluffychat.im och installera appen\n2. Registrera dig eller logga in\n3. Öppna inbjudningslänk:\n {link}", "inviteText": "{username} bjöd in dig till FluffyChat.\n1. Besök tatuchat.weltonmoura.com.br/home/ och installera appen\n2. Registrera dig eller logga in\n3. Öppna inbjudningslänk:\n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -815,7 +815,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} sizi FluffyChat'e davet etti.\n1. fluffychat.im adresini ziyaret edin ve uygulamayı kurun \n2. Kaydolun veya oturum açın \n3. Davet bağlantısını açın: \n {link}", "inviteText": "{username} sizi FluffyChat'e davet etti.\n1. tatuchat.weltonmoura.com.br/home/ adresini ziyaret edin ve uygulamayı kurun \n2. Kaydolun veya oturum açın \n3. Davet bağlantısını açın: \n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -534,7 +534,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} запрошує вас у FluffyChat. \n1. Перейдіть на fluffychat.im й установіть застосунок \n2. Зареєструйтесь або ввійдіть \n3. Відкрийте запрошувальне посилання:\n {link}", "inviteText": "{username} запрошує вас у FluffyChat. \n1. Перейдіть на tatuchat.weltonmoura.com.br/home/ й установіть застосунок \n2. Зареєструйтесь або ввійдіть \n3. Відкрийте запрошувальне посилання:\n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -844,7 +844,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} sizni FluffyChat’ga taklif qildi.\n1. fluffychat.im saytiga tashrif buyuring va ilovani oʻrnating.\n2. Roʻyxatdan oʻting yoki tizimga kiring.\n3. Taklif havolasini oching:\n{link}", "inviteText": "{username} sizni FluffyChat’ga taklif qildi.\n1. tatuchat.weltonmoura.com.br/home/ saytiga tashrif buyuring va ilovani oʻrnating.\n2. Roʻyxatdan oʻting yoki tizimga kiring.\n3. Taklif havolasini oching:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -786,7 +786,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} 邀请你使用 FluffyChat。 \n1. 安装 FluffyChat:https://fluffychat.im \n2. 注册或登录 \n3. 打开邀请链接:\n {link}", "inviteText": "{username} 邀请你使用 FluffyChat。 \n1. 安装 FluffyChat:https://tatuchat.weltonmoura.com.br/home/ \n2. 注册或登录 \n3. 打开邀请链接:\n {link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

View File

@@ -685,7 +685,7 @@
"type": "String", "type": "String",
"placeholders": {} "placeholders": {}
}, },
"inviteText": "{username} 邀請您使用 FluffyChat\n1. 安裝 FluffyChat:https://fluffychat.im\n2. 登入或註冊\n3. 打開該邀請網址:\n{link}", "inviteText": "{username} 邀請您使用 FluffyChat\n1. 安裝 FluffyChat:https://tatuchat.weltonmoura.com.br/home/\n2. 登入或註冊\n3. 打開該邀請網址:\n{link}",
"@inviteText": { "@inviteText": {
"type": "String", "type": "String",
"placeholders": { "placeholders": {

129
lib/pages/apps/apps.dart Normal file
View File

@@ -0,0 +1,129 @@
// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'dart:convert';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http;
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart';
import 'package:tatchat/config/miniapp_config.dart';
import 'package:tatchat/config/setting_keys.dart';
import 'package:tatchat/utils/miniapp_meta.dart';
import 'package:tatchat/utils/miniapp_store.dart';
import 'package:tatchat/widgets/matrix.dart';
import 'apps_view.dart';
class Apps extends StatefulWidget {
const Apps({super.key});
@override
AppsController createState() => AppsController();
}
class AppsController extends State<Apps> {
Client get client => Matrix.of(context).client;
Future<void> installMiniApp(String appId) async {
await client.installMiniApp(appId);
if (!mounted) return;
setState(() {});
}
Future<void> uninstallMiniApp(String appId) async {
await client.uninstallMiniApp(appId);
if (!mounted) return;
setState(() {});
}
/// Lets the user pick a `.html` file from their device and imports it as a
/// custom mini app.
Future<void> importMiniAppFromFile() async {
final file = await FilePicker.pickFile(
type: FileType.custom,
allowedExtensions: ['html', 'htm'],
);
if (file == null) return;
final bytes = await file.readAsBytes();
await _importHtml(html: _decodeBytes(bytes));
if (!mounted) return;
setState(() {});
}
/// Fetches an HTML document from [url] and imports it as a custom mini app.
///
/// On web, the browser enforces CORS, so fetching a page that does not send
/// `Access-Control-Allow-Origin` fails with a `ClientException`. In that case
/// we transparently retry through a CORS proxy (if configured) so the import
/// still works.
Future<void> importMiniAppFromUrl(String url) async {
if (url.trim().isEmpty) return;
final response = await _fetchViaCorsProxy(Uri.parse(url));
if (response.statusCode != 200) {
throw Exception('${response.statusCode} ${response.reasonPhrase}');
}
await _importHtml(html: response.body);
if (!mounted) return;
setState(() {});
}
/// Fetches [url]. On web, if the initial request fails (usually because the
/// target server lacks CORS headers), retries through the configured CORS
/// proxy. Returns the successful response or rethrows the last error.
Future<http.Response> _fetchViaCorsProxy(Uri uri) async {
try {
final response = await http.get(uri);
if (response.statusCode == 200) return response;
// Non-200 (e.g. 404): fall through to the proxy only for CORS errors.
if (!kIsWeb) return response;
} catch (e) {
if (!kIsWeb) rethrow;
Logs().w('Direct download failed, trying CORS proxy', e);
}
final proxy = AppSettings.miniAppCorsProxy.value;
if (kIsWeb && proxy.isNotEmpty) {
final separator = proxy.contains('?') ? '&' : '?';
final proxied = await http.get(Uri.parse('$proxy$separator$uri'));
if (proxied.statusCode == 200) return proxied;
throw Exception('${proxied.statusCode} ${proxied.reasonPhrase}');
}
throw Exception(
'The server does not allow cross-origin requests (CORS). '
'Import the file manually or set a CORS proxy in the settings.',
);
}
String _decodeBytes(List<int> bytes) {
for (final encoding in const [utf8, latin1]) {
try {
return encoding.decode(bytes);
} catch (_) {}
}
return latin1.decode(bytes, allowInvalid: true);
}
/// Reads the mini app manifest from the meta tags of [html], validates it
/// and installs the app. The manifest `id` is used as the account data key.
///
/// Throws a [FormatException] when the document lacks the required meta
/// tags, or an [Exception] when the id is already taken.
Future<void> _importHtml({required String html}) async {
final meta = parseMiniAppMeta(html);
if (availableMiniApps.any((app) => app.id == meta.id)) {
throw Exception(
'The mini app id "${meta.id}" is reserved and cannot be reused',
);
}
if (client.isMiniAppInstalled(meta.id)) {
throw Exception('A mini app with id "${meta.id}" is already installed');
}
await client.importMiniApp(meta: meta, html: html);
}
@override
Widget build(BuildContext context) => AppsView(this);
}

View File

@@ -0,0 +1,289 @@
// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'dart:convert';
import 'package:go_router/go_router.dart';
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart';
import 'package:tatchat/config/miniapp_config.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/pages/apps/apps.dart';
import 'package:tatchat/utils/miniapp_store.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_text_input_dialog.dart';
import 'package:tatchat/widgets/layouts/max_width_body.dart';
class AppsView extends StatelessWidget {
final AppsController controller;
const AppsView(this.controller, {super.key});
@override
Widget build(BuildContext context) {
final installed = controller.client.installedMiniApps;
final installedApps = installedMiniAppConfigs(controller.client);
final availableApps = availableMiniApps
.where((app) => !installed.contains(app.id))
.toList();
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context).apps),
backgroundColor: Theme.of(context).colorScheme.surface,
surfaceTintColor: Colors.transparent,
actions: [
PopupMenuButton<_ImportAction>(
icon: const Icon(Icons.add_box_outlined),
tooltip: L10n.of(context).importApp,
onSelected: (action) async {
switch (action) {
case _ImportAction.file:
try {
await controller.importMiniAppFromFile();
if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context).appImported)),
);
} catch (e, s) {
Logs().e('Failed to import mini app', e, s);
if (!context.mounted) return;
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text(e.toString())));
}
case _ImportAction.url:
final url = await showTextInputDialog(
context: context,
title: L10n.of(context).importFromUrl,
okLabel: L10n.of(context).importApp,
);
if (url == null || url.trim().isEmpty) break;
try {
await controller.importMiniAppFromUrl(url);
if (!context.mounted) return;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context).appImported)),
);
} catch (e, s) {
Logs().e('Failed to import mini app', e, s);
if (!context.mounted) return;
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text(e.toString())));
}
}
},
itemBuilder: (context) => [
PopupMenuItem(
value: _ImportAction.file,
child: Row(
children: [
const Icon(Icons.upload_file_outlined),
const SizedBox(width: 12),
Text(L10n.of(context).importFromFile),
],
),
),
PopupMenuItem(
value: _ImportAction.url,
child: Row(
children: [
const Icon(Icons.link),
const SizedBox(width: 12),
Text(L10n.of(context).importFromUrl),
],
),
),
],
),
],
),
body: MaxWidthBody(
withScrolling: false,
child: ListView(
padding: const EdgeInsets.all(16),
children: [
if (installedApps.isNotEmpty) ...[
_SectionHeader(L10n.of(context).installedApps),
for (final app in installedApps)
_AppCard(
app: app,
onTap: () => context.go('/rooms/apps/${app.id}'),
trailing: [
_AppCardMenu(
onUninstall: () => controller.uninstallMiniApp(app.id),
),
],
),
],
if (availableApps.isNotEmpty) ...[
_SectionHeader(L10n.of(context).availableApps),
for (final app in availableApps)
_AppCard(
app: app,
onTap: null,
trailing: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: TextButton(
onPressed: () => controller.installMiniApp(app.id),
child: Text(L10n.of(context).install),
),
),
],
),
],
],
),
),
);
}
}
enum _ImportAction { file, url }
class _SectionHeader extends StatelessWidget {
final String text;
const _SectionHeader(this.text);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 8, bottom: 4),
child: Text(text, style: Theme.of(context).textTheme.titleSmall),
);
}
}
class _AppCard extends StatelessWidget {
final MiniAppConfig app;
final VoidCallback? onTap;
final List<Widget> trailing;
const _AppCard({required this.app, required this.trailing, this.onTap});
@override
Widget build(BuildContext context) {
final category = app.category?.trim() ?? '';
final description = app.description?.trim() ?? '';
final subtitle = [
if (category.isNotEmpty) category,
if (description.isNotEmpty) description,
].join(' · ');
final name = miniAppName(context, app);
return Card(
margin: const EdgeInsets.symmetric(vertical: 4),
child: ListTile(
onTap: onTap,
leading: _Logo(logo: app.logo, color: app.color, name: name),
title: Text(name),
subtitle: subtitle.isEmpty
? null
: Text(
subtitle,
maxLines: 3,
overflow: TextOverflow.ellipsis,
),
trailing: Row(mainAxisSize: MainAxisSize.min, children: trailing),
),
);
}
}
enum _AppMenuAction { uninstall }
/// Trailing three-dot menu of an installed app. Uninstalling asks for
/// confirmation before it is executed.
class _AppCardMenu extends StatelessWidget {
final VoidCallback onUninstall;
const _AppCardMenu({required this.onUninstall});
@override
Widget build(BuildContext context) {
return PopupMenuButton<_AppMenuAction>(
icon: const Icon(Icons.more_vert),
tooltip: L10n.of(context).moreOptions,
onSelected: (action) async {
switch (action) {
case _AppMenuAction.uninstall:
final result = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).uninstallApp,
message: L10n.of(context).uninstallAppConfirm,
okLabel: L10n.of(context).uninstall,
isDestructive: true,
);
if (result == OkCancelResult.ok) onUninstall();
}
},
itemBuilder: (context) => [
PopupMenuItem<_AppMenuAction>(
value: _AppMenuAction.uninstall,
child: Row(
children: [
Icon(
Icons.delete_outline,
color: Theme.of(context).colorScheme.error,
),
const SizedBox(width: 12),
Text(L10n.of(context).uninstall),
],
),
),
],
);
}
}
/// Shows the logo declared by the mini app (data URI or http(s) URL), falling
/// back to the initial letter of the app name when no usable logo is
/// available.
class _Logo extends StatelessWidget {
final String? logo;
final Color color;
final String name;
const _Logo({required this.logo, required this.color, required this.name});
@override
Widget build(BuildContext context) {
final value = logo?.trim() ?? '';
Widget? image;
if (value.startsWith('data:image/')) {
final comma = value.indexOf(',');
if (comma != -1 && value.substring(0, comma).contains('base64')) {
try {
final bytes = base64Decode(value.substring(comma + 1));
image = ClipOval(
child: Image.memory(
bytes,
width: 48,
height: 48,
fit: BoxFit.cover,
),
);
} catch (_) {}
}
} else if (value.startsWith('http://') || value.startsWith('https://')) {
image = ClipOval(
child: Image.network(value, width: 48, height: 48, fit: BoxFit.cover),
);
}
if (image != null) return CircleAvatar(radius: 24, child: image);
final initial = name.trim().isEmpty ? '?' : name.trim()[0].toUpperCase();
return CircleAvatar(
radius: 24,
backgroundColor: color.withValues(alpha: .15),
foregroundColor: color,
child: Text(
initial,
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w600),
),
);
}
}

View File

@@ -0,0 +1,117 @@
// SPDX-FileCopyrightText: 2026 TatuChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:flutter/services.dart';
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart';
import 'package:tatchat/config/miniapp_config.dart';
import 'package:tatchat/utils/miniapp_bridge.dart';
import 'package:tatchat/widgets/matrix.dart';
import 'miniapp_shell_stub.dart'
if (dart.library.js_interop) 'miniapp_shell_web.dart'
if (dart.library.ffi) 'miniapp_shell_native.dart';
/// Generic page that renders a mini app. The mini app is a self-contained HTML
/// document that talks to the TatuChat client through the [MiniappBridge]
/// protocol (see `assets/miniapps/`).
class MiniAppPage extends StatefulWidget {
final String appId;
const MiniAppPage({super.key, required this.appId});
@override
State<MiniAppPage> createState() => _MiniAppPageState();
}
class _MiniAppPageState extends State<MiniAppPage> {
Client get client => Matrix.of(context).client;
MiniAppConfig? _config;
String? _html;
bool _notFound = false;
@override
void initState() {
super.initState();
_load();
}
Future<void> _load() async {
final config = resolveMiniAppConfig(client, widget.appId);
if (config == null) {
if (!mounted) return;
setState(() => _notFound = true);
return;
}
if (config.htmlAsset != null) {
final html = await rootBundle.loadString(config.htmlAsset!);
if (!mounted) return;
setState(() {
_config = config;
_html = html;
});
return;
}
// Imported app: the HTML source lives in the account data store.
if (!mounted) return;
setState(() {
_config = config;
_html = config.html;
});
}
/// Entry point of the bridge: called by the web view/iframe with a request
/// coming from the mini app's JavaScript.
Future<Map<String, Object?>> handleRequest(Map<String, dynamic> request) {
final scheme = Theme.of(context).colorScheme;
final brightness = Theme.of(context).brightness;
return MiniappBridge.handleRequest(
client,
widget.appId,
request,
palette: MiniappBridge.buildPalette(scheme, brightness),
);
}
@override
Widget build(BuildContext context) {
final themeColorScheme = Theme.of(context).colorScheme;
if (_notFound) {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(widget.appId),
backgroundColor: themeColorScheme.surface,
surfaceTintColor: Colors.transparent,
foregroundColor: themeColorScheme.onSurface,
),
body: const Center(child: Text('App not found')),
);
}
final html = _html;
final config = _config;
if (html == null || config == null) {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(_config?.name ?? _config?.id ?? widget.appId),
backgroundColor: themeColorScheme.surface,
surfaceTintColor: Colors.transparent,
foregroundColor: themeColorScheme.onSurface,
),
body: const Center(
child: CircularProgressIndicator.adaptive(strokeWidth: 2),
),
);
}
return MiniAppShell(
key: ValueKey(widget.appId),
html: html,
appId: widget.appId,
title: config.name ?? config.id,
onRequest: handleRequest,
);
}
}

View File

@@ -0,0 +1,110 @@
// SPDX-FileCopyrightText: 2026 TatuChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:material_ui/material_ui.dart';
import 'package:tatchat/l10n/l10n.dart';
/// Native implementation of [MiniAppShell] using an isolated [InAppWebView].
///
/// The mini app HTML is shipped with a small bridge shim injected before
/// `</body>` that forwards `window.parent.postMessage` calls to Dart through
/// `flutter_inappwebview`'s JavaScript handler, and delivers the response
/// back to the mini app via a `postMessage` with the same `requestId`.
class MiniAppShell extends StatefulWidget {
final String html;
final String appId;
final String title;
final Future<Map<String, Object?>> Function(Map<String, dynamic> request)
onRequest;
const MiniAppShell({
super.key,
required this.html,
required this.appId,
required this.title,
required this.onRequest,
});
@override
State<MiniAppShell> createState() => _MiniAppShellState();
}
class _MiniAppShellState extends State<MiniAppShell> {
static const String _handlerName = 'com.tatuchat.miniapp.bridge';
InAppWebViewController? _webViewController;
String get _injectedHtml {
const shim =
'''
<script>
window.addEventListener('message', function (event) {
var msg = event.data;
if (!msg || msg.api !== 'fromMiniApp' || msg.response !== undefined) return;
window.flutter_inappwebview.callHandler('$_handlerName', msg).then(function (response) {
var reply = Object.assign({}, msg, { response: response });
window.postMessage(reply, '*');
});
});
</script>
''';
final bodyEnd = widget.html.lastIndexOf('</body>');
if (bodyEnd == -1) {
return '${widget.html}\n$shim';
}
return widget.html.replaceRange(bodyEnd, bodyEnd, '\n$shim');
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
backgroundColor: theme.colorScheme.surface,
surfaceTintColor: Colors.transparent,
foregroundColor: theme.colorScheme.onSurface,
actions: [
IconButton(
tooltip: L10n.of(context).refresh,
icon: const Icon(Icons.refresh_rounded),
onPressed: () => _webViewController?.reload(),
),
],
),
backgroundColor: theme.colorScheme.surface,
body: InAppWebView(
initialSettings: InAppWebViewSettings(
javaScriptEnabled: true,
javaScriptCanOpenWindowsAutomatically: false,
domStorageEnabled: true,
transparentBackground: false,
verticalScrollBarEnabled: true,
horizontalScrollBarEnabled: false,
),
initialData: InAppWebViewInitialData(
data: _injectedHtml,
mimeType: 'text/html',
encoding: 'utf8',
baseUrl: WebUri('https://tatuchat.local'),
),
onWebViewCreated: (controller) {
_webViewController = controller;
controller.addJavaScriptHandler(
handlerName: _handlerName,
callback: (args) async {
if (args.isEmpty) return null;
final raw = args.first;
if (raw is Map<String, dynamic>) {
return widget.onRequest(Map<String, dynamic>.from(raw));
}
return null;
},
);
},
),
);
}
}

View File

@@ -0,0 +1,28 @@
// SPDX-FileCopyrightText: 2026 TatuChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:flutter/widgets.dart';
/// Fallback used when neither `dart.library.js_interop` nor `dart.library.ffi`
/// is available. It should never be selected on a supported platform.
class MiniAppShell extends StatelessWidget {
final String html;
final String appId;
final String title;
final Future<Map<String, Object?>> Function(Map<String, dynamic> request)
onRequest;
const MiniAppShell({
super.key,
required this.html,
required this.appId,
required this.title,
required this.onRequest,
});
@override
Widget build(BuildContext context) => throw UnsupportedError(
'MiniAppShell is not implemented for this platform',
);
}

View File

@@ -0,0 +1,150 @@
// SPDX-FileCopyrightText: 2026 TatuChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'dart:js_interop';
import 'dart:ui_web' as ui_web;
import 'package:material_ui/material_ui.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/utils/miniapp_bridge.dart';
import 'package:web/web.dart' as web;
/// Web implementation of [MiniAppShell] rendering the mini app into a sandboxed
/// iframe.
///
/// The mini app talks to TatuChat through `postMessage`. This widget listens on
/// `window` for `fromMiniApp` requests, forwards them to the Dart bridge and
/// posts the response back to the iframe's `contentWindow`.
class MiniAppShell extends StatefulWidget {
final String html;
final String appId;
final String title;
final Future<Map<String, Object?>> Function(Map<String, dynamic> request)
onRequest;
const MiniAppShell({
super.key,
required this.html,
required this.appId,
required this.title,
required this.onRequest,
});
@override
State<MiniAppShell> createState() => _MiniAppShellState();
}
class _MiniAppShellState extends State<MiniAppShell> {
static int _viewTypeCounter = 0;
late final String _viewType;
web.HTMLIFrameElement? _iframe;
web.HTMLDivElement? _frameElement;
JSFunction? _messageListener;
@override
void initState() {
super.initState();
_viewType = 'tatchat-miniapp-${_viewTypeCounter++}';
ui_web.platformViewRegistry.registerViewFactory(
_viewType,
(int viewId) => _createElement(),
);
final messageListener = _onMessage.toJS;
_messageListener = messageListener;
web.window.addEventListener('message', messageListener);
}
@override
void dispose() {
final listener = _messageListener;
if (listener != null) {
web.window.removeEventListener('message', listener);
}
super.dispose();
}
web.HTMLIFrameElement _buildIframe() {
final iframe =
web.document.createElement('iframe') as web.HTMLIFrameElement;
iframe.style
..width = '100%'
..height = '100%'
..border = 'none';
iframe.setAttribute(
'sandbox',
'allow-scripts allow-forms allow-same-origin',
);
iframe.setAttribute('srcdoc', widget.html);
return iframe;
}
web.HTMLElement _createElement() {
final div = web.document.createElement('div') as web.HTMLDivElement;
div.style
..width = '100%'
..height = '100%'
..margin = '0'
..padding = '0';
final iframe = _buildIframe();
div.append(iframe);
_iframe = iframe;
_frameElement = div;
return div;
}
void _reload() {
final div = _frameElement;
if (div == null) return;
_iframe?.remove();
final iframe = _buildIframe();
div.append(iframe);
_iframe = iframe;
}
void _onMessage(web.Event event) {
if (!event.isA<web.MessageEvent>()) return;
final messageEvent = event as web.MessageEvent;
final data = messageEvent.data?.dartify();
if (data is! Map) return;
final request = Map<String, dynamic>.from(data);
if (request['api'] != MiniappBridge.api) return;
final iframeWindow = _iframe?.contentWindow;
if (iframeWindow == null) return;
final requestId = request['requestId'];
final widgetId = request['widgetId'];
widget.onRequest(request).then((result) {
iframeWindow.postMessage(
{
'api': MiniappBridge.api,
'widgetId': widgetId,
'requestId': requestId,
'response': result,
}.jsify(),
'*'.toJS,
);
});
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
backgroundColor: theme.colorScheme.surface,
surfaceTintColor: Colors.transparent,
foregroundColor: theme.colorScheme.onSurface,
actions: [
IconButton(
tooltip: L10n.of(context).refresh,
icon: const Icon(Icons.refresh_rounded),
onPressed: _reload,
),
],
),
backgroundColor: theme.colorScheme.surface,
body: HtmlElementView(viewType: _viewType),
);
}
}

View File

@@ -10,11 +10,14 @@ import 'package:collection/collection.dart';
import 'package:desktop_drop/desktop_drop.dart'; import 'package:desktop_drop/desktop_drop.dart';
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart'; import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
import 'package:file_picker/file_picker.dart'; import 'package:file_picker/file_picker.dart';
import 'package:html/parser.dart' show parseFragment;
import 'package:markdown/markdown.dart' show ExtensionSet, markdownToHtml;
import 'package:tatchat/config/setting_keys.dart'; import 'package:tatchat/config/setting_keys.dart';
import 'package:tatchat/config/themes.dart'; import 'package:tatchat/config/themes.dart';
import 'package:tatchat/l10n/l10n.dart'; import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/pages/chat/chat_view.dart'; import 'package:tatchat/pages/chat/chat_view.dart';
import 'package:tatchat/pages/chat/event_info_dialog.dart'; import 'package:tatchat/pages/chat/event_info_dialog.dart';
import 'package:tatchat/pages/chat/edit_media_caption_dialog.dart';
import 'package:tatchat/pages/chat/start_poll_bottom_sheet.dart'; import 'package:tatchat/pages/chat/start_poll_bottom_sheet.dart';
import 'package:tatchat/pages/chat/trust_user_key_dialog.dart'; import 'package:tatchat/pages/chat/trust_user_key_dialog.dart';
import 'package:tatchat/pages/chat/utils/web_file_to_x_file.dart'; import 'package:tatchat/pages/chat/utils/web_file_to_x_file.dart';
@@ -201,6 +204,8 @@ class ChatController extends State<ChatPageWithRoom>
bool showEmojiPicker = false; bool showEmojiPicker = false;
bool showAttachmentPicker = false;
String? get threadLastEventId { String? get threadLastEventId {
final threadId = activeThreadId; final threadId = activeThreadId;
if (threadId == null) return null; if (threadId == null) return null;
@@ -975,18 +980,40 @@ class ChatController extends State<ChatPageWithRoom>
setState(() => showEmojiPicker = false); setState(() => showEmojiPicker = false);
} }
void hideAttachmentPicker() {
setState(() => showAttachmentPicker = false);
}
void emojiPickerAction() { void emojiPickerAction() {
if (showEmojiPicker) { if (showEmojiPicker) {
inputFocus.requestFocus(); inputFocus.requestFocus();
} else { } else {
inputFocus.unfocus(); inputFocus.unfocus();
} }
setState(() => showEmojiPicker = !showEmojiPicker); setState(() {
showEmojiPicker = !showEmojiPicker;
showAttachmentPicker = false;
});
}
void attachmentPickerAction() {
if (showAttachmentPicker) {
inputFocus.requestFocus();
} else {
inputFocus.unfocus();
}
setState(() {
showAttachmentPicker = !showAttachmentPicker;
showEmojiPicker = false;
});
} }
void _inputFocusListener() { void _inputFocusListener() {
if (showEmojiPicker && inputFocus.hasFocus) { if ((showEmojiPicker || showAttachmentPicker) && inputFocus.hasFocus) {
setState(() => showEmojiPicker = false); setState(() {
showEmojiPicker = false;
showAttachmentPicker = false;
});
} }
} }
@@ -1013,6 +1040,7 @@ class ChatController extends State<ChatPageWithRoom>
Clipboard.setData(ClipboardData(text: _getSelectedEventString())); Clipboard.setData(ClipboardData(text: _getSelectedEventString()));
setState(() { setState(() {
showEmojiPicker = false; showEmojiPicker = false;
showAttachmentPicker = false;
selectedEvents.clear(); selectedEvents.clear();
}); });
} }
@@ -1041,6 +1069,7 @@ class ChatController extends State<ChatPageWithRoom>
if (!mounted) return; if (!mounted) return;
setState(() { setState(() {
showEmojiPicker = false; showEmojiPicker = false;
showAttachmentPicker = false;
selectedEvents.clear(); selectedEvents.clear();
}); });
scaffoldMessenger.showSnackBar( scaffoldMessenger.showSnackBar(
@@ -1117,6 +1146,7 @@ class ChatController extends State<ChatPageWithRoom>
); );
setState(() { setState(() {
showEmojiPicker = false; showEmojiPicker = false;
showAttachmentPicker = false;
selectedEvents.clear(); selectedEvents.clear();
}); });
} }
@@ -1302,6 +1332,7 @@ class ChatController extends State<ChatPageWithRoom>
void clearSelectedEvents() => setState(() { void clearSelectedEvents() => setState(() {
selectedEvents.clear(); selectedEvents.clear();
showEmojiPicker = false; showEmojiPicker = false;
showAttachmentPicker = false;
}); });
void clearSingleSelectedEvent() { void clearSingleSelectedEvent() {
@@ -1314,6 +1345,16 @@ class ChatController extends State<ChatPageWithRoom>
final timeline = this.timeline; final timeline = this.timeline;
if (timeline == null) return; if (timeline == null) return;
if (const {
MessageTypes.Image,
MessageTypes.Video,
MessageTypes.Audio,
MessageTypes.File,
}.contains(event.messageType)) {
_startEditingMediaCaption(event, clearSelection: clearSelection);
return;
}
final client = currentRoomBundle.firstWhere( final client = currentRoomBundle.firstWhere(
(c) => c?.userID == event.senderId, (c) => c?.userID == event.senderId,
orElse: () => null, orElse: () => null,
@@ -1336,6 +1377,33 @@ class ChatController extends State<ChatPageWithRoom>
inputFocus.requestFocus(); inputFocus.requestFocus();
} }
Future<void> _startEditingMediaCaption(
Event event, {
bool clearSelection = false,
}) async {
final timeline = this.timeline;
if (timeline == null) return;
if (clearSelection) setState(() => selectedEvents.clear());
final caption = event.getDisplayEvent(timeline).body;
final result = await showEditMediaCaptionDialog(
context,
initialCaption: caption,
);
if (result == null) return;
final html = markdownToHtml(
result,
extensionSet: ExtensionSet.gitHubFlavored,
);
final content = Map<String, Object?>.of(event.content)
..remove('m.relates_to')
..['body'] = result;
if (parseFragment(html).text != result) {
content['format'] = 'org.matrix.custom.html';
content['formatted_body'] = html;
}
await room.sendEvent(content, editEventId: event.eventId);
}
void editSelectedEventAction() { void editSelectedEventAction() {
_startEditingEvent(selectedEvents.first, clearSelection: true); _startEditingEvent(selectedEvents.first, clearSelection: true);
} }

View File

@@ -0,0 +1,168 @@
// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:tatchat/config/themes.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/pages/chat/chat.dart';
import 'package:tatchat/utils/platform_infos.dart';
import 'package:material_ui/material_ui.dart';
class ChatAttachmentPicker extends StatelessWidget {
final ChatController controller;
const ChatAttachmentPicker(this.controller, {super.key});
static const double _itemSpacing = 8;
static const double _handleSize = 4;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final l10n = L10n.of(context);
final mobile = PlatformInfos.isMobile;
final items = <(IconData, String, AddPopupMenuActions)>[
if (mobile)
(
Icons.gps_fixed_outlined,
l10n.shareLocation,
AddPopupMenuActions.location,
),
(Icons.poll_outlined, l10n.startPoll, AddPopupMenuActions.poll),
if (mobile)
(
Icons.videocam_outlined,
l10n.recordAVideo,
AddPopupMenuActions.videoCamera,
),
if (mobile)
(
Icons.camera_alt_outlined,
l10n.takeAPhoto,
AddPopupMenuActions.photoCamera,
),
(Icons.image_outlined, l10n.openGallery, AddPopupMenuActions.media),
(Icons.attachment_outlined, l10n.sendFile, AddPopupMenuActions.file),
];
if (items.isEmpty) return const SizedBox.shrink();
final rows = <List<(IconData, String, AddPopupMenuActions)>>[];
for (var i = 0; i < items.length; i += 3) {
rows.add(items.sublist(i, i + 3 > items.length ? items.length : i + 3));
}
return ClipRRect(
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
child: AnimatedSize(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
alignment: Alignment.bottomCenter,
child: controller.showAttachmentPicker
? Material(
color: theme.colorScheme.surfaceContainer,
child: Padding(
padding: const EdgeInsets.fromLTRB(12, 6, 12, 12),
child: Column(
mainAxisSize: .min,
children: [
Container(
width: 32,
height: _handleSize,
decoration: BoxDecoration(
color: theme.colorScheme.outlineVariant,
borderRadius: BorderRadius.circular(_handleSize / 2),
),
),
const SizedBox(height: 12),
Column(
mainAxisSize: .min,
children: [
for (final (i, row) in rows.indexed) ...[
if (i > 0) const SizedBox(height: _itemSpacing),
Row(
children: [
for (final item in row) ...[
if (row.indexOf(item) > 0)
const SizedBox(width: _itemSpacing),
Expanded(
child: AspectRatio(
aspectRatio: 1,
child: _AttachmentItem(
icon: item.$1,
label: item.$2,
onTap: () {
controller.hideAttachmentPicker();
controller
.onAddPopupMenuButtonSelected(
item.$3,
);
},
),
),
),
],
if (row.length < 3)
for (var i = 0; i < 3 - row.length; i++) ...[
const SizedBox(width: _itemSpacing),
const Expanded(child: SizedBox()),
],
],
),
],
],
),
],
),
),
)
: const SizedBox.shrink(),
),
);
}
}
class _AttachmentItem extends StatelessWidget {
final IconData icon;
final String label;
final VoidCallback onTap;
const _AttachmentItem({
required this.icon,
required this.label,
required this.onTap,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Material(
color: theme.colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(20),
clipBehavior: Clip.hardEdge,
child: InkWell(
onTap: onTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(icon, size: 30, color: theme.colorScheme.onSecondaryContainer),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Text(
label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: theme.textTheme.labelMedium?.copyWith(
color: theme.colorScheme.onSecondaryContainer,
),
),
),
],
),
),
);
}
}

View File

@@ -13,7 +13,6 @@ import 'package:tatchat/pages/chat/encryption_info.dart';
import 'package:tatchat/pages/chat/events/message.dart'; import 'package:tatchat/pages/chat/events/message.dart';
import 'package:tatchat/pages/chat/seen_by_row.dart'; import 'package:tatchat/pages/chat/seen_by_row.dart';
import 'package:tatchat/pages/chat/typing_indicators.dart'; import 'package:tatchat/pages/chat/typing_indicators.dart';
import 'package:tatchat/utils/account_config.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart'; import 'package:tatchat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
import 'package:tatchat/utils/platform_infos.dart'; import 'package:tatchat/utils/platform_infos.dart';
import 'package:material_ui/material_ui.dart'; import 'package:material_ui/material_ui.dart';
@@ -53,8 +52,7 @@ class ChatEventList extends StatelessWidget {
thisEventsKeyMap[events[i].eventId] = i; thisEventsKeyMap[events[i].eventId] = i;
} }
final hasWallpaper = const hasWallpaper = true;
controller.room.client.applicationAccountConfig.wallpaperUrl != null;
return SelectionArea( return SelectionArea(
child: MediaQuery( child: MediaQuery(

View File

@@ -141,102 +141,10 @@ class ChatInputRow extends StatelessWidget {
alignment: Alignment.center, alignment: Alignment.center,
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
child: PopupMenuButton<AddPopupMenuActions>( child: IconButton(
useRootNavigator: true,
icon: const Icon(Icons.add_circle_outline), icon: const Icon(Icons.add_circle_outline),
iconColor: theme.colorScheme.onPrimaryContainer, color: theme.colorScheme.onPrimaryContainer,
onSelected: controller.onAddPopupMenuButtonSelected, onPressed: controller.attachmentPickerAction,
itemBuilder: (BuildContext context) => [
if (PlatformInfos.isMobile)
PopupMenuItem(
value: AddPopupMenuActions.location,
child: ListTile(
leading: CircleAvatar(
backgroundColor:
theme.colorScheme.onPrimaryContainer,
foregroundColor:
theme.colorScheme.primaryContainer,
child: const Icon(Icons.gps_fixed_outlined),
),
title: Text(L10n.of(context).shareLocation),
contentPadding: const EdgeInsets.all(0),
),
),
PopupMenuItem(
value: AddPopupMenuActions.poll,
child: ListTile(
leading: CircleAvatar(
backgroundColor:
theme.colorScheme.onPrimaryContainer,
foregroundColor:
theme.colorScheme.primaryContainer,
child: const Icon(Icons.poll_outlined),
),
title: Text(L10n.of(context).startPoll),
contentPadding: const EdgeInsets.all(0),
),
),
PopupMenuDivider(),
if (PlatformInfos.isMobile) ...[
PopupMenuItem(
value: AddPopupMenuActions.videoCamera,
child: ListTile(
leading: CircleAvatar(
backgroundColor:
theme.colorScheme.onPrimaryContainer,
foregroundColor:
theme.colorScheme.primaryContainer,
child: const Icon(Icons.videocam_outlined),
),
title: Text(L10n.of(context).recordAVideo),
contentPadding: const EdgeInsets.all(0),
),
),
PopupMenuItem(
value: AddPopupMenuActions.photoCamera,
child: ListTile(
leading: CircleAvatar(
backgroundColor:
theme.colorScheme.onPrimaryContainer,
foregroundColor:
theme.colorScheme.primaryContainer,
child: const Icon(Icons.camera_alt_outlined),
),
title: Text(L10n.of(context).takeAPhoto),
contentPadding: const EdgeInsets.all(0),
),
),
PopupMenuDivider(),
],
PopupMenuItem(
value: AddPopupMenuActions.media,
child: ListTile(
leading: CircleAvatar(
backgroundColor:
theme.colorScheme.onPrimaryContainer,
foregroundColor:
theme.colorScheme.primaryContainer,
child: const Icon(Icons.image_outlined),
),
title: Text(L10n.of(context).openGallery),
contentPadding: const EdgeInsets.all(0),
),
),
PopupMenuItem(
value: AddPopupMenuActions.file,
child: ListTile(
leading: CircleAvatar(
backgroundColor:
theme.colorScheme.onPrimaryContainer,
foregroundColor:
theme.colorScheme.primaryContainer,
child: const Icon(Icons.attachment_outlined),
),
title: Text(L10n.of(context).sendFile),
contentPadding: const EdgeInsets.all(0),
),
),
],
), ),
), ),
Container( Container(

View File

@@ -27,6 +27,7 @@ import 'package:matrix/matrix.dart';
import '../../utils/matrix_sdk_extensions/room_extension.dart'; import '../../utils/matrix_sdk_extensions/room_extension.dart';
import '../../utils/stream_extension.dart'; import '../../utils/stream_extension.dart';
import 'chat_attachment_picker.dart';
import 'chat_emoji_picker.dart'; import 'chat_emoji_picker.dart';
import 'chat_input_row.dart'; import 'chat_input_row.dart';
@@ -57,6 +58,7 @@ class ChatView extends StatelessWidget {
canPop: canPop:
controller.selectedEvents.isEmpty && controller.selectedEvents.isEmpty &&
!controller.showEmojiPicker && !controller.showEmojiPicker &&
!controller.showAttachmentPicker &&
controller.activeThreadId == null, controller.activeThreadId == null,
onPopInvokedWithResult: (pop, _) async { onPopInvokedWithResult: (pop, _) async {
if (pop) return; if (pop) return;
@@ -64,6 +66,8 @@ class ChatView extends StatelessWidget {
controller.clearSelectedEvents(); controller.clearSelectedEvents();
} else if (controller.showEmojiPicker) { } else if (controller.showEmojiPicker) {
controller.emojiPickerAction(); controller.emojiPickerAction();
} else if (controller.showAttachmentPicker) {
controller.attachmentPickerAction();
} else if (controller.activeThreadId != null) { } else if (controller.activeThreadId != null) {
controller.closeThread(); controller.closeThread();
} }
@@ -104,8 +108,9 @@ class ChatView extends StatelessWidget {
backgroundColor: controller.selectedEvents.isEmpty backgroundColor: controller.selectedEvents.isEmpty
? controller.activeThreadId != null ? controller.activeThreadId != null
? theme.colorScheme.secondaryContainer ? theme.colorScheme.secondaryContainer
: theme.colorScheme.surface.withAlpha(240) : theme.colorScheme.surface
: theme.colorScheme.tertiaryContainer, : theme.colorScheme.tertiaryContainer,
surfaceTintColor: Colors.transparent,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
leading: controller.selectMode leading: controller.selectMode
? IconButton( ? IconButton(
@@ -347,22 +352,35 @@ class ChatView extends StatelessWidget {
top: false, top: false,
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
if (accountConfig.wallpaperUrl != null)
Opacity( Opacity(
opacity: accountConfig.wallpaperOpacity ?? 0.5, opacity: accountConfig.wallpaperUrl != null
? accountConfig.wallpaperOpacity ?? 0.5
: 0.3,
child: ImageFiltered( child: ImageFiltered(
imageFilter: ui.ImageFilter.blur( imageFilter: ui.ImageFilter.blur(
sigmaX: accountConfig.wallpaperBlur ?? 0.0, sigmaX: accountConfig.wallpaperUrl != null
sigmaY: accountConfig.wallpaperBlur ?? 0.0, ? accountConfig.wallpaperBlur ?? 0.0
: 0.0,
sigmaY: accountConfig.wallpaperUrl != null
? accountConfig.wallpaperBlur ?? 0.0
: 0.0,
), ),
child: MxcImage( child: accountConfig.wallpaperUrl != null
cacheKey: accountConfig.wallpaperUrl.toString(), ? MxcImage(
cacheKey: accountConfig.wallpaperUrl
.toString(),
uri: accountConfig.wallpaperUrl, uri: accountConfig.wallpaperUrl,
fit: BoxFit.cover, fit: BoxFit.cover,
height: MediaQuery.sizeOf(context).height, height: MediaQuery.sizeOf(context).height,
width: MediaQuery.sizeOf(context).width, width: MediaQuery.sizeOf(context).width,
isThumbnail: false, isThumbnail: false,
placeholder: (_) => Container(), placeholder: (_) => Container(),
)
: Image.asset(
'assets/logo/background.png',
fit: BoxFit.cover,
height: MediaQuery.sizeOf(context).height,
width: MediaQuery.sizeOf(context).width,
), ),
), ),
), ),
@@ -472,6 +490,9 @@ class ChatView extends StatelessWidget {
children: [ children: [
ReplyDisplay(controller), ReplyDisplay(controller),
ChatInputRow(controller), ChatInputRow(controller),
ChatAttachmentPicker(
controller,
),
ChatEmojiPicker(controller), ChatEmojiPicker(controller),
], ],
), ),

View File

@@ -0,0 +1,86 @@
// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:material_ui/material_ui.dart';
import 'package:tatchat/config/setting_keys.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/utils/platform_infos.dart';
import 'package:tatchat/widgets/adaptive_dialogs/adaptive_dialog_action.dart';
import 'package:tatchat/widgets/adaptive_dialogs/dialog_text_field.dart';
Future<String?> showEditMediaCaptionDialog(
BuildContext context, {
required String initialCaption,
}) => showDialog<String>(
context: context,
builder: (context) => EditMediaCaptionDialog(initialCaption: initialCaption),
);
class EditMediaCaptionDialog extends StatefulWidget {
final String initialCaption;
const EditMediaCaptionDialog({super.key, required this.initialCaption});
@override
State<EditMediaCaptionDialog> createState() => _EditMediaCaptionDialogState();
}
class _EditMediaCaptionDialogState extends State<EditMediaCaptionDialog> {
late final TextEditingController _controller = TextEditingController(
text: widget.initialCaption,
);
late final FocusNode _focusNode = FocusNode();
@override
void dispose() {
_focusNode.dispose();
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final isMobile = PlatformInfos.isMobile;
final l10n = L10n.of(context);
return AlertDialog.adaptive(
title: Text(l10n.editCaption),
insetPadding: isMobile
? const EdgeInsets.all(8.0)
: const EdgeInsets.symmetric(horizontal: 40, vertical: 24),
constraints: isMobile
? const BoxConstraints(
maxWidth: double.infinity,
maxHeight: double.infinity,
)
: null,
content: SizedBox(
width: 512,
height: isMobile ? MediaQuery.sizeOf(context).height * 0.7 : null,
child: DialogTextField(
controller: _controller,
focusNode: _focusNode,
hintText: l10n.captionHint,
labelText: l10n.optionalMessage,
keyboardType: TextInputType.multiline,
minLines: isMobile ? 8 : 3,
maxLines: isMobile ? null : 8,
maxLength: AppSettings.textMessageMaxLength.value,
counterText: '',
),
),
actions: [
AdaptiveDialogAction(
onPressed: () => Navigator.of(context).pop(),
child: Text(l10n.cancel),
),
AdaptiveDialogAction(
autofocus: true,
onPressed: () => Navigator.of(context).pop(_controller.text.trim()),
child: Text(l10n.save),
),
],
);
}
}

View File

@@ -8,11 +8,11 @@ import 'package:tatchat/config/setting_keys.dart';
import 'package:tatchat/utils/file_description.dart'; import 'package:tatchat/utils/file_description.dart';
import 'package:tatchat/utils/url_launcher.dart'; import 'package:tatchat/utils/url_launcher.dart';
import 'package:tatchat/widgets/mxc_image.dart'; import 'package:tatchat/widgets/mxc_image.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:material_ui/material_ui.dart'; import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import '../../../widgets/blur_hash.dart'; import '../../../widgets/blur_hash.dart';
import 'html_message.dart';
class ImageBubble extends StatelessWidget { class ImageBubble extends StatelessWidget {
final Event event; final Event event;
@@ -48,8 +48,6 @@ class ImageBubble extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context);
var borderRadius = var borderRadius =
this.borderRadius ?? BorderRadius.circular(AppConfig.borderRadius); this.borderRadius ?? BorderRadius.circular(AppConfig.borderRadius);
@@ -70,14 +68,7 @@ class ImageBubble extends StatelessWidget {
Material( Material(
color: Colors.transparent, color: Colors.transparent,
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: borderRadius),
borderRadius: borderRadius,
side: BorderSide(
color: event.messageType == MessageTypes.Sticker
? Colors.transparent
: theme.dividerColor,
),
),
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap,
borderRadius: borderRadius, borderRadius: borderRadius,
@@ -121,14 +112,13 @@ class ImageBubble extends StatelessWidget {
width: width, width: width,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Linkify( child: HtmlMessage(
text: fileDescription, html: event.isRichMessage
textScaleFactor: MediaQuery.textScalerOf(context).scale(1), ? event.formattedText
style: TextStyle( : fileDescription,
color: textColor, room: event.room,
textColor: textColor,
fontSize: AppConfig.messageFontSize, fontSize: AppConfig.messageFontSize,
),
options: const LinkifyOptions(humanize: false),
linkStyle: TextStyle( linkStyle: TextStyle(
color: linkColor, color: linkColor,
fontSize: AppConfig.messageFontSize, fontSize: AppConfig.messageFontSize,

View File

@@ -22,9 +22,9 @@ class MapBubble extends StatelessWidget {
const MapBubble({ const MapBubble({
required this.latitude, required this.latitude,
required this.longitude, required this.longitude,
this.zoom = 14.0, this.zoom = 16.0,
this.width = 400, this.width = 350,
this.height = 400, this.height = 350,
this.radius = 10.0, this.radius = 10.0,
this.onTap, this.onTap,
super.key, super.key,

View File

@@ -14,10 +14,12 @@ import 'package:tatchat/utils/adaptive_bottom_sheet.dart';
import 'package:tatchat/utils/date_time_extension.dart'; import 'package:tatchat/utils/date_time_extension.dart';
import 'package:tatchat/utils/file_description.dart'; import 'package:tatchat/utils/file_description.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/matrix_locals.dart'; import 'package:tatchat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:tatchat/utils/show_scaffold_dialog.dart';
import 'package:tatchat/utils/string_color.dart'; import 'package:tatchat/utils/string_color.dart';
import 'package:tatchat/widgets/avatar.dart'; import 'package:tatchat/widgets/avatar.dart';
import 'package:tatchat/widgets/matrix.dart'; import 'package:tatchat/widgets/matrix.dart';
import 'package:tatchat/widgets/member_actions_popup_menu_button.dart'; import 'package:tatchat/widgets/member_actions_popup_menu_button.dart';
import 'package:tatchat/widgets/share_scaffold_dialog.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:material_ui/material_ui.dart'; import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
@@ -247,8 +249,8 @@ class Message extends StatelessWidget {
child: Center(child: Icon(Icons.check_outlined)), child: Center(child: Icon(Icons.check_outlined)),
), ),
direction: AppSettings.swipeRightToLeftToReply.value direction: AppSettings.swipeRightToLeftToReply.value
? SwipeDirection.endToStart ? SwipeDirection.startToEnd
: SwipeDirection.startToEnd, : SwipeDirection.endToStart,
onSwipe: (_) => onSwipe(), onSwipe: (_) => onSwipe(),
child: Container( child: Container(
constraints: card constraints: card
@@ -668,6 +670,7 @@ class Message extends StatelessWidget {
timeline: timeline, timeline: timeline,
selected: selected, selected: selected,
bigEmojis: bigEmojis, bigEmojis: bigEmojis,
fullWidthCard: card,
), ),
], ],
), ),
@@ -682,7 +685,7 @@ class Message extends StatelessWidget {
duration: FluffyThemes.animationDuration, duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve, curve: FluffyThemes.animationCurve,
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: !hasReactions child: card || !hasReactions
? const SizedBox.shrink() ? const SizedBox.shrink()
: Container( : Container(
alignment: card alignment: card
@@ -698,6 +701,17 @@ class Message extends StatelessWidget {
child: MessageReactions(event, timeline), child: MessageReactions(event, timeline),
), ),
), ),
if (card)
_PostActionBar(
event: event,
timeline: timeline,
hasReactions: hasReactions,
threadCount: threadChildren.length,
onAddReaction: () => onSelect(event),
onOpenThread: enterThread == null
? null
: () => enterThread(event.eventId),
),
Row( Row(
mainAxisAlignment: card mainAxisAlignment: card
? .start ? .start
@@ -989,7 +1003,7 @@ class Message extends StatelessWidget {
), ),
], ],
), ),
if (enterThread != null) if (enterThread != null && !card)
AnimatedSize( AnimatedSize(
duration: FluffyThemes.animationDuration, duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve, curve: FluffyThemes.animationCurve,
@@ -1176,3 +1190,115 @@ class __AnimateInState extends State<_AnimateIn> {
); );
} }
} }
class _PostActionBar extends StatelessWidget {
final Event event;
final Timeline timeline;
final bool hasReactions;
final int threadCount;
final VoidCallback? onAddReaction;
final VoidCallback? onOpenThread;
const _PostActionBar({
required this.event,
required this.timeline,
required this.hasReactions,
required this.threadCount,
required this.onAddReaction,
required this.onOpenThread,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
color: Theme.of(
context,
).colorScheme.surfaceContainerHighest.withAlpha(150),
border: Border(
top: BorderSide(
color: Theme.of(context).colorScheme.outlineVariant.withAlpha(120),
),
),
),
child: Row(
children: [
_BarAction(
icon: Icons.visibility_outlined,
label: '${event.receipts.length}',
),
Expanded(
child: Row(
children: [
if (hasReactions)
Flexible(
child: Align(
alignment: Alignment.centerLeft,
child: MessageReactions(event, timeline),
),
),
_BarAction(
icon: Icons.add_reaction_outlined,
onPressed: onAddReaction,
),
],
),
),
_BarAction(
icon: Icons.chat_bubble_outline,
label: '$threadCount',
onPressed: onOpenThread,
),
_BarAction(
icon: Icons.share_outlined,
onPressed: () {
showScaffoldDialog(
context: context,
builder: (context) => ShareScaffoldDialog(
items: [ContentShareItem(event.content.copy())],
),
);
},
),
],
),
);
}
}
class _BarAction extends StatelessWidget {
final IconData icon;
final String? label;
final VoidCallback? onPressed;
const _BarAction({required this.icon, this.label, this.onPressed});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return InkWell(
onTap: onPressed,
borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 6),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, size: 18, color: theme.colorScheme.onSurfaceVariant),
if (label != null) ...[
const SizedBox(width: 4),
Text(
label!,
style: TextStyle(
color: theme.colorScheme.onSurfaceVariant,
fontSize: 12,
),
),
],
],
),
),
);
}
}

View File

@@ -33,6 +33,7 @@ class MessageContent extends StatelessWidget {
final Timeline timeline; final Timeline timeline;
final bool selected; final bool selected;
final Set<String> bigEmojis; final Set<String> bigEmojis;
final bool fullWidthCard;
const MessageContent( const MessageContent(
this.event, { this.event, {
@@ -44,6 +45,7 @@ class MessageContent extends StatelessWidget {
required this.borderRadius, required this.borderRadius,
required this.selected, required this.selected,
required this.bigEmojis, required this.bigEmojis,
this.fullWidthCard = false,
}); });
@override @override
@@ -67,13 +69,43 @@ class MessageContent extends StatelessWidget {
final h = event.content final h = event.content
.tryGetMap<String, Object?>('info') .tryGetMap<String, Object?>('info')
?.tryGet<int>('h'); ?.tryGet<int>('h');
var width = maxSize; var width = fullWidthCard && event.messageType == MessageTypes.Image
? double.infinity
: maxSize;
var height = maxSize; var height = maxSize;
var fit = event.messageType == MessageTypes.Sticker var fit = event.messageType == MessageTypes.Sticker
? BoxFit.contain ? BoxFit.contain
: BoxFit.cover; : BoxFit.cover;
if (w != null && h != null) { if (w != null && h != null) {
fit = BoxFit.contain; fit = BoxFit.contain;
if (fullWidthCard && event.messageType == MessageTypes.Image) {
return LayoutBuilder(
builder: (context, constraints) {
final maxWidth = constraints.maxWidth;
final cardWidth = maxWidth.isFinite && maxWidth > 0
? maxWidth
: maxSize;
final hasKnownRatio = w > 0 && h > 0;
return ImageBubble(
event,
width: cardWidth,
height: hasKnownRatio ? cardWidth * h / w : maxSize,
fit: hasKnownRatio ? BoxFit.cover : BoxFit.contain,
borderRadius: borderRadius,
timeline: timeline,
textColor: textColor,
onTap: () => showDialog(
context: context,
builder: (_) => ImageViewer(
event,
timeline: timeline,
outerContext: context,
),
),
);
},
);
}
if (w > h) { if (w > h) {
width = maxSize; width = maxSize;
height = max(32, maxSize * (h / w)); height = max(32, maxSize * (h / w));
@@ -124,6 +156,7 @@ class MessageContent extends StatelessWidget {
textColor: textColor, textColor: textColor,
linkColor: linkColor, linkColor: linkColor,
timeline: timeline, timeline: timeline,
expand: fullWidthCard,
); );
case MessageTypes.File: case MessageTypes.File:
return MessageDownloadContent( return MessageDownloadContent(

View File

@@ -13,23 +13,25 @@ import 'package:tatchat/utils/platform_infos.dart';
import 'package:tatchat/utils/url_launcher.dart'; import 'package:tatchat/utils/url_launcher.dart';
import 'package:tatchat/widgets/blur_hash.dart'; import 'package:tatchat/widgets/blur_hash.dart';
import 'package:tatchat/widgets/mxc_image.dart'; import 'package:tatchat/widgets/mxc_image.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:material_ui/material_ui.dart'; import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import '../../image_viewer/image_viewer.dart'; import '../../image_viewer/image_viewer.dart';
import 'html_message.dart';
class EventVideoPlayer extends StatelessWidget { class EventVideoPlayer extends StatelessWidget {
final Event event; final Event event;
final Timeline? timeline; final Timeline? timeline;
final Color? textColor; final Color? textColor;
final Color? linkColor; final Color? linkColor;
final bool expand;
const EventVideoPlayer( const EventVideoPlayer(
this.event, { this.event, {
this.timeline, this.timeline,
this.textColor, this.textColor,
this.linkColor, this.linkColor,
this.expand = false,
super.key, super.key,
}); });
@@ -49,36 +51,20 @@ class EventVideoPlayer extends StatelessWidget {
final infoMap = event.content.tryGetMap<String, Object?>('info'); final infoMap = event.content.tryGetMap<String, Object?>('info');
final videoWidth = infoMap?.tryGet<int>('w') ?? maxDimension; final videoWidth = infoMap?.tryGet<int>('w') ?? maxDimension;
final videoHeight = infoMap?.tryGet<int>('h') ?? maxDimension; final videoHeight = infoMap?.tryGet<int>('h') ?? maxDimension;
final hasDimensions = videoWidth > 0 && videoHeight > 0;
final modifier = max(videoWidth, videoHeight) / maxDimension; final modifier = max(videoWidth, videoHeight) / maxDimension;
final width = videoWidth / modifier; final width = expand ? double.infinity : videoWidth / modifier;
final height = videoHeight / modifier; final height = expand
? (hasDimensions ? double.infinity : maxDimension)
: videoHeight / modifier;
final durationInt = infoMap?.tryGet<int>('duration'); final durationInt = infoMap?.tryGet<int>('duration');
final duration = durationInt == null final duration = durationInt == null
? null ? null
: Duration(milliseconds: durationInt); : Duration(milliseconds: durationInt);
return Column( final player = SizedBox(
mainAxisSize: .min,
spacing: 8,
children: [
Material(
color: Colors.black,
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
child: InkWell(
onTap: () => supportsVideoPlayer
? showDialog(
context: context,
builder: (_) => ImageViewer(
event,
timeline: timeline,
outerContext: context,
),
)
: event.saveFile(context),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
child: SizedBox(
width: width, width: width,
height: height, height: height,
child: Hero( child: Hero(
@@ -131,7 +117,33 @@ class EventVideoPlayer extends StatelessWidget {
], ],
), ),
), ),
);
return Column(
mainAxisSize: .min,
spacing: 8,
children: [
Material(
color: Colors.black,
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
child: InkWell(
onTap: () => supportsVideoPlayer
? showDialog(
context: context,
builder: (_) => ImageViewer(
event,
timeline: timeline,
outerContext: context,
), ),
)
: event.saveFile(context),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
child: expand && hasDimensions
? AspectRatio(
aspectRatio: videoWidth / videoHeight,
child: player,
)
: player,
), ),
), ),
if (fileDescription != null && textColor != null && linkColor != null) if (fileDescription != null && textColor != null && linkColor != null)
@@ -139,14 +151,13 @@ class EventVideoPlayer extends StatelessWidget {
width: width, width: width,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Linkify( child: HtmlMessage(
text: fileDescription, html: event.isRichMessage
textScaleFactor: MediaQuery.textScalerOf(context).scale(1), ? event.formattedText
style: TextStyle( : fileDescription,
color: textColor, room: event.room,
textColor: textColor!,
fontSize: AppConfig.messageFontSize, fontSize: AppConfig.messageFontSize,
),
options: const LinkifyOptions(humanize: false),
linkStyle: TextStyle( linkStyle: TextStyle(
color: linkColor, color: linkColor,
fontSize: AppConfig.messageFontSize, fontSize: AppConfig.messageFontSize,

View File

@@ -10,7 +10,13 @@ import 'package:async/async.dart' show Result;
import 'package:crop_image/crop_image.dart'; import 'package:crop_image/crop_image.dart';
import 'package:cross_file/cross_file.dart'; import 'package:cross_file/cross_file.dart';
import 'package:cupertino_ui/cupertino_ui.dart'; import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:html/parser.dart' show parseFragment;
import 'package:markdown/markdown.dart' show ExtensionSet, markdownToHtml;
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart' hide Result;
import 'package:mime/mime.dart';
import 'package:tatchat/config/app_config.dart'; import 'package:tatchat/config/app_config.dart';
import 'package:tatchat/config/setting_keys.dart';
import 'package:tatchat/l10n/l10n.dart'; import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/pages/chat/image_edit_geometry.dart'; import 'package:tatchat/pages/chat/image_edit_geometry.dart';
import 'package:tatchat/pages/chat/trust_user_key_dialog.dart'; import 'package:tatchat/pages/chat/trust_user_key_dialog.dart';
@@ -22,12 +28,17 @@ import 'package:tatchat/utils/size_string.dart';
import 'package:tatchat/utils/start_push_foreground_service.dart'; import 'package:tatchat/utils/start_push_foreground_service.dart';
import 'package:tatchat/widgets/adaptive_dialogs/adaptive_dialog_action.dart'; import 'package:tatchat/widgets/adaptive_dialogs/adaptive_dialog_action.dart';
import 'package:tatchat/widgets/adaptive_dialogs/dialog_text_field.dart'; import 'package:tatchat/widgets/adaptive_dialogs/dialog_text_field.dart';
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart' hide Result;
import 'package:mime/mime.dart';
import '../../utils/resize_video.dart'; import '../../utils/resize_video.dart';
/// Opens the crop/draw/rotate image editor with [bytes] and returns the edited
/// PNG bytes, or null if the user cancelled or made no changes.
Future<Uint8List?> editImageBytes(BuildContext context, Uint8List bytes) =>
showScaffoldDialog<Uint8List?>(
context: context,
builder: (_) => _ImageEditPage(bytes: bytes),
);
class SendFileDialog extends StatefulWidget { class SendFileDialog extends StatefulWidget {
final Room room; final Room room;
final List<XFile> files; final List<XFile> files;
@@ -54,6 +65,7 @@ class SendFileDialogState extends State<SendFileDialog> {
static const int minSizeToCompress = 20 * 1000; static const int minSizeToCompress = 20 * 1000;
final TextEditingController _labelTextController = TextEditingController(); final TextEditingController _labelTextController = TextEditingController();
final FocusNode _labelFocusNode = FocusNode();
/// Mutable working copy of [SendFileDialog.files]. Editing an image replaces /// Mutable working copy of [SendFileDialog.files]. Editing an image replaces
/// its entry with a new [XFile] whose bytes, mimetype and filename extension /// its entry with a new [XFile] whose bytes, mimetype and filename extension
@@ -151,12 +163,27 @@ class SendFileDialogState extends State<SendFileDialog> {
final label = _labelTextController.text.trim(); final label = _labelTextController.text.trim();
final extraContent = label.isEmpty
? null
: () {
final extra = <String, Object>{'body': label};
final html = markdownToHtml(
label,
extensionSet: ExtensionSet.gitHubFlavored,
);
if (parseFragment(html).text != label) {
extra['format'] = 'org.matrix.custom.html';
extra['formatted_body'] = html;
}
return extra;
}();
try { try {
await widget.room.sendFileEvent( await widget.room.sendFileEvent(
file, file,
thumbnail: thumbnail, thumbnail: thumbnail,
shrinkImageMaxDimension: compress ? 1600 : null, shrinkImageMaxDimension: compress ? 1600 : null,
extraContent: label.isEmpty ? null : {'body': label}, extraContent: extraContent,
threadRootEventId: widget.threadRootEventId, threadRootEventId: widget.threadRootEventId,
threadLastEventId: widget.threadLastEventId, threadLastEventId: widget.threadLastEventId,
); );
@@ -175,7 +202,7 @@ class SendFileDialogState extends State<SendFileDialog> {
file, file,
thumbnail: thumbnail, thumbnail: thumbnail,
shrinkImageMaxDimension: compress ? 1600 : null, shrinkImageMaxDimension: compress ? 1600 : null,
extraContent: label.isEmpty ? null : {'body': label}, extraContent: extraContent,
); );
} }
} }
@@ -197,6 +224,7 @@ class SendFileDialogState extends State<SendFileDialog> {
@override @override
void dispose() { void dispose() {
_labelFocusNode.dispose();
_labelTextController.dispose(); _labelTextController.dispose();
super.dispose(); super.dispose();
} }
@@ -204,6 +232,7 @@ class SendFileDialogState extends State<SendFileDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
final isMobile = PlatformInfos.isMobile;
var sendStr = L10n.of(context).sendFile; var sendStr = L10n.of(context).sendFile;
final uniqueFileType = _files final uniqueFileType = _files
@@ -244,8 +273,18 @@ class SendFileDialogState extends State<SendFileDialog> {
return AlertDialog.adaptive( return AlertDialog.adaptive(
title: Text(sendStr), title: Text(sendStr),
insetPadding: isMobile
? const EdgeInsets.all(8.0)
: const EdgeInsets.symmetric(horizontal: 40, vertical: 24),
constraints: isMobile
? const BoxConstraints(
maxWidth: double.infinity,
maxHeight: double.infinity,
)
: null,
content: SizedBox( content: SizedBox(
width: 256, width: 512,
height: isMobile ? MediaQuery.sizeOf(context).height * 0.85 : null,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
mainAxisSize: .min, mainAxisSize: .min,
@@ -393,10 +432,12 @@ class SendFileDialogState extends State<SendFileDialog> {
padding: const EdgeInsets.only(bottom: 8.0), padding: const EdgeInsets.only(bottom: 8.0),
child: DialogTextField( child: DialogTextField(
controller: _labelTextController, controller: _labelTextController,
focusNode: _labelFocusNode,
labelText: L10n.of(context).optionalMessage, labelText: L10n.of(context).optionalMessage,
minLines: 1, keyboardType: TextInputType.multiline,
maxLines: 1, minLines: isMobile ? 12 : 3,
maxLength: 255, maxLines: isMobile ? null : 8,
maxLength: AppSettings.textMessageMaxLength.value,
counterText: '', counterText: '',
), ),
), ),
@@ -474,6 +515,27 @@ class SendFileDialogState extends State<SendFileDialog> {
} }
} }
extension on ScaffoldMessengerState {
void showLoadingSnackBar(String title) => showSnackBar(
SnackBar(
persist: true,
content: Row(
spacing: 8,
children: [
Expanded(child: Text(title, overflow: .ellipsis, maxLines: 1)),
SizedBox.square(
dimension: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Theme.of(context).colorScheme.onInverseSurface,
),
),
],
),
),
);
}
enum _EditMode { crop, draw } enum _EditMode { crop, draw }
/// The crop (a normalized rectangle held by [CropController]), the rotation /// The crop (a normalized rectangle held by [CropController]), the rotation
@@ -933,27 +995,6 @@ class _ImageEditPageState extends State<_ImageEditPage> {
} }
} }
extension on ScaffoldMessengerState {
void showLoadingSnackBar(String title) => showSnackBar(
SnackBar(
persist: true,
content: Row(
spacing: 8,
children: [
Expanded(child: Text(title, overflow: .ellipsis, maxLines: 1)),
SizedBox.square(
dimension: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Theme.of(context).colorScheme.onInverseSurface,
),
),
],
),
),
);
}
/// Freehand drawing surface with pinch-to-zoom. /// Freehand drawing surface with pinch-to-zoom.
/// ///
/// This is a widget class (not a helper method on the parent state) so it gets /// This is a widget class (not a helper method on the parent state) so it gets

View File

@@ -7,23 +7,6 @@ import 'dart:async';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:cross_file/cross_file.dart'; import 'package:cross_file/cross_file.dart';
import 'package:tatchat/config/app_config.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/pages/chat_list/chat_list_view.dart';
import 'package:tatchat/pages/chat_list/tabs/home_tab.dart';
import 'package:tatchat/utils/error_reporter.dart';
import 'package:tatchat/utils/localized_exception_extension.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/room_extension.dart';
import 'package:tatchat/utils/platform_infos.dart';
import 'package:tatchat/utils/show_scaffold_dialog.dart';
import 'package:tatchat/utils/show_update_snackbar.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_modal_action_popup.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_text_input_dialog.dart';
import 'package:tatchat/widgets/avatar.dart';
import 'package:tatchat/widgets/future_loading_dialog.dart';
import 'package:tatchat/widgets/share_scaffold_dialog.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_callkit_incoming/entities/entities.dart'; import 'package:flutter_callkit_incoming/entities/entities.dart';
import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart'; import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart';
@@ -33,6 +16,23 @@ import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart' as sdk; import 'package:matrix/matrix.dart' as sdk;
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import 'package:receive_sharing_intent/receive_sharing_intent.dart'; import 'package:receive_sharing_intent/receive_sharing_intent.dart';
import 'package:tatchat/config/app_config.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/pages/chat_list/chat_list_view.dart';
import 'package:tatchat/pages/chat_list/tabs/home_tab.dart';
import 'package:tatchat/utils/error_reporter.dart';
import 'package:tatchat/utils/localized_exception_extension.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/client_presence_extension.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/room_extension.dart';
import 'package:tatchat/utils/platform_infos.dart';
import 'package:tatchat/utils/show_scaffold_dialog.dart';
import 'package:tatchat/utils/show_update_snackbar.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_modal_action_popup.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
import 'package:tatchat/widgets/adaptive_dialogs/show_text_input_dialog.dart';
import 'package:tatchat/widgets/future_loading_dialog.dart';
import 'package:tatchat/widgets/share_scaffold_dialog.dart';
import '../../../utils/account_bundles.dart'; import '../../../utils/account_bundles.dart';
import '../../config/setting_keys.dart'; import '../../config/setting_keys.dart';
@@ -63,11 +63,16 @@ class ChatList extends StatefulWidget {
final String? activeSpace; final String? activeSpace;
final bool displayNavigationRail; final bool displayNavigationRail;
/// Whether the navigation sidebar drawer is available (e.g. hidden inside
/// the settings column).
final bool sideMenuEnabled;
const ChatList({ const ChatList({
super.key, super.key,
required this.activeChat, required this.activeChat,
this.activeSpace, this.activeSpace,
this.displayNavigationRail = false, this.displayNavigationRail = false,
this.sideMenuEnabled = true,
}); });
@override @override
@@ -76,6 +81,10 @@ class ChatList extends StatefulWidget {
class ChatListController extends State<ChatList> class ChatListController extends State<ChatList>
with TickerProviderStateMixin, RouteAware { with TickerProviderStateMixin, RouteAware {
/// Scaffold state of the chat list, used to open the navigation sidebar
/// (drawer) from the hamburger menus.
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
StreamSubscription? _intentDataStreamSubscription; StreamSubscription? _intentDataStreamSubscription;
StreamSubscription? _intentFileStreamSubscription; StreamSubscription? _intentFileStreamSubscription;
@@ -413,8 +422,9 @@ class ChatListController extends State<ChatList>
scrollController.addListener(_onScroll); scrollController.addListener(_onScroll);
_waitForFirstSync(); _waitForFirstSync();
_backfillSubscription = _backfillSubscription = _clientStream.stream.listen(
_clientStream.stream.listen((_) => backfillRoomTypeMarkers()); (_) => backfillRoomTypeMarkers(),
);
if (PlatformInfos.isMobile) { if (PlatformInfos.isMobile) {
_callEventSubscription = FlutterCallkitIncoming.onEvent.listen( _callEventSubscription = FlutterCallkitIncoming.onEvent.listen(
_onCallEvent, _onCallEvent,
@@ -504,21 +514,7 @@ class ChatListController extends State<ChatList>
BuildContext posContext, [ BuildContext posContext, [
Room? space, Room? space,
]) async { ]) async {
final overlay = final l10n = L10n.of(posContext);
Overlay.of(posContext).context.findRenderObject() as RenderBox;
final button = posContext.findRenderObject() as RenderBox;
final position = RelativeRect.fromRect(
Rect.fromPoints(
button.localToGlobal(const Offset(0, -65), ancestor: overlay),
button.localToGlobal(
button.size.bottomRight(Offset.zero) + const Offset(-50, 0),
ancestor: overlay,
),
),
Offset.zero & overlay.size,
);
final spacesWithPowerLevels = room.client.rooms final spacesWithPowerLevels = room.client.rooms
.where( .where(
@@ -529,206 +525,94 @@ class ChatListController extends State<ChatList>
) )
.toList(); .toList();
var action = await showMenu<ChatContextAction>( final action = await showModalActionPopup<ChatContextAction>(
context: posContext, context: posContext,
position: position, cancelLabel: l10n.cancel,
items: [ actions: [
if (space != null) if (space != null)
PopupMenuItem( AdaptiveModalAction(
value: ChatContextAction.goToSpace, value: ChatContextAction.goToSpace,
child: Row( label: l10n.goToSpace(space.getLocalizedDisplayname()),
mainAxisSize: .min, icon: const Icon(Icons.workspaces_outlined),
children: [
Avatar(
mxContent: space.avatar,
size: Avatar.defaultSize / 2,
name: space.getLocalizedDisplayname(),
),
const SizedBox(width: 12),
Text(
L10n.of(context).goToSpace(space.getLocalizedDisplayname()),
),
],
),
), ),
if (room.membership == Membership.join) ...[ if (room.membership == Membership.join) ...[
PopupMenuItem( AdaptiveModalAction(
value: ChatContextAction.mute, value: ChatContextAction.mute,
child: Row( label: room.pushRuleState == PushRuleState.notify
mainAxisSize: .min, ? l10n.muteChat
children: [ : l10n.unmuteChat,
Icon( icon: Icon(
room.pushRuleState == PushRuleState.notify room.pushRuleState == PushRuleState.notify
? Icons.notifications_off_outlined ? Icons.notifications_off_outlined
: Icons.notifications_off, : Icons.notifications_off,
), ),
const SizedBox(width: 12),
Text(
room.pushRuleState == PushRuleState.notify
? L10n.of(context).muteChat
: L10n.of(context).unmuteChat,
), ),
], AdaptiveModalAction(
),
),
PopupMenuItem(
value: ChatContextAction.markUnread, value: ChatContextAction.markUnread,
child: Row( label: room.markedUnread ? l10n.markAsRead : l10n.markAsUnread,
mainAxisSize: .min, icon: Icon(
children: [
Icon(
room.markedUnread room.markedUnread
? Icons.mark_as_unread ? Icons.mark_as_unread
: Icons.mark_as_unread_outlined, : Icons.mark_as_unread_outlined,
), ),
const SizedBox(width: 12),
Text(
room.markedUnread
? L10n.of(context).markAsRead
: L10n.of(context).markAsUnread,
),
],
),
), ),
if (!room.isLowPriority) if (!room.isLowPriority)
PopupMenuItem( AdaptiveModalAction(
value: ChatContextAction.favorite, value: ChatContextAction.favorite,
child: Row( label: room.isFavourite ? l10n.unpin : l10n.pin,
mainAxisSize: .min, icon: Icon(
children: [
Icon(
room.isFavourite ? Icons.push_pin : Icons.push_pin_outlined, room.isFavourite ? Icons.push_pin : Icons.push_pin_outlined,
), ),
const SizedBox(width: 12),
Text(
room.isFavourite
? L10n.of(context).unpin
: L10n.of(context).pin,
), ),
],
),
),
],
PopupMenuItem(
value: ChatContextAction.leave,
child: Row(
mainAxisSize: .min,
children: [
Icon(
Icons.delete_outlined,
color: Theme.of(context).colorScheme.onErrorContainer,
),
const SizedBox(width: 12),
Text(
room.membership == Membership.invite
? L10n.of(context).delete
: L10n.of(context).leave,
style: TextStyle(
color: Theme.of(context).colorScheme.onErrorContainer,
),
),
],
),
),
if (room.membership == Membership.invite)
PopupMenuItem(
value: ChatContextAction.block,
child: Row(
mainAxisSize: .min,
children: [
Icon(
Icons.block_outlined,
color: Theme.of(context).colorScheme.onErrorContainer,
),
const SizedBox(width: 12),
Text(
L10n.of(context).block,
style: TextStyle(
color: Theme.of(context).colorScheme.onErrorContainer,
),
),
],
),
),
if (room.membership == Membership.join)
PopupMenuItem(
value: ChatContextAction.showMore,
child: Row(
mainAxisSize: .min,
children: [
Icon(Icons.adaptive.more_outlined),
const SizedBox(width: 12),
Text(L10n.of(context).more),
],
),
),
],
);
if (!posContext.mounted || !mounted) return;
if (action == ChatContextAction.showMore) {
action = await showMenu<ChatContextAction>(
context: posContext,
position: position,
items: [
if (!room.isFavourite) if (!room.isFavourite)
PopupMenuItem( AdaptiveModalAction(
value: ChatContextAction.lowPriority, value: ChatContextAction.lowPriority,
child: Row( label: room.isLowPriority
mainAxisSize: .min, ? l10n.unsetLowPriority
children: [ : l10n.setLowPriority,
Icon( icon: Icon(
room.isLowPriority room.isLowPriority
? Icons.low_priority ? Icons.low_priority
: Icons.low_priority_outlined, : Icons.low_priority_outlined,
), ),
const SizedBox(width: 12),
Text(
room.isLowPriority
? L10n.of(context).unsetLowPriority
: L10n.of(context).setLowPriority,
),
],
),
), ),
if (activeTag == null) if (activeTag == null)
PopupMenuItem( AdaptiveModalAction(
value: ChatContextAction.addTag, value: ChatContextAction.addTag,
child: Row( label: l10n.addTag,
mainAxisSize: .min, icon: const Icon(Icons.bookmark_add_outlined),
children: [
Icon(Icons.bookmark_add_outlined),
const SizedBox(width: 12),
Text(L10n.of(context).addTag),
],
),
) )
else else
PopupMenuItem( AdaptiveModalAction(
value: ChatContextAction.removeTag, value: ChatContextAction.removeTag,
child: Row( label: l10n.removeTag,
mainAxisSize: .min, icon: const Icon(Icons.bookmark_remove_outlined),
children: [
Icon(Icons.bookmark_remove_outlined),
const SizedBox(width: 12),
Text(L10n.of(context).removeTag),
],
),
), ),
if (spacesWithPowerLevels.isNotEmpty) if (spacesWithPowerLevels.isNotEmpty)
PopupMenuItem( AdaptiveModalAction(
value: ChatContextAction.addToSpace, value: ChatContextAction.addToSpace,
child: Row( label: l10n.addToSpace,
mainAxisSize: .min, icon: const Icon(Icons.group_work_outlined),
children: [
const Icon(Icons.group_work_outlined),
const SizedBox(width: 12),
Text(L10n.of(context).addToSpace),
],
), ),
],
AdaptiveModalAction(
value: ChatContextAction.leave,
label: room.membership == Membership.invite
? l10n.delete
: l10n.leave,
icon: const Icon(Icons.delete_outlined),
isDestructive: true,
),
if (room.membership == Membership.invite)
AdaptiveModalAction(
value: ChatContextAction.block,
label: l10n.block,
icon: const Icon(Icons.block_outlined),
isDestructive: true,
), ),
], ],
); );
} if (!posContext.mounted || !mounted) return;
if (action == null) return; if (action == null) return;
if (!mounted) return; if (!mounted) return;
@@ -855,8 +739,6 @@ class ChatListController extends State<ChatList>
future: () => room.removeTag(activeTag!), future: () => room.removeTag(activeTag!),
); );
return; return;
case ChatContextAction.showMore:
throw ('Should not be handled!');
} }
} }
@@ -899,41 +781,14 @@ class ChatListController extends State<ChatList>
if (!mounted) return; if (!mounted) return;
await showFutureLoadingDialog( await showFutureLoadingDialog(
context: context, context: context,
future: () => client.setPresence( future: () => client.setStatusMessage(input),
client.userID!,
PresenceType.online,
statusMsg: input,
),
); );
} }
bool waitForFirstSync = false; bool waitForFirstSync = false;
/// Leaves the room locally and removes it from the local database. /// Leaves the room locally and removes it from the local database.
Future<void> leaveRoom(Room room) async { Future<void> leaveRoom(Room room) => safeLeave(room);
try {
await room.leave();
} on MatrixException catch (e, s) {
// If the room was already left on the server (e.g. a stale local copy
// reappeared after a restart) the leave request fails, but the user
// intent (room not being listed anymore) is already fulfilled. Clean up
// locally instead of showing an error.
if (!{
MatrixError.M_FORBIDDEN,
MatrixError.M_NOT_FOUND,
MatrixError.M_UNKNOWN,
}.contains(e.error)) {
Logs().w('Failed to leave room ${room.id}', e, s);
rethrow;
}
Logs().w('Room ${room.id} is already gone, cleaning up locally...', e, s);
}
final client = room.client;
// Make sure the room does not reappear from the local database after an
// app restart, even if the leave sync did not run in time.
await client.database.forgetRoom(room.id);
client.rooms.remove(room);
}
/// Loads the shared [roomTypeStateEvent] marker from the synced room state /// Loads the shared [roomTypeStateEvent] marker from the synced room state
/// (from the local database for partially loaded rooms) and writes it for /// (from the local database for partially loaded rooms) and writes it for
@@ -1131,7 +986,8 @@ class ChatListController extends State<ChatList>
} }
@override @override
Widget build(BuildContext context) => ChatListView(this); Widget build(BuildContext context) =>
ChatListView(this, sideMenuEnabled: widget.sideMenuEnabled);
Future<void> dehydrate() => Matrix.of(context).dehydrateAction(context); Future<void> dehydrate() => Matrix.of(context).dehydrateAction(context);
} }
@@ -1149,5 +1005,4 @@ enum ChatContextAction {
leave, leave,
addToSpace, addToSpace,
block, block,
showMore,
} }

View File

@@ -73,10 +73,15 @@ class ChatListItem extends StatelessWidget {
final space = this.space; final space = this.space;
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
child: Material( child: Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius), borderRadius: BorderRadius.circular(AppConfig.borderRadius),
clipBehavior: Clip.hardEdge, side: BorderSide(
color: theme.colorScheme.surfaceContainer,
width: 1.5,
),
), clipBehavior: Clip.hardEdge,
color: backgroundColor, color: backgroundColor,
child: FutureBuilder( child: FutureBuilder(
future: room.name.isEmpty ? room.loadHeroUsers() : null, future: room.name.isEmpty ? room.loadHeroUsers() : null,

View File

@@ -15,11 +15,16 @@ import 'package:tatchat/pages/chat_list/tabs/murals_tab.dart';
import 'package:tatchat/pages/chat_list/tabs/spaces_tab.dart'; import 'package:tatchat/pages/chat_list/tabs/spaces_tab.dart';
import 'chat_list_body.dart'; import 'chat_list_body.dart';
import 'sidebar.dart';
class ChatListView extends StatelessWidget { class ChatListView extends StatelessWidget {
final ChatListController controller; final ChatListController controller;
const ChatListView(this.controller, {super.key}); /// Whether the navigation sidebar (drawer) is available, e.g. hidden inside
/// the settings column.
final bool sideMenuEnabled;
const ChatListView(this.controller, {super.key, this.sideMenuEnabled = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -45,9 +50,24 @@ class ChatListView extends StatelessWidget {
ChatTopTabBar( ChatTopTabBar(
currentTab: homeTab, currentTab: homeTab,
onTabSelected: controller.setHomeTab, onTabSelected: controller.setHomeTab,
onMenuPressed: sideMenuEnabled
? () => controller.scaffoldKey.currentState?.openDrawer()
: null,
), ),
Expanded( Expanded(
child: Scaffold( child: Scaffold(
key: controller.scaffoldKey,
drawer: sideMenuEnabled
? Drawer(
width: FluffyThemes.sidebarWidth,
child: Sidebar(controller),
)
: null,
// Avoid accidentally opening the drawer when swiping at the
// edge of the chat column.
drawerEdgeDragWidth: isColumnMode || !sideMenuEnabled
? 0
: null,
body: SafeArea( body: SafeArea(
top: false, top: false,
bottom: false, bottom: false,
@@ -74,7 +94,7 @@ class ChatListView extends StatelessWidget {
], ],
), ),
), ),
floatingActionButton: !controller.isSearchMode && !isColumnMode floatingActionButton: !controller.isSearchMode
? const StartChatFab() ? const StartChatFab()
: const SizedBox.shrink(), : const SizedBox.shrink(),
bottomNavigationBar: isColumnMode bottomNavigationBar: isColumnMode

View File

@@ -4,238 +4,46 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:async/async.dart'; import 'package:async/async.dart';
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart' hide Result;
import 'package:tatchat/l10n/l10n.dart'; import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/widgets/avatar.dart'; import 'package:tatchat/widgets/avatar.dart';
import 'package:tatchat/widgets/matrix.dart'; import 'package:tatchat/widgets/matrix.dart';
import 'package:go_router/go_router.dart'; import 'package:tatchat/widgets/self_profile_dialog.dart';
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart' hide Result;
import 'package:url_launcher/url_launcher_string.dart';
import 'package:tatchat/utils/tatu_share.dart';
import 'chat_list.dart'; import 'chat_list.dart';
/// The header avatar of the active account. Tapping it opens the own profile
/// dialog. Account switching and the former avatar popup actions live in the
/// navigation drawer (Sidebar).
class ClientChooserButton extends StatelessWidget { class ClientChooserButton extends StatelessWidget {
final ChatListController controller; final ChatListController controller;
const ClientChooserButton(this.controller, {super.key}); const ClientChooserButton(this.controller, {super.key});
List<PopupMenuEntry<Object>> _bundleMenuItems(BuildContext context) {
final matrix = Matrix.of(context);
final bundles = matrix.accountBundles.keys.toList()
..sort(
(a, b) => a!.isValidMatrixIdStrict() == b!.isValidMatrixIdStrict()
? 0
: a.isValidMatrixIdStrict() && !b.isValidMatrixIdStrict()
? -1
: 1,
);
return <PopupMenuEntry<Object>>[
PopupMenuItem(
value: SettingsAction.newGroup,
child: Row(
children: [
const Icon(Icons.group_add_outlined),
const SizedBox(width: 18),
Text(L10n.of(context).createGroup),
],
),
),
PopupMenuItem(
value: SettingsAction.setStatus,
child: Row(
children: [
const Icon(Icons.edit_outlined),
const SizedBox(width: 18),
Text(L10n.of(context).setStatus),
],
),
),
PopupMenuItem(
value: SettingsAction.invite,
child: Row(
children: [
Icon(Icons.adaptive.share_outlined),
const SizedBox(width: 18),
Text(L10n.of(context).inviteContact),
],
),
),
PopupMenuItem(
value: SettingsAction.archive,
child: Row(
children: [
const Icon(Icons.archive_outlined),
const SizedBox(width: 18),
Text(L10n.of(context).archive),
],
),
),
PopupMenuItem(
value: SettingsAction.settings,
child: Row(
children: [
const Icon(Icons.settings_outlined),
const SizedBox(width: 18),
Text(L10n.of(context).settings),
],
),
),
PopupMenuItem(
value: SettingsAction.support,
child: Row(
children: [
Icon(Icons.favorite, color: Colors.red),
const SizedBox(width: 18),
Text(L10n.of(context).supportFluffyChat),
],
),
),
const PopupMenuDivider(),
for (final bundle in bundles) ...[
if (matrix.accountBundles[bundle]!.length != 1 ||
matrix.accountBundles[bundle]!.single!.userID != bundle)
PopupMenuItem(
value: null,
child: Column(
crossAxisAlignment: .start,
mainAxisSize: .min,
children: [
Text(
bundle!,
style: TextStyle(
color: Theme.of(context).textTheme.titleMedium!.color,
fontSize: 14,
),
),
const Divider(height: 1),
],
),
),
...matrix.accountBundles[bundle]!
.whereType<Client>()
.where((client) => client.isLogged())
.map(
(client) => PopupMenuItem(
value: client,
child: FutureBuilder<Profile?>(
future: client.fetchOwnProfile(),
builder: (context, snapshot) {
final displayname =
snapshot.data?.displayName ?? client.userID!.localpart!;
return Row(
key: ValueKey('switch_account_$displayname'),
children: [
Avatar(
mxContent: snapshot.data?.avatarUrl,
name: displayname,
size: 32,
),
const SizedBox(width: 12),
Expanded(
child: Text(
displayname,
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 12),
IconButton(
icon: const Icon(Icons.edit_outlined),
onPressed: () => controller.editBundlesForAccount(
client.userID,
bundle,
),
),
],
);
},
),
),
),
],
PopupMenuItem(
value: SettingsAction.addAccount,
child: Row(
children: [
const Icon(Icons.person_add_outlined),
const SizedBox(width: 18),
Text(L10n.of(context).addAccount),
],
),
),
];
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final matrix = Matrix.of(context); final matrix = Matrix.of(context);
final client = Result(() => matrix.client).asValue?.value; final client = Result(() => matrix.client).asValue?.value;
var clientCount = 0;
matrix.accountBundles.forEach((key, value) => clientCount += value.length);
return FutureBuilder<Profile>( return FutureBuilder<Profile>(
future: client?.isLogged() == true ? client?.fetchOwnProfile() : null, future: client?.isLogged() == true ? client?.fetchOwnProfile() : null,
builder: (context, snapshot) => Material( builder: (context, snapshot) => Material(
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(99), borderRadius: BorderRadius.circular(99),
color: Colors.transparent, color: Colors.transparent,
child: PopupMenuButton<Object>( child: Tooltip(
key: Key('accounts_and_settings_buttons'), message: L10n.of(context).accountsAndSettings,
tooltip: L10n.of(context).accountsAndSettings, child: InkWell(
onSelected: (o) => _clientSelected(o, context), key: const Key('accounts_and_settings_buttons'),
itemBuilder: _bundleMenuItems, onTap: () => showSelfProfileDialog(context),
icon: Avatar( child: Avatar(
mxContent: snapshot.data?.avatarUrl, mxContent: snapshot.data?.avatarUrl,
name: snapshot.data?.displayName ?? client?.userID?.localpart, name: snapshot.data?.displayName ?? client?.userID?.localpart,
size: 32, size: 32,
), ),
), ),
), ),
),
); );
} }
Future<void> _clientSelected(Object object, BuildContext context) async {
if (object is Client) {
controller.setActiveClient(object);
} else if (object is String) {
controller.setActiveBundle(object);
} else if (object is SettingsAction) {
switch (object) {
case SettingsAction.addAccount:
if (!context.mounted) return;
context.go('/rooms/settings/addaccount');
break;
case SettingsAction.newGroup:
context.go('/rooms/newgroup');
break;
case SettingsAction.invite:
TatuShare.shareInviteLink(context);
break;
case SettingsAction.support:
launchUrlString(
'https://ko-fi.com/post/How-can-I-support-FluffyChat-J2G325WE6I',
);
break;
case SettingsAction.settings:
context.go('/rooms/settings');
break;
case SettingsAction.archive:
context.go('/rooms/archive');
break;
case SettingsAction.setStatus:
controller.setStatus();
break;
}
}
}
}
enum SettingsAction {
addAccount,
newGroup,
setStatus,
invite,
support,
settings,
archive,
} }

View File

@@ -0,0 +1,184 @@
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:material_ui/material_ui.dart';
import 'package:matrix/matrix.dart';
import 'package:tatchat/config/app_config.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:tatchat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:tatchat/widgets/avatar.dart';
/// A row that represents a mural in the murals list.
///
/// The first line shows the circular avatar, the mural name, the creator and
/// the number of subscribers. The second line is reserved for the description.
/// All colors are taken from the app theme, mirroring the regular chat list
/// rows.
class MuralListItem extends StatelessWidget {
final Room room;
final bool activeChat;
final void Function() onTap;
final void Function(BuildContext context)? onLongPress;
final Uri? displayAvatar;
final String? displayAvatarName;
final String? description;
final String? creatorName;
const MuralListItem(
this.room, {
this.activeChat = false,
required this.onTap,
this.onLongPress,
this.displayAvatar,
this.displayAvatarName,
this.description,
this.creatorName,
super.key,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final l10n = L10n.of(context);
final displayname = room.getLocalizedDisplayname(MatrixLocals(l10n));
final isMuted = room.pushRuleState != PushRuleState.notify;
final backgroundColor = activeChat
? theme.colorScheme.secondaryContainer
: theme.colorScheme.surface;
final description = this.description;
final creatorName = this.creatorName;
final followers = room.summary.mJoinedMemberCount ?? 0;
final mutedStyle = theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
child: Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
side: BorderSide(
color: theme.colorScheme.surfaceContainer,
width: 1.5,
),
),
clipBehavior: Clip.hardEdge,
color: backgroundColor,
child: InkWell(
onTap: onTap,
onLongPress: onLongPress == null
? null
: () => onLongPress?.call(context),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Avatar(
mxContent: displayAvatar ?? room.avatar,
name: displayAvatarName ?? displayname,
size: Avatar.defaultSize,
shapeBorder: const CircleBorder(),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Expanded(
flex: 3,
child: Text(
displayname,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
),
),
),
if (isMuted)
const Padding(
padding: EdgeInsets.only(left: 4),
child: Icon(
Icons.notifications_off_outlined,
size: 16,
),
),
if (room.isFavourite)
Padding(
padding: const EdgeInsets.only(left: 4),
child: Icon(
Icons.push_pin,
size: 16,
color: theme.colorScheme.primary,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (creatorName != null &&
creatorName.isNotEmpty) ...[
// const SizedBox(width: 12),
Flexible(
flex: 1,
child: Text(
'${l10n.by} $creatorName',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: mutedStyle?.copyWith(
fontStyle: FontStyle.italic,
),
),
),
],
const Spacer(),
Row(
children: [
Icon(
Icons.group_outlined,
size: 16,
color: theme.colorScheme.onSurfaceVariant,
),
const SizedBox(width: 2),
Text(
l10n.countFollowers(followers),
style: mutedStyle,
),
],
),
],
),
],
),
),
],
),
if (description != null && description.isNotEmpty)
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
description,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
),
],
),
),
),
),
);
}
}

Some files were not shown because too many files have changed in this diff Show More