+static void
+check_username_for_provider (const gchar *provider_id,
+ const gchar *domain,
+ gchar **username)
+{
+ gchar *providers_to_check[] = { "ovi.com", "yahoomailplus.com" };
+ gint i;
+ gboolean found = FALSE;
+ gchar *old;
+
+ /* Check if the username contains the @hostname, if not then add it */
+ if (strchr (*username, '@'))
+ return;
+
+ /* Check if it's one of the providers to check */
+ for (i = 0; i < G_N_ELEMENTS (providers_to_check) && !found; i++) {
+ if (!g_ascii_strncasecmp (providers_to_check[i], provider_id, strlen (providers_to_check[i])))
+ found = TRUE;
+ }
+
+ if (!found)
+ return;
+
+ /* Replace the username */
+ old = *username;
+ *username = g_strconcat (*username, "@", domain, NULL);
+ g_free (old);
+}
+