future: Allow to pass an error value alongside result

This commit is contained in:
fox.cpp 2019-12-10 02:00:47 +03:00
parent 7be7556b69
commit 122168bef1
No known key found for this signature in database
GPG key ID: E76D97CCEDE90B6C
7 changed files with 79 additions and 36 deletions

View file

@ -165,11 +165,14 @@ func (s *state) expandCommand(address string) (string, []string) {
if s.msgMeta.Conn == nil {
return ""
}
val, _ := s.msgMeta.Conn.RDNSName.Get().(string)
if val == "" {
valI, err := s.msgMeta.Conn.RDNSName.Get()
if err != nil {
return ""
}
return ""
if valI == nil {
return ""
}
return valI.(string)
case "{msg_id}":
return s.msgMeta.ID
case "{sender}":