Merge remote-tracking branch 'origin/privacy' into riot_2604

This commit is contained in:
manuroe 2019-09-23 16:52:06 +02:00
commit 9621b2dd30
6 changed files with 46 additions and 5 deletions

View file

@ -199,6 +199,7 @@
// Contacts
"contacts_address_book_section" = "LOCAL CONTACTS";
"contacts_address_book_matrix_users_toggle" = "Matrix users only";
"contacts_address_book_no_identity_server" = "No identity server configured";
"contacts_address_book_no_contact" = "No local contacts";
"contacts_address_book_permission_required" = "Permission required to access local contacts";
"contacts_address_book_permission_denied" = "You didn't allow Riot to access your local contacts";
@ -988,3 +989,7 @@
// MARK: Reaction history
"reaction_history_title" = "Reactions";
// Generic errors
"error_invite_3pid_with_no_identity_server" = "Add an identity server in your settings to invite by email.";

View file

@ -426,6 +426,10 @@ internal enum VectorL10n {
internal static var contactsAddressBookNoContact: String {
return VectorL10n.tr("Vector", "contacts_address_book_no_contact")
}
/// No identity server configured
internal static var contactsAddressBookNoIdentityServer: String {
return VectorL10n.tr("Vector", "contacts_address_book_no_identity_server")
}
/// You didn't allow Riot to access your local contacts
internal static var contactsAddressBookPermissionDenied: String {
return VectorL10n.tr("Vector", "contacts_address_book_permission_denied")
@ -990,6 +994,10 @@ internal enum VectorL10n {
internal static var encryptedRoomMessageReplyToPlaceholder: String {
return VectorL10n.tr("Vector", "encrypted_room_message_reply_to_placeholder")
}
/// Add an identity server in your settings to invite by email.
internal static var errorInvite3pidWithNoIdentityServer: String {
return VectorL10n.tr("Vector", "error_invite_3pid_with_no_identity_server")
}
/// VoIP conference added by %@
internal static func eventFormatterJitsiWidgetAdded(_ p1: String) -> String {
return VectorL10n.tr("Vector", "event_formatter_jitsi_widget_added", p1)

View file

@ -622,8 +622,16 @@
switch ([CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts])
{
case CNAuthorizationStatusAuthorized:
// Because there is no contacts on the device
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_no_contact", @"Vector", nil);
if (hideNonMatrixEnabledContacts && !self.mxSession.identityService)
{
// Because we cannot make lookups with no IS
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_no_identity_server", @"Vector", nil);
}
else
{
// Because there is no contacts on the device
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_no_contact", @"Vector", nil);
}
break;
case CNAuthorizationStatusNotDetermined:

View file

@ -1646,8 +1646,18 @@
[self removePendingActionMask];
NSLog(@"[RoomParticipantsVC] Invite be email %@ failed", participantId);
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
if ([error.domain isEqualToString:kMXRestClientErrorDomain]
&& error.code == MXRestClientErrorMissingIdentityServer)
{
NSString *message = [NSBundle mxk_localizedStringForKey:@"error_invite_3pid_with_no_identity_server"];
[[AppDelegate theDelegate] showAlertWithTitle:message message:nil];
}
else
{
[[AppDelegate theDelegate] showErrorAsAlert:error];
}
}];
}
else //if ([MXTools isMatrixUserIdentifier:participantId])

View file

@ -5008,8 +5008,16 @@
NSLog(@"[RoomVC] Invite be email %@ failed", participantId);
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
if ([error.domain isEqualToString:kMXRestClientErrorDomain]
&& error.code == MXRestClientErrorMissingIdentityServer)
{
NSString *message = [NSBundle mxk_localizedStringForKey:@"error_invite_3pid_with_no_identity_server"];
[[AppDelegate theDelegate] showAlertWithTitle:message message:nil];
}
else
{
[[AppDelegate theDelegate] showErrorAsAlert:error];
}
}];
}
else //if ([MXTools isMatrixUserIdentifier:participantId])

View file

@ -3796,6 +3796,8 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate>
}];
} failure:^(NSError *error) {
[self stopActivityIndicator];
// Notify user
NSString *myUserId = session.myUser.userId; // TODO: Hanlde multi-account
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error userInfo:myUserId ? @{kMXKErrorUserIdKey: myUserId} : nil];