I have created messages to notify users that they have been tagged in a picture or that someone commented after them on a thread; pretty much like facebook-style notifications.
How could I detect if a message targeting a user is new to him?
I had two ideas:
- compare the timestamp of when the message has been created and the session timestamp. The session timestamp is refreshed every time a session requests a new page so I don't know if I can catch the previous value of this timestamp?
- catch the same event that triggers
Would there be any other method to do that?
A recent post "This is a New Message/You have 4 New Messages" has been submitted in the issue queue of the Message module but apparently, it doesn't contain any built-in function to see if the message is new.