More clean up

This commit is contained in:
Christian Pauly 2020-01-19 15:30:23 +01:00
parent f4ef4eeea9
commit 5ad49c03a3
3 changed files with 6 additions and 3 deletions

View File

@ -344,7 +344,7 @@ class MatrixState extends State<Matrix> {
@override
void initState() {
if (widget.client == null) {
client = Client(widget.clientName, debug: true);
client = Client(widget.clientName, debug: false);
if (!kIsWeb) {
_initWithStore();
} else {

View File

@ -14,7 +14,7 @@ extension LocalizedBody on Event {
getLocalizedBody(BuildContext context,
{bool withSenderNamePrefix = false, hideQuotes = false}) {
if (this.redacted) {
return "Redacted by ${this.redactedBecause.sender.calcDisplayname()}";
return "Removed by ${this.redactedBecause.sender.calcDisplayname()}";
}
String localizedBody = body;
final String senderName = this.sender.calcDisplayname();
@ -214,8 +214,11 @@ extension LocalizedBody on Event {
// Hide quotes
if (hideQuotes) {
print("+++ Hide quites +++");
List<String> lines = localizedBody.split("\n");
print("Lines with quotes: ${lines.length}");
lines.removeWhere((s) => s.startsWith("> "));
print("Lines without quotes: ${lines.length}");
localizedBody = lines.join("\n");
}

View File

@ -91,7 +91,7 @@ class _SettingsState extends State<Settings> {
@override
Widget build(BuildContext context) {
final Client client = Matrix.of(context).client;
profileFuture ??= client.getProfileFromUserId(client.userID);
profileFuture ??= client.ownProfile;
profileFuture.then((p) {
if (mounted) setState(() => profile = p);
});