MCMrARM / revolution-irc

A modern Android IRC client. #revolutionirc on Libera.chat
GNU General Public License v3.0
548 stars 63 forks source link

Validate settings #349

Open kurahaupo opened 9 months ago

kurahaupo commented 9 months ago

Validate the fields and give warnings when validations fail.

In particular:

Among other things, this will detect the case where people try to put a URI instead of a hostname (as exemplified by #328).


Future enhancement: also permit a name that (when prefixed by _irc._tcp. or _ircs._tcp) has a DNS SRV record. (This would require additional logic when connecting.)

These give a list of priority, weight, hostname, port tuples:

$ dig +short srv _irc._tcp.example.chat.
 1 100 6667 loadbalancer.irc.example.chat.
 2  20  194 host1.irc.example.chat.
 2  80  194 bighost.irc.example.chat.
 3 100 7000 fallback.irc.example.chat.
$ dig +short srv _ircs._tcp.example.chat.
 1 100 6697 loadbalancer.irc.example.chat.
 2  40 6697 host1.irc.example.chat.
 2  20 6697 host2.irc.example.chat.
 2  20 6697 host3.irc.example.chat.
 2  20 6697 host4.irc.example.chat.
 3 100 7001 fallback.irc.example.chat.
$ dig +short srv _irc._tcp.libera.example.lookaside.
 1   1 6667 irc.libera.chat.
$ dig +short srv _ircs._tcp.libera.example.lookaside.
 1   1 6697 irc.libera.chat.