From 1bf9dbecf6a071c855f51c1df14e242d9ebd3b10 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 10 Feb 2020 13:05:11 +0100 Subject: [PATCH] Use identifiers from sdk --- lib/views/chat_details.dart | 4 ++-- lib/views/new_private_chat.dart | 4 ++-- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/views/chat_details.dart b/lib/views/chat_details.dart index 0ef73a0..2ab9ca2 100644 --- a/lib/views/chat_details.dart +++ b/lib/views/chat_details.dart @@ -47,7 +47,7 @@ class _ChatDetailsState extends State { } void setCanonicalAliasAction(context, s) async { - final String domain = widget.room.client.userID.split(":")[1]; + final String domain = widget.room.client.userID.domain; final String canonicalAlias = "%23" + s + "%3A" + domain; final Event aliasEvent = widget.room.getState("m.room.aliases", domain); final List aliases = @@ -282,7 +282,7 @@ class _ChatDetailsState extends State { ?.replaceAll("#", "") ?? I18n.of(context).alias, prefixText: "#", - suffixText: widget.room.client.userID.split(":")[1], + suffixText: widget.room.client.userID.domain, ), ), ), diff --git a/lib/views/new_private_chat.dart b/lib/views/new_private_chat.dart index fb4e2da..bdb0afe 100644 --- a/lib/views/new_private_chat.dart +++ b/lib/views/new_private_chat.dart @@ -104,7 +104,7 @@ class _NewPrivateChatState extends State<_NewPrivateChat> { @override Widget build(BuildContext context) { - final String defaultDomain = Matrix.of(context).client.userID.split(":")[1]; + final String defaultDomain = Matrix.of(context).client.userID.domain; return Scaffold( appBar: AppBar( title: Text(I18n.of(context).newPrivateChat), @@ -190,7 +190,7 @@ class _NewPrivateChatState extends State<_NewPrivateChat> { ), title: Text( foundProfile["display_name"] ?? - foundProfile["user_id"].split(":").first.substring(1), + foundProfile["user_id"].localpart, style: TextStyle(), maxLines: 1, ), diff --git a/pubspec.lock b/pubspec.lock index d079d7f..0e043ff 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -117,8 +117,8 @@ packages: dependency: "direct main" description: path: "." - ref: "4bf6a4bcb60ca8877b5f2d435978e47358c20cad" - resolved-ref: "4bf6a4bcb60ca8877b5f2d435978e47358c20cad" + ref: "38f7bf947610b9b19a81aa9db05d76b460d116d9" + resolved-ref: "38f7bf947610b9b19a81aa9db05d76b460d116d9" url: "https://gitlab.com/famedly/famedlysdk.git" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index 2ae536f..f167e67 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: famedlysdk: git: url: https://gitlab.com/famedly/famedlysdk.git - ref: 4bf6a4bcb60ca8877b5f2d435978e47358c20cad + ref: 38f7bf947610b9b19a81aa9db05d76b460d116d9 localstorage: ^3.0.1+4 bubble: ^1.1.9+1