recommended fixes [1 of 2]
This commit is contained in:
parent
c2382d29a1
commit
de2ca33700
4 changed files with 36 additions and 31 deletions
|
@ -456,6 +456,11 @@ func readMessages(rows *sql.Rows) ([]*message, error) {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
senderIP, err := netip.ParseAddr(sender)
|
||||
if err != nil {
|
||||
senderIP = netip.IPv4Unspecified() // if no IP stored in database, 0.0.0.0
|
||||
}
|
||||
|
||||
var att *attachment
|
||||
if attachmentName != "" && attachmentURL != "" {
|
||||
att = &attachment{
|
||||
|
@ -479,7 +484,7 @@ func readMessages(rows *sql.Rows) ([]*message, error) {
|
|||
Icon: icon,
|
||||
Actions: actions,
|
||||
Attachment: att,
|
||||
Sender: netip.MustParseAddr(sender), // Must parse assuming database must be correct
|
||||
Sender: senderIP, // Must parse assuming database must be correct
|
||||
Encoding: encoding,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue