Delta Chat Core C Interface
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dc_provider_t Class Reference

Opaque object containing information about one single e-mail provider. More...

#include <deltachat.h>

Public Member Functions

char * dc_provider_get_before_login_hint (const dc_provider_t *provider)
 Get hints to be shown to the user on the login screen.
 
char * dc_provider_get_overview_page (const dc_provider_t *provider)
 URL of the overview page.
 
int dc_provider_get_status (const dc_provider_t *provider)
 Whether DC works with this provider.
 
dc_provider_tdc_provider_new_from_email (const dc_context_t *context, const char *email)
 Create a provider struct for the given e-mail address by local lookup.
 
dc_provider_tdc_provider_new_from_email_with_dns (const dc_context_t *context, const char *email)
 Create a provider struct for the given e-mail address by local and DNS lookup.
 
void dc_provider_unref (dc_provider_t *provider)
 Free the provider info struct.
 

Detailed Description

Opaque object containing information about one single e-mail provider.

Member Function Documentation

◆ dc_provider_get_before_login_hint()

char * dc_provider_get_before_login_hint ( const dc_provider_t * provider)

Get hints to be shown to the user on the login screen.

Depending on the DC_PROVIDER_STATUS returned by dc_provider_get_status(), the UI may want to highlight the hint.

Moreover, the UI should display a "More information" link that forwards to the URL returned by dc_provider_get_overview_page().

Parameters
providerThe dc_provider_t struct.
Returns
A string with the hint to show to the user, may contain multiple lines, if there is no such hint, an empty string is returned, NULL is never returned. The returned value must be released using dc_str_unref().

◆ dc_provider_get_overview_page()

char * dc_provider_get_overview_page ( const dc_provider_t * provider)

URL of the overview page.

This URL allows linking to the providers page on providers.delta.chat.

Parameters
providerThe dc_provider_t struct.
Returns
A string with a fully-qualified URL, if there is no such URL, an empty string is returned, NULL is never returned. The returned value must be released using dc_str_unref().

◆ dc_provider_get_status()

int dc_provider_get_status ( const dc_provider_t * provider)

Whether DC works with this provider.

Can be one of DC_PROVIDER_STATUS_OK, DC_PROVIDER_STATUS_PREPARATION or DC_PROVIDER_STATUS_BROKEN.

Parameters
providerThe dc_provider_t struct.
Returns
The status as a constant number.

◆ dc_provider_new_from_email()

dc_provider_t * dc_provider_new_from_email ( const dc_context_t * context,
const char * email )

Create a provider struct for the given e-mail address by local lookup.

Lookup is done from the local database by extracting the domain from the e-mail address. Therefore the provider for custom domains cannot be identified.

Parameters
contextThe context object.
emailThe user's e-mail address to extract the provider info form.
Returns
A dc_provider_t struct which can be used with the dc_provider_get_* accessor functions. If no provider info is found, NULL will be returned.

◆ dc_provider_new_from_email_with_dns()

dc_provider_t * dc_provider_new_from_email_with_dns ( const dc_context_t * context,
const char * email )

Create a provider struct for the given e-mail address by local and DNS lookup.

First lookup is done from the local database as of dc_provider_new_from_email(). If the first lookup fails, an additional DNS lookup is done, trying to figure out the provider belonging to custom domains.

Parameters
contextThe context object.
emailThe user's e-mail address to extract the provider info form.
Returns
A dc_provider_t struct which can be used with the dc_provider_get_* accessor functions. If no provider info is found, NULL will be returned.

◆ dc_provider_unref()

void dc_provider_unref ( dc_provider_t * provider)

Free the provider info struct.

Parameters
providerThe dc_provider_t struct.

The documentation for this class was generated from the following file: