I am building a small social media site, and I am trying to make a system, where if you like a post, the user who owns the post gets a notification. This is the function that gets executed when the post is liked:
def notification():
print("STARTING")
socketio.emit('notification', {'data': 'got it!'})
print("DONE")
Now, when a post is liked everyone gets an alert in javascript. How could I make it so that only the user who owns the post gets this notification, and only if the user is currently on the site?? Thank you in advanced!