mirror of https://github.com/Icinga/icinga2.git
Checkable#RemoveCommentsByType(): remove redundant parameter
This commit is contained in:
parent
cf517050bc
commit
dceb29c742
|
@ -275,7 +275,7 @@ Dictionary::Ptr ApiActions::RemoveAcknowledgement(const ConfigObject::Ptr& objec
|
|||
String removedBy (HttpUtility::GetLastParameter(params, "author"));
|
||||
|
||||
checkable->ClearAcknowledgement(removedBy);
|
||||
checkable->RemoveCommentsByType(CommentAcknowledgement, removedBy);
|
||||
checkable->RemoveAckComments(removedBy);
|
||||
|
||||
return ApiActions::CreateResult(200, "Successfully removed acknowledgement for object '" + checkable->GetName() + "'.");
|
||||
}
|
||||
|
|
|
@ -321,7 +321,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||
olock.Unlock();
|
||||
|
||||
if (remove_acknowledgement_comments)
|
||||
RemoveCommentsByType(CommentAcknowledgement);
|
||||
RemoveAckComments();
|
||||
|
||||
Dictionary::Ptr vars_after = new Dictionary({
|
||||
{ "state", new_state },
|
||||
|
|
|
@ -19,14 +19,15 @@ void Checkable::RemoveAllComments()
|
|||
}
|
||||
}
|
||||
|
||||
void Checkable::RemoveCommentsByType(int type, const String& removedBy)
|
||||
void Checkable::RemoveAckComments(const String& removedBy)
|
||||
{
|
||||
for (const Comment::Ptr& comment : GetComments()) {
|
||||
/* Do not remove persistent comments from an acknowledgement */
|
||||
if (comment->GetEntryType() == CommentAcknowledgement && comment->GetPersistent())
|
||||
continue;
|
||||
if (comment->GetEntryType() == CommentAcknowledgement) {
|
||||
/* Do not remove persistent comments from an acknowledgement */
|
||||
if (comment->GetPersistent()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (comment->GetEntryType() == type) {
|
||||
{
|
||||
ObjectLock oLock (comment);
|
||||
comment->SetRemovedBy(removedBy);
|
||||
|
|
|
@ -156,7 +156,7 @@ public:
|
|||
|
||||
/* Comments */
|
||||
void RemoveAllComments();
|
||||
void RemoveCommentsByType(int type, const String& removedBy = String());
|
||||
void RemoveAckComments(const String& removedBy = String());
|
||||
|
||||
std::set<Comment::Ptr> GetComments() const;
|
||||
Comment::Ptr GetLastComment() const;
|
||||
|
|
|
@ -665,7 +665,7 @@ void ExternalCommandProcessor::RemoveSvcAcknowledgement(double, const std::vecto
|
|||
service->ClearAcknowledgement("");
|
||||
}
|
||||
|
||||
service->RemoveCommentsByType(CommentAcknowledgement);
|
||||
service->RemoveAckComments();
|
||||
}
|
||||
|
||||
void ExternalCommandProcessor::AcknowledgeHostProblem(double, const std::vector<String>& arguments)
|
||||
|
@ -738,7 +738,7 @@ void ExternalCommandProcessor::RemoveHostAcknowledgement(double, const std::vect
|
|||
ObjectLock olock(host);
|
||||
host->ClearAcknowledgement("");
|
||||
}
|
||||
host->RemoveCommentsByType(CommentAcknowledgement);
|
||||
host->RemoveAckComments();
|
||||
}
|
||||
|
||||
void ExternalCommandProcessor::EnableHostgroupSvcChecks(double, const std::vector<String>& arguments)
|
||||
|
|
Loading…
Reference in New Issue