Add more helpful message when trying to start DM with a user that does not exist (#224).

This commit is contained in:
langleyd 2021-06-09 14:57:40 +01:00
parent ce9a49f358
commit 40bf968720
5 changed files with 9 additions and 5 deletions

View file

@ -10,7 +10,7 @@ Changes to be released in next version
* Integrated FLEX for debug builds.
🐛 Bugfix
*
* StartChatViewController: Add more helpful message when trying to start DM with a user that does not exist (#224).
⚠️ API Changes
*

View file

@ -178,6 +178,7 @@
"room_creation_wait_for_creation" = "A room is already being created. Please wait.";
"room_creation_invite_another_user" = "Search / invite by User ID, Name or email";
"room_creation_error_invite_user_by_email_without_identity_server" = "No identity server is configured so you cannot add a participant with an email.";
"room_creation_dm_error" = "We couldn't create your DM. Please check the users you want to invite and try again.";
// Room recents
"room_recents_directory_section" = "ROOM DIRECTORY";

View file

@ -2402,6 +2402,10 @@ internal enum VectorL10n {
internal static var roomCreationAppearancePicture: String {
return VectorL10n.tr("Vector", "room_creation_appearance_picture")
}
/// We couldn't create your DM. Please check the users you want to invite and try again.
internal static var roomCreationDmError: String {
return VectorL10n.tr("Vector", "room_creation_dm_error")
}
/// No identity server is configured so you cannot add a participant with an email.
internal static var roomCreationErrorInviteUserByEmailWithoutIdentityServer: String {
return VectorL10n.tr("Vector", "room_creation_error_invite_user_by_email_without_identity_server")

View file

@ -2878,7 +2878,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
void (^onFailure)(NSError *) = ^(NSError *error){
MXLogDebug(@"[AppDelegate] Create direct chat failed");
//Alert user
[self showErrorAsAlert:error];
[self showAlertWithTitle:nil message:NSLocalizedStringFromTable(@"room_creation_dm_error", @"Vector", nil)];
if (completion)
{

View file

@ -603,9 +603,8 @@
if (isDirect && inviteArray.count)
{
[[AppDelegate theDelegate] startDirectChatWithUserId:inviteArray.firstObject completion:^{
self->createBarButtonItem.enabled = YES;
[self stopActivityIndicator];
}];
}
else
@ -625,7 +624,7 @@
MXLogDebug(@"[StartChatViewController] Create room failed");
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
[[AppDelegate theDelegate] showAlertWithTitle:nil message:NSLocalizedStringFromTable(@"room_creation_dm_error", @"Vector", nil)];
};
[self.mainSession vc_canEnableE2EByDefaultInNewRoomWithUsers:inviteArray success:^(BOOL canEnableE2E) {