package com.atlassian.stash.internal.notification.commit.handlers;

import com.atlassian.bitbucket.commit.CommitService;
import com.atlassian.stash.internal.notification.handlers.NotificationHelper;
import com.atlassian.bitbucket.notification.commit.CommitDiscussionCommentRepliedNotification;

import java.util.Map;

public class CommitDiscussionCommentRepliedNotificationHandler
        extends AbstractCommitDiscussionNotificationHandler<CommitDiscussionCommentRepliedNotification> {

    protected static final String TEMPLATE = "bitbucket.internal.notification.email.commitDiscussion.comment";

    public CommitDiscussionCommentRepliedNotificationHandler(NotificationHelper helper, CommitService commitService) {
        super(helper, commitService, TEMPLATE);
    }

    @Override
    protected Map<String, Object> getContext(CommitDiscussionCommentRepliedNotification notification) {
        Map<String, Object> context = super.getContext(notification);
        context.put("parent", notification.getParent());
        context.put("comment", notification.getComment());
        return context;
    }
}
