From d3f24b31ec7761d8f6345d9fba2640362caa60de Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 7 Aug 2013 15:57:35 +0200 Subject: [PATCH] ido: Fixes for comments. refs #4380 --- lib/icinga/service-comment.cpp | 2 -- lib/ido/servicedbobject.cpp | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/icinga/service-comment.cpp b/lib/icinga/service-comment.cpp index 850835d52..874dccaa0 100644 --- a/lib/icinga/service-comment.cpp +++ b/lib/icinga/service-comment.cpp @@ -250,8 +250,6 @@ void Service::RefreshCommentsCache(void) l_CommentsExpireTimer->OnTimerExpired.connect(boost::bind(&Service::CommentsExpireTimerHandler)); l_CommentsExpireTimer->Start(); } - - OnCommentsChanged(Service::Ptr(), Empty, CommentChangedUpdated); } void Service::RemoveCommentsByType(int type) diff --git a/lib/ido/servicedbobject.cpp b/lib/ido/servicedbobject.cpp index 7b8bbd25b..33543e3da 100644 --- a/lib/ido/servicedbobject.cpp +++ b/lib/ido/servicedbobject.cpp @@ -204,6 +204,9 @@ void ServiceDbObject::OnConfigUpdate(void) OnQuery(query1); } + /* update comments */ + OnCommentsChanged(service, Empty, CommentChangedUpdated); + /* service host config update */ Host::Ptr host = service->GetHost(); @@ -344,7 +347,7 @@ void ServiceDbObject::CommentsChangedHandler(const Service::Ptr& svcfilter, cons /* newly added comment */ Log(LogDebug, "ido", "adding service comment (id = " + id + ") for '" + service->GetName() + "'"); - entry_time = static_cast(comment->Get("entry_time")); + entry_time = static_cast(add_comment->Get("entry_time")); entry_time_usec = (add_comment->Get("entry_time") - entry_time) * 1000 * 1000; fields2 = boost::make_shared();