XF 2.2 About alarms

Robert9

Well-known member
I never cared much about alarms.
If one should be sent, I use the usual code. Sender, receiver, text ...

But:
I never tried, what is happening, if I use a function ten times in a minute.
Will I have ten alarms?

I will try this now with a new add-on.

But:
If I do 20 add-ons now, then i have the freedom to care or not care 20 times for alarms?
Is there nothing inside the machinery to say: "Hey, we have sent this alarm a minute ago! Go and play with someone else! You cant have this alarm for the next 12.5 minutes!"

And if we don't have this, why don't we have this?


New alarm => setup, check
do we have it?
From when?
Decline it, approve it.

User option: Set time for decline identical alarms.

And because we are good people we do:

level 0 => send everything what comes inside!
level 1 => all 10 minutes
level 2 => ll 60 minutes
level 3 ... one time in a day
level 4 ... one time in a week
level 5 ... one time in a month

Then an alert should be set with level.
0 when care for yourself.
Level 1 to x for not repeating the stuff ...
 

>>> Global Optional, Alert summarization by selected content type or user

Is this what I want?
 
I never tried, what is happening, if I use a function ten times in a minute.
Will I have ten alarms?
A am not entirely sure what "alarm" does mean to you in XenForo context, but to me it seems you are talking about alerts.

Unless you have specific code in place to prevent alters being send ins some cases, every alter you generate will be send - if you generate one alter per minute the user will receive one alter per minute.

And if we don't have this, why don't we have this?
Basically only the code triggering an alert "knows" if it makes sense to send an alert (or not).

For example there are alerts when a user is quoted in a post and alerts when a post received a reaction.
If there are a lot of reactions (for the same post), I might not be interested in being notified about evey single reaction - just a sum might be suufficient.

On the other hand I think it is pretty safe to assume that I'd be interested to be notified about every post where I got quoted.
 
Again, the example is editing a post.
I will try to set a time period where a second alert should not be sent (when a second edit is done)

But I am not certain how to do it, I have to view code and examples.

Probably I will try to see if an alert is existing, but maybe alerts are deleted, when viewed?
Else, I could collect them somewhere and send them later?
 
Again, the example is editing a post.
Erm, where did you say that you want to create alerts when a post is edited?
I must have missed that or you did not give this info yet :)

I will try to set a time period where a second alert should not be sent (when a second edit is done)
If you want a "waterproof" solution you will have to implement your own tracking code as not all edits might be logged in the edit log (it is poossible to silently edit posts which does not generate log entries) and alert records might have been already deleted (if the period is long enough).
 
I am not sure what to do, but I don't want to have 20 alerts, when a user needs 20 tries to edit a post.
 
In this case: Don't send 20 alerts ;)

An easy approach to limit alerts (for the same post edited several times within period X) might be to use \XF\Service\FloodCheck
 
Top Bottom