pipoteam / pipobot-modules

Some modules that can be used with 'pipobot', a modular bot for Jabber MUCs
8 stars 7 forks source link

URL: Do not send "OLD!" messages whenever the URL was shared recently #22

Open nightmared opened 6 years ago

nightmared commented 6 years ago

This tiny commit prevent pipobot from displaying "OLD!" messages multiples times in a row when the link in question was shared less than 24h ago. My only issue concerning this (rather minor) change is that I'm unsure whether the database will be upgraded automatically or if it requires manual intervention (as I've changed the database format of the URL module by adding a column).


EDIT: fixed a typo

mcarton commented 6 years ago

The whole point of that module is that if someone posts a news article on the same day as somebody else, pipobot (gently) tells you about it. You should reduce that time to something like 1min or ignore messages starting with > if your goal is to keep pipo quite when quoting.

nightmared commented 6 years ago

Right, this should be fixed. As for ignoring messages starting with '>', that is doable but I doubt of its interest as there is no standard way of quoting messages.

sleduc commented 6 years ago

I guess the delay could be set as a parameter in the configuration file, with 0 as default if none is provided. This way the default behavior will not be changed, and you will be able to easily change the delay to the value you want.

Regarding the update of the database I am not sure, the simplest way would be to test it, but I guess a manual operation would be required to add the column in existing databases.

nightmared commented 6 years ago

As suggested (a long time ago, sorry !), I have added an option to select the time between two submissions (it defaults for now to a mintue). It also doesn't prompt any message if the page had a different title when it was last posted.