@@ -3,11 +3,9 @@ import 'dart:convert';
3
3
import 'package:flutter/material.dart' ;
4
4
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart' ;
5
5
6
- import '../api/model/initial_snapshot.dart' ;
7
6
import '../api/model/model.dart' ;
8
7
import '../model/content.dart' ;
9
8
import '../model/narrow.dart' ;
10
- import '../model/store.dart' ;
11
9
import 'app_bar.dart' ;
12
10
import 'content.dart' ;
13
11
import 'message_list.dart' ;
@@ -36,32 +34,6 @@ class ProfilePage extends StatelessWidget {
36
34
page: ProfilePage (userId: userId));
37
35
}
38
36
39
- /// The given user's real email address, if known, for displaying in the UI.
40
- ///
41
- /// Returns null if self-user isn't able to see [user] 's real email address.
42
- String ? _getDisplayEmailFor (User user, {required PerAccountStore store}) {
43
- if (store.account.zulipFeatureLevel >= 163 ) { // TODO(server-7)
44
- // A non-null value means self-user has access to [user]'s real email,
45
- // while a null value means it doesn't have access to the email.
46
- // Search for "delivery_email" in https://zulip.com/api/register-queue.
47
- return user.deliveryEmail;
48
- } else {
49
- if (user.deliveryEmail != null ) {
50
- // A non-null value means self-user has access to [user]'s real email,
51
- // while a null value doesn't necessarily mean it doesn't have access
52
- // to the email, ....
53
- return user.deliveryEmail;
54
- } else if (store.emailAddressVisibility == EmailAddressVisibility .everyone) {
55
- // ... we have to also check for [PerAccountStore.emailAddressVisibility].
56
- // See:
57
- // * https://github.com/zulip/zulip-mobile/pull/5515#discussion_r997731727
58
- // * https://chat.zulip.org/#narrow/stream/378-api-design/topic/email.20address.20visibility/near/1296133
59
- return user.email;
60
- } else {
61
- return null ;
62
- }
63
- }
64
- }
65
37
66
38
@override
67
39
Widget build (BuildContext context) {
@@ -72,7 +44,7 @@ class ProfilePage extends StatelessWidget {
72
44
return const _ProfileErrorPage ();
73
45
}
74
46
75
- final displayEmail = _getDisplayEmailFor (user, store: store);
47
+ final displayEmail = getDisplayEmailFor (user, store: store);
76
48
final items = [
77
49
Center (
78
50
child: Avatar (userId: userId, size: 200 , borderRadius: 200 / 8 )),
0 commit comments