| 238 | } |
| 239 | |
| 240 | void Comment::CommentsExpireTimerHandler() |
| 241 | { |
| 242 | std::vector<Comment::Ptr> comments; |
| 243 | |
| 244 | for (const Comment::Ptr& comment : ConfigType::GetObjectsByType<Comment>()) { |
| 245 | comments.push_back(comment); |
| 246 | } |
| 247 | |
| 248 | for (const Comment::Ptr& comment : comments) { |
| 249 | /* Only remove comments which are activated after daemon start. */ |
| 250 | if (comment->IsActive() && comment->IsExpired()) { |
| 251 | /* Do not remove persistent comments from an acknowledgement */ |
| 252 | if (comment->GetEntryType() == CommentAcknowledgement && comment->GetPersistent()) |
| 253 | continue; |
| 254 | |
| 255 | RemoveComment(comment->GetName()); |
| 256 | } |
| 257 | } |
| 258 | } |