feat: cartões de publicação em canais e corrreções de salas arquivadas
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled

- Canais: publicações viram cartões de largura total mantendo todas as
  funções do balão (reações, resposta, editar, excluir, comentários em
  thread). Composer de publicação fica restrito a admins no feed; membros
  comentam via tela de thread. Canais novos usam events_default 0 para
  permitir comentários e reações.
- Ao sair/excluir uma sala, a cópia local é removida do banco imediatamente;
  salas já deixadas no servidor não apresentam mais erro ao excluir de novo.
- Classificação mural/canal carregada direto do sync (room_type em
  importantStateEvents + postLoad) sem precisar abrir a sala.
- Diálogos com raio e padding reduzidos (dialogTheme, text input e ok/cancel).
- Ícones do app regenerados (logo_background) e dependência linkify.
This commit is contained in:
2026-09-14 08:30:25 -03:00
parent 41a6a52393
commit ebafa1dc39
29 changed files with 10543 additions and 9965 deletions

View File

@@ -0,0 +1,33 @@
// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:matrix/matrix.dart';
import 'package:tatchat/config/app_config.dart';
/// State event type that marks the room category (canal/mural) on a room
/// level. Unlike the personal tags (per-account data), this marker is shared
/// by all room members which makes the categorization consistent across
/// different accounts.
const String roomTypeStateEvent = 'tatuchat.room_type';
extension RoomTypeExtension on Room {
String? get roomType =>
getState(roomTypeStateEvent)?.content.tryGet<String>('type');
bool get isCanal =>
tags.keys.contains(AppConfig.canalTag) || roomType == 'canal';
bool get isMural =>
tags.keys.contains(AppConfig.muralTag) || roomType == 'mural';
/// Whether the account left (or was banned from) this room. Such rooms must
/// not be shown in the chat list, even if a stale local copy with an old
/// "join" membership reappears after a restart.
bool get isLeftOrBanned =>
{Membership.leave, Membership.ban}.contains(membership);
Future<String> setRoomType(String type) =>
client.setRoomStateWithKey(id, roomTypeStateEvent, '', {'type': type});
}