mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-09 03:34:10 +01:00
feat: Add config hideTypingUsernames
This commit is contained in:
parent
721c0b2bfa
commit
19c04403a2
@ -16,6 +16,7 @@ abstract class AppConfig {
|
|||||||
static bool renderHtml = false;
|
static bool renderHtml = false;
|
||||||
static bool hideRedactedEvents = false;
|
static bool hideRedactedEvents = false;
|
||||||
static bool hideUnknownEvents = false;
|
static bool hideUnknownEvents = false;
|
||||||
|
static const bool hideTypingUsernames = false;
|
||||||
static const bool hideAllStateEvents = false;
|
static const bool hideAllStateEvents = false;
|
||||||
static const String inviteLinkPrefix = 'https://matrix.to/#/';
|
static const String inviteLinkPrefix = 'https://matrix.to/#/';
|
||||||
static const String pushNotificationsChannelId = 'fluffychat_push';
|
static const String pushNotificationsChannelId = 'fluffychat_push';
|
||||||
|
@ -1757,6 +1757,13 @@
|
|||||||
"unreadChats": {}
|
"unreadChats": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"numUsersTyping": "{count} users are typing…",
|
||||||
|
"@numUsersTyping": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {
|
||||||
|
"count": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"userAndOthersAreTyping": "{username} and {count} others are typing…",
|
"userAndOthersAreTyping": "{username} and {count} others are typing…",
|
||||||
"@userAndOthersAreTyping": {
|
"@userAndOthersAreTyping": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
@ -2,6 +2,7 @@ import 'package:famedlysdk/famedlysdk.dart';
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
|
|
||||||
|
import '../app_config.dart';
|
||||||
import 'date_time_extension.dart';
|
import 'date_time_extension.dart';
|
||||||
|
|
||||||
extension RoomStatusExtension on Room {
|
extension RoomStatusExtension on Room {
|
||||||
@ -37,7 +38,13 @@ extension RoomStatusExtension on Room {
|
|||||||
var typingUsers = this.typingUsers;
|
var typingUsers = this.typingUsers;
|
||||||
typingUsers.removeWhere((User u) => u.id == client.userID);
|
typingUsers.removeWhere((User u) => u.id == client.userID);
|
||||||
|
|
||||||
if (typingUsers.length == 1) {
|
if (AppConfig.hideTypingUsernames) {
|
||||||
|
typingText = L10n.of(context).isTyping;
|
||||||
|
if (typingUsers.first.id != directChatMatrixID) {
|
||||||
|
typingText =
|
||||||
|
L10n.of(context).numUsersTyping(typingUsers.length.toString());
|
||||||
|
}
|
||||||
|
} else if (typingUsers.length == 1) {
|
||||||
typingText = L10n.of(context).isTyping;
|
typingText = L10n.of(context).isTyping;
|
||||||
if (typingUsers.first.id != directChatMatrixID) {
|
if (typingUsers.first.id != directChatMatrixID) {
|
||||||
typingText =
|
typingText =
|
||||||
|
Loading…
Reference in New Issue
Block a user