Search in sources :

Example 1 with TopicReplySpammer

use of net.jforum.util.mail.TopicReplySpammer in project jforum2 by rafaelsteil.

the class TopicsCommon method notifyUsers.

/**
 * Sends a "new post" notification message to all users watching the topic.
 *
 * @param t The changed topic
 * @param p The new message
 */
public static void notifyUsers(Topic t, Post p) {
    if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_NOTIFY_ANSWERS)) {
        TopicDAO dao = DataAccessDriver.getInstance().newTopicDAO();
        List usersToNotify = dao.notifyUsers(t);
        // subscribed to the topic
        if (usersToNotify != null && usersToNotify.size() > 0) {
            Executor.execute(new EmailSenderTask(new TopicReplySpammer(t, p, usersToNotify)));
        }
    }
}
Also used : EmailSenderTask(net.jforum.util.mail.EmailSenderTask) TopicDAO(net.jforum.dao.TopicDAO) ArrayList(java.util.ArrayList) List(java.util.List) TopicReplySpammer(net.jforum.util.mail.TopicReplySpammer)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 TopicDAO (net.jforum.dao.TopicDAO)1 EmailSenderTask (net.jforum.util.mail.EmailSenderTask)1 TopicReplySpammer (net.jforum.util.mail.TopicReplySpammer)1