def tag_source(event): watches = [] for topic in event.topics: for (tag, count) in topic.tags: watches = watchlist.traverse_watchlist(tag) for watch in set(watches): yield Notification(event, watch.user, watch=watch)
def comment_source(event): if event.event == T_COMMENT_EDIT: for revision in event.comment.revisions: yield Notification(event, revision.user, type=N_COMMENT_EDIT) if 'comment' in event.data: for watch in watchlist.traverse_watchlist(event.comment): yield Notification(event, watch.user, watch=watch)
def watchlist_source(event): watches = watchlist.traverse_watchlist(event.user) for topic in event.topics: watches += watchlist.traverse_watchlist(topic) for watch in watches: yield Notification(event, watch.user, watch=watch)