add debug info to inspect issues

This commit is contained in:
Andriy Cherniy 2024-01-04 21:05:56 +02:00
parent 36b3b5f256
commit 71b3ac18fa

View file

@ -239,7 +239,14 @@ notif_loop:
}) })
} }
if notif.Type == "mention" {
log.Debugf("post %v mentioned bot", notif.Status.ID)
}
if notif.Type == "mention" && notif.Status.InReplyToID == nil && notif.Status.InReplyToAccountID == nil { if notif.Type == "mention" && notif.Status.InReplyToID == nil && notif.Status.InReplyToAccountID == nil {
log.Debugf(`post passed reply check (%v)
text: %v
actor: %v`, notif.Status.ID, notif.Status.Content, notif.Account.Acct)
subscribers, err := masto_client.GetAccountFollowers(ctx, masto_user.ID, &mastodon.Pagination{Limit: 10000}) subscribers, err := masto_client.GetAccountFollowers(ctx, masto_user.ID, &mastodon.Pagination{Limit: 10000})
if err != nil { if err != nil {
log.Error(err) log.Error(err)
@ -256,6 +263,7 @@ notif_loop:
} }
if ok && notif.Status.Visibility == "public" { if ok && notif.Status.Visibility == "public" {
log.Debugf("post %v is public and has subscription", notif.Status.ID)
if err := db.Create(&Post{ if err := db.Create(&Post{
PostId: string(notif.Status.ID), PostId: string(notif.Status.ID),
}).Error; err != nil { }).Error; err != nil {