Add a bunch of new logging

This commit is contained in:
Tulir Asokan
2019-01-21 23:55:16 +02:00
parent 79bd35964f
commit 9e170f3d04
9 changed files with 53 additions and 30 deletions

View File

@ -129,10 +129,9 @@ func (msg *Message) encodeBinaryContent() []byte {
return buf.Bytes()
}
func (msg *Message) Insert() error {
func (msg *Message) Insert() {
_, err := msg.db.Exec("INSERT INTO message VALUES (?, ?, ?, ?, ?, ?)", msg.Chat.JID, msg.Chat.Receiver, msg.JID, msg.MXID, msg.Sender, msg.encodeBinaryContent())
if err != nil {
msg.log.Warnfln("Failed to insert %s@%s: %v", msg.Chat, msg.JID, err)
}
return err
}