Line data Source code
1 : // Copyright (C) 2009 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.server.mail.send; 16 : 17 : import com.google.gerrit.entities.Change; 18 : import com.google.gerrit.entities.Project; 19 : import com.google.gerrit.exceptions.EmailException; 20 : import com.google.gerrit.extensions.api.changes.RecipientType; 21 : import com.google.gerrit.server.query.change.ChangeData; 22 : 23 : /** Alert a user to a reply to a change, usually commentary made during review. */ 24 : public abstract class ReplyToChangeSender extends ChangeEmail { 25 : public interface Factory<T extends ReplyToChangeSender> { 26 : T create(Project.NameKey project, Change.Id id); 27 : } 28 : 29 : protected ReplyToChangeSender(EmailArguments args, String messageClass, ChangeData changeData) { 30 84 : super(args, messageClass, changeData); 31 84 : } 32 : 33 : @Override 34 : protected void init() throws EmailException { 35 84 : super.init(); 36 : 37 84 : final String threadId = getChangeMessageThreadId(); 38 84 : setHeader("In-Reply-To", threadId); 39 84 : setHeader("References", threadId); 40 : 41 84 : rcptToAuthors(RecipientType.TO); 42 84 : } 43 : }