- $a = DI::app();
-
- $networks = null;
-
- $size = ($options['size'] ?? 0) ?: 4;
- $mutual = !empty($options['mutual_friends']);
- $single = !empty($options['single']) && empty($options['multiple']);
- $exclude = $options['exclude'] ?? false;
-
- switch (($options['networks'] ?? '') ?: Protocol::PHANTOM) {
- case 'DFRN_ONLY':
- $networks = [Protocol::DFRN];
- break;
-
- case 'PRIVATE':
- $networks = [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA];
- break;
-
- case 'TWO_WAY':
- if (!empty($a->user['prvnets'])) {
- $networks = [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA];
- } else {
- $networks = [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA, Protocol::OSTATUS];
- }
- break;
-
- default: /// @TODO Maybe log this call?
- break;
- }
-
- $x = ['options' => $options, 'size' => $size, 'single' => $single, 'mutual' => $mutual, 'exclude' => $exclude, 'networks' => $networks];
-
- Hook::callAll('contact_select_options', $x);
-