enough_coi 0.0.5

Experimental COI client for Dart developers.

Available under the commercial friendly MPL Mozilla Public License 2.0.

Usage #

A simple usage example:

import 'package:enough_coi/enough_coi.dart';

void main() async {
  var client = await CoiClient.init('enough.de');
  var email = 'user@domain.com';
  var config = await client.discover(email);
  if (config != null) {
    var account = await client.tryLogin(email, config, password: 'secret');
    if (account != null) {
      var isChatMessage = true;
      var recipients = ['Lise.Meitner@domain.com'];
      var messageSent = await client.sendMessage(
          isChatMessage, 'Hello COI world!', recipients, account);
      print('message has been sent: $messageSent');
    }
  }
}

Installation #

Add this dependency your pubspec.yaml file:

dependencies:
  enough_coi: ^0.0.4

For more info visit pub.dev.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.0.5 #

  • Support for COI functions:
  • retrieve COI server settings
  • enable or disable COI for a user
  • read and write the chat message filtering rule on the server
  • read the root mailbox along with Chats and Contacts mailboxes
  • support the WebPush IMAP extension

0.0.4 #

  • removeAccount() now returns bool, added option to force SSL usage when discovering accounts

0.0.3 #

  • Use update enough_mail package

0.0.2 #

  • Add json encoding support

0.0.1 #

  • Initial version

example/enough_coi_example.dart

import 'package:enough_coi/enough_coi.dart';

void main() async {
  var client = await CoiClient.init('enough.de');
  var email = 'user@domain.com';
  var config = await client.discover(email);
  if (config != null) {
    var account = await client.tryLogin(email, config, password: 'secret');
    if (account != null) {
      var isChatMessage = true;
      var recipients = ['Lise.Meitner@domain.com'];
      var messageSent = await client.sendMessage(
          isChatMessage, 'Hello COI world!', recipients, account);
      print('message has been sent: $messageSent');
    }
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  enough_coi: ^0.0.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:enough_coi/enough_coi.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
29
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Feb 17, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/src/mail_storage.dart. (-1.49 points)

Analysis of lib/src/mail_storage.dart reported 3 hints:

line 5 col 16: The value of the field '_password' isn't used.

line 6 col 16: The value of the field '_accountGuid' isn't used.

line 28 col 9: The value of the local variable 'threadId' isn't used.

Fix lib/web_push.dart. (-0.50 points)

Analysis of lib/web_push.dart reported 1 hint:

line 3 col 8: Unused import: 'package:enough_coi/enough_coi.dart'.

Format lib/coi_server_config.dart.

Run dartfmt to format lib/coi_server_config.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/contact.dart (Run dartfmt to format lib/contact.dart.)
  • lib/conversation.dart (Run dartfmt to format lib/conversation.dart.)
  • lib/src/conversation_manager.dart (Run dartfmt to format lib/src/conversation_manager.dart.)
  • lib/src/string_helper.dart (Run dartfmt to format lib/src/string_helper.dart.)

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
basic_utils ^2.4.7 2.4.9
enough_mail ^0.0.4 0.0.5
event_bus ^1.1.0 1.1.1
json_annotation ^3.0.1 3.0.1
objectdb ^1.0.7+1 1.0.7+1
uuid ^2.0.4 2.0.4
xml ^3.7.0 3.7.0
Transitive dependencies
asn1lib 0.6.0
async 2.4.0
charcode 1.1.3
collection 1.14.12
convert 2.1.1
crypto 2.1.4
deeply 1.0.1
execution_queue 1.0.2
http 0.12.0+4
http_parser 3.1.3
intl 0.16.1
logging 0.11.4
meta 1.1.8
path 1.6.4
petitparser 3.0.1
pointycastle 1.0.2
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner ^1.7.3
json_serializable ^3.2.5
pedantic ^1.8.0 1.9.0
test ^1.6.0