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

Fix #1387
This commit is contained in:
Cédric Bellegarde 2022-06-30 22:21:11 +02:00
parent b2aa7d7bc7
commit e7e4be09bc

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);