mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Checkable#RemoveCommentsByType(): remove redundant parameter
This commit is contained in:
parent
02ddb4badc
commit
0470fe12a7
@ -263,7 +263,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() + "'.");
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||
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);
|
||||
|
@ -149,7 +149,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…
x
Reference in New Issue
Block a user