New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track "active" WhatsApp users and implement blocking when reaching the limit #323
base: main
Are you sure you want to change the base?
Track "active" WhatsApp users and implement blocking when reaching the limit #323
Conversation
9068b7b
to
b5ec1af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from what I know (and just learned) about Go.
I don't think we're going to use the minDays = 0
right away, but I want to flag that it wouldn't work as I expected it to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sensible, though you'll also need to add PuppetInactivityDays
to the config defaults I would suspect, like the other new items?
@@ -1393,6 +1397,9 @@ func (portal *Portal) HandleTextMessage(source *User, message whatsapp.TextMessa | |||
} else { | |||
portal.finishHandling(source, message.Info.Source, resp.EventID) | |||
} | |||
sender := portal.bridge.GetPuppetByJID(message.Info.SenderJid) | |||
sender.UpdateActivityTs(message.Info.Timestamp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to be careful not to store historical message times.
@@ -60,6 +60,13 @@ type Config struct { | |||
Avatar string `yaml:"avatar"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Add a notice to the admin room
This PR intends to do two things: