Merge branch '1387' into 'mainline'

engine: api: AccountInformation: Do not convert string to human-readable if looks like an ip

Closes #1387

See merge request GNOME/geary!732
This commit is contained in:
Cédric Bellegarde 2022-07-05 19:47:13 +00:00
commit 1c5f021105

View file

@ -54,7 +54,8 @@ public class Geary.AccountInformation : BaseObject {
value = email_domain;
} else {
string[] host_parts = this.incoming.host.split(".");
if (host_parts.length > 2) {
// If first part is an integer, looks like an ip so ignore it
if (host_parts.length > 2 && int.parse(host_parts[0]) == 0) {
host_parts = host_parts[1:host_parts.length];
}
value = string.joinv(".", host_parts);