Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(other): promote JMAP & EWS in the UI #1277

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

Bienvenumoringa
Copy link
Member

Related task

Modify the text in the help section to explain that Cypht supports the JMAP (RFC8621) protocol in addition to IMAP and SMTP, and make JMAP available by default in standalone Cypht installations or those integrated with Tiki.

image

modules/nux/modules.php Outdated Show resolved Hide resolved
@Shadow243
Copy link
Member

Shadow243 commented Oct 22, 2024

Screenshot 2024-10-22 at 15 49 52

You don't need to repeat it after SMTP. it's already okay after IMAP as it's an imap alternative, like this:
Screenshot 2024-10-22 at 19 07 46

you can use a cndition like this:

$res .= sprintf(
                        $this->trans('You have %d %s%s'),
                        $server_data[$proto],
                        mb_strtoupper($proto_dsp),
                        ($proto === 'imap' ? ' / JMAP ' . $server_data['jmap'] . ($server_data[$proto] > 1 ? ' sources' : ' source') : ($server_data[$proto] > 1 ? ' sources' : ' source'))
                    );

and filter from here:

if (data_source_available($modules, 'imap')) {
            $imap_servers = count(array_filter(Hm_IMAP_List::dump(false), function($v) { return !array_key_exists('type', $v);}));
            $jmap_servers = count(array_filter(Hm_IMAP_List::dump(false), function($v) { return array_key_exists('type', $v) && $v['type'] == 'jmap'; }));
        }
$this->out('nux_server_setup', array(
            'imap' => $imap_servers,
            'jmap' => $jmap_servers,
            'feeds' => $feed_servers,
            'smtp' => $smtp_servers,
            'profiles' => $profiles
        ));

@Bienvenumoringa
Copy link
Member Author

Screenshot 2024-10-22 at 15 49 52 You don't need to repeat it after SMTP. it's already okay after IMAP as it's an` imap` alternative, like this: Screenshot 2024-10-22 at 19 07 46

you can use a cndition like this:

$res .= sprintf(
                        $this->trans('You have %d %s%s'),
                        $server_data[$proto],
                        mb_strtoupper($proto_dsp),
                        ($proto === 'imap' ? ' / JMAP ' . $server_data['jmap'] . ($server_data[$proto] > 1 ? ' sources' : ' source') : ($server_data[$proto] > 1 ? ' sources' : ' source'))
                    );

and filter from here:

if (data_source_available($modules, 'imap')) {
            $imap_servers = count(array_filter(Hm_IMAP_List::dump(false), function($v) { return !array_key_exists('type', $v);}));
            $jmap_servers = count(array_filter(Hm_IMAP_List::dump(false), function($v) { return array_key_exists('type', $v) && $v['type'] == 'jmap'; }));
        }
$this->out('nux_server_setup', array(
            'imap' => $imap_servers,
            'jmap' => $jmap_servers,
            'feeds' => $feed_servers,
            'smtp' => $smtp_servers,
            'profiles' => $profiles
        ));

apply changers

Copy link
Member

@Shadow243 Shadow243 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more change and we are done. Make sure you rebase too to make selenium test working

modules/nux/modules.php Outdated Show resolved Hide resolved
modules/nux/modules.php Outdated Show resolved Hide resolved
@Shadow243
Copy link
Member

Check your logs, there is an Fatal error PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in

@Bienvenumoringa
Copy link
Member Author

Check your logs, there is an Fatal error PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in

It okay @Shadow243

@Shadow243
Copy link
Member

It okay @Shadow243

There is a calculation error, try locally especially with several servers connected and correct, then ping me

@Shadow243
Copy link
Member

Shadow243 commented Nov 13, 2024

We will no longer need to add at sesction Welcome to Cypht because it will come with #1278 but we can update section Help may be add EWS too

@kroky
Copy link
Member

kroky commented Nov 13, 2024

Oops, yes, #1278 already included separation of imap, jmap, ews and smtp servers, so no need to do it here.

@Shadow243 Shadow243 force-pushed the promote-jmap-in-the-UI branch from 524cefd to c44ef43 Compare November 25, 2024 06:31
@Shadow243 Shadow243 changed the title [UI] modules.php : Modify the text to explain that Cypht supports JMAP (RFC8621) by default. ref(other): promote JMAP & EWS in the UI Nov 25, 2024
@Shadow243 Shadow243 changed the title ref(other): promote JMAP & EWS in the UI refactor(other): promote JMAP & EWS in the UI Nov 25, 2024
@Shadow243
Copy link
Member

@marclaporte I added EWS too

@marclaporte
Copy link
Member

Here is the sentence now:
Cypht is a webmail program. You can use it to access your E-mail accounts from any service that offers IMAP, or SMTP access - which most do. And Cypht also supports the newest protocol: JMAP (RFC8621) and EWS.').

It is a little convoluted and some may not know what EWS.

I propose:

Cypht is a webmail aggregator client. You can use it to access your E-mail accounts from any server or service that offers any of the main protocols: IMAP/SMTP, Exchange Web Services (EWS) or the newest protocol: JMAP (RFC8621).

@Shadow243 Shadow243 force-pushed the promote-jmap-in-the-UI branch from c44ef43 to a47c2dd Compare November 29, 2024 00:08
@Shadow243 Shadow243 merged commit 4ebdcfe into cypht-org:master Nov 29, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants