mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 06:05:01 +02:00
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"));
|
String removedBy (HttpUtility::GetLastParameter(params, "author"));
|
||||||
|
|
||||||
checkable->ClearAcknowledgement(removedBy);
|
checkable->ClearAcknowledgement(removedBy);
|
||||||
checkable->RemoveCommentsByType(CommentAcknowledgement, removedBy);
|
checkable->RemoveAckComments(removedBy);
|
||||||
|
|
||||||
return ApiActions::CreateResult(200, "Successfully removed acknowledgement for object '" + checkable->GetName() + "'.");
|
return ApiActions::CreateResult(200, "Successfully removed acknowledgement for object '" + checkable->GetName() + "'.");
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
olock.Unlock();
|
olock.Unlock();
|
||||||
|
|
||||||
if (remove_acknowledgement_comments)
|
if (remove_acknowledgement_comments)
|
||||||
RemoveCommentsByType(CommentAcknowledgement);
|
RemoveAckComments();
|
||||||
|
|
||||||
Dictionary::Ptr vars_after = new Dictionary({
|
Dictionary::Ptr vars_after = new Dictionary({
|
||||||
{ "state", new_state },
|
{ "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()) {
|
for (const Comment::Ptr& comment : GetComments()) {
|
||||||
/* Do not remove persistent comments from an acknowledgement */
|
if (comment->GetEntryType() == CommentAcknowledgement) {
|
||||||
if (comment->GetEntryType() == CommentAcknowledgement && comment->GetPersistent())
|
/* Do not remove persistent comments from an acknowledgement */
|
||||||
continue;
|
if (comment->GetPersistent()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (comment->GetEntryType() == type) {
|
|
||||||
{
|
{
|
||||||
ObjectLock oLock (comment);
|
ObjectLock oLock (comment);
|
||||||
comment->SetRemovedBy(removedBy);
|
comment->SetRemovedBy(removedBy);
|
||||||
|
@ -156,7 +156,7 @@ public:
|
|||||||
|
|
||||||
/* Comments */
|
/* Comments */
|
||||||
void RemoveAllComments();
|
void RemoveAllComments();
|
||||||
void RemoveCommentsByType(int type, const String& removedBy = String());
|
void RemoveAckComments(const String& removedBy = String());
|
||||||
|
|
||||||
std::set<Comment::Ptr> GetComments() const;
|
std::set<Comment::Ptr> GetComments() const;
|
||||||
Comment::Ptr GetLastComment() const;
|
Comment::Ptr GetLastComment() const;
|
||||||
|
@ -665,7 +665,7 @@ void ExternalCommandProcessor::RemoveSvcAcknowledgement(double, const std::vecto
|
|||||||
service->ClearAcknowledgement("");
|
service->ClearAcknowledgement("");
|
||||||
}
|
}
|
||||||
|
|
||||||
service->RemoveCommentsByType(CommentAcknowledgement);
|
service->RemoveAckComments();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalCommandProcessor::AcknowledgeHostProblem(double, const std::vector<String>& arguments)
|
void ExternalCommandProcessor::AcknowledgeHostProblem(double, const std::vector<String>& arguments)
|
||||||
@ -738,7 +738,7 @@ void ExternalCommandProcessor::RemoveHostAcknowledgement(double, const std::vect
|
|||||||
ObjectLock olock(host);
|
ObjectLock olock(host);
|
||||||
host->ClearAcknowledgement("");
|
host->ClearAcknowledgement("");
|
||||||
}
|
}
|
||||||
host->RemoveCommentsByType(CommentAcknowledgement);
|
host->RemoveAckComments();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalCommandProcessor::EnableHostgroupSvcChecks(double, const std::vector<String>& arguments)
|
void ExternalCommandProcessor::EnableHostgroupSvcChecks(double, const std::vector<String>& arguments)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user